Announcement Announcement Module
Collapse
No announcement yet.
Spring Data REST and Spring HATEOAS - EVO inflector mandatory ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data REST and Spring HATEOAS - EVO inflector mandatory ?

    Using Spring Data Rest 2.1.0.BUILD-20140520.172759-80 (latest snapshot, cause we are experimenting with the new @Projection feature), we see an error linked to Spring HATEOAS in version 0.12.0.RELEASE (stack trace below)

    This error takes place in our Windows 7 environment, but not under our Linux Fedora 19 systems. Though we suspect this could be linked to a different locale or to another setting of the machine, rather than to a specific OS.

    We managed to work-around it by including the EVO Inflector jar in our project. However, as we understand it from https://github.com/spring-projects/s...elprovider-api, this library should be optional.

    As we have a work-around, we are just curious: Is this a bug ? Or is it linked to something we are not doing in the right way ?

    Thanks.
    Jean-Pol Landrain.

    Code:
    2014-05-21 10:14:20,847 ERROR
    [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/rapnot].[dispatcher]] Servlet.service() for servlet dispatcher threw exception
    java.lang.UnsupportedClassVersionError:
    org/atteo/evo/inflector/English : Unsupported major.minor version 51.0
    (unable to load class org.atteo.evo.inflector.English)
            at
    org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2858)
            at
    org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
            at
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
            at
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
            at
    org.springframework.hateoas.core.EvoInflectorRelProvider.getCollectionResourceRelFor(EvoInflectorRelProvider.java:36)
            at
    org.springframework.data.rest.core.mapping.TypeBasedCollectionResourceMapping.getRel(TypeBasedCollectionResourceMapping.java:97)
            at
    org.springframework.data.rest.core.mapping.RepositoryCollectionResourceMapping.getRel(RepositoryCollectionResourceMapping.java:117)
            at
    org.springframework.data.rest.core.mapping.RepositoryAwareResourceInformation.getRel(RepositoryAwareResourceInformation.java:124)
            at
    org.springframework.data.rest.core.support.RepositoryRelProvider.getCollectionResourceRelFor(RepositoryRelProvider.java:52)
            at
    org.springframework.hateoas.core.DelegatingRelProvider.getCollectionResourceRelFor(DelegatingRelProvider.java:50)
            at
    org.springframework.hateoas.hal.HalEmbeddedBuilder.getDefaultedRelFor(HalEmbeddedBuilder.java:97)
            at
    org.springframework.hateoas.hal.HalEmbeddedBuilder.add(HalEmbeddedBuilder.java:68)
            at org.springframework.hateoas.hal.Jackson2HalModule
    $HalResourcesSerializer.serialize(Jackson2HalModule.java:269)
            at org.springframework.hateoas.hal.Jackson2HalModule
    $HalResourcesSerializer.serialize(Jackson2HalModule.java:237)
            at
    com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:541)
            at
    com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:644)
            at
    com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:152)
            at
    com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:114)
            at
    com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:1837)
            at
    org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.writeInternal(MappingJackson2HttpMessageConverter.java:204)
            at
    org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:179)
            at
    org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:148)
            at
    org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:90)
            at
    org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:189)
            at
    org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:69)
            at
    org.springframework.data.rest.webmvc.ResourceProcessorHandlerMethodReturnValueHandler.handleReturnValue(ResourceProcessorHandlerMethodReturnValueHandler.java:172)
            at
    org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:69)
            at
    org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:122)
            at
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
            at
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
            at
    org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
            at
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
            at
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
            at
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)

  • #2
    Well, I just noticed there is now a 2.1.0.RELEASE of Spring Data REST. Looking at the POM, it has a dependency on evo-inflector in version 1.1. So, we've got our answer.
    Last edited by landrain; May 21st, 2014, 05:12 AM.

    Comment


    • #3
      Unfortunately, we still see the same error with evo-inflector in version 1.1

      Adding a dependency in our project to evo-inflector in version 1.0.1 (in order to override the 1.1.0 that comes with spring-data-rest-core 2.1.0.RELEASE) fixes the problem.
      Last edited by landrain; May 21st, 2014, 05:46 AM.

      Comment


      • #4
        We've got the explanation:

        evo-inflector 1.1 is compiled with JDK 1.7:
        - parent pom: https://github.com/atteo/parent/blob/master/pom.xml
        - versions specified in maven-compiler-plugin:
        <source>1.7</source>
        <target>1.7</target>
        But JDK 1.6 was used for the previous versions, including 1.0.1
        - parent pom: https://github.com/atteo/parent/comm...8c80393deb3468
        - versions specified in maven-compiler-plugin:
        <source>1.6</source>
        <target>1.6</target>
        As we are running with JDK 1.6, we get the error "Unsupported major.minor version 51.0"
        Last edited by landrain; May 21st, 2014, 05:58 AM.

        Comment


        • #5
          Hi, I am the author of Evo Inflector.
          I switched it back to JDK 1.6 and I released version 1.2 with this change on May 22nd.

          Sorry for the inconvenience.

          Regards,
          SÅ‚awek

          Comment

          Working...
          X