jackson-module-scala CreatorTest fail using maven, java 1.7, scala 2.11.8

27 views
Skip to first unread message

Steve A.

unread,
Sep 30, 2016, 3:56:47 PM9/30/16
to jackson-dev
I'm trying to compile jackson-scala-module 2.8.3 using a Maven pom.xml file I created based upon the build.sbt file with Java 1.7 and Scala 2.11.8. 

However, line 81 of src/test/scala/com/fasterxml/jackson/module/scala/deser/CreatorTest.scala fails with the following:
Creators should work with static method creator(com.fasterxml.jackson.module.scala.deser.CreatorTest)  Time elapsed: 0-.045 sec  <<< ERROR!
com.faster.jackson.databind.JsonMapingException: Could not find creator property with name 'value' (in class com.fasterxml.jackson.module.scala.deser.ValueHolder)
 at [Source: "2"; line: 1, column: 1]
...

Any idea what could be the problem?

Christopher Currie

unread,
Oct 1, 2016, 12:38:58 PM10/1/16
to jackson-dev
Not without seeing more of the POM. As an aside, what is the motivation for this work?
--
You received this message because you are subscribed to the Google Groups "jackson-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jackson-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steve A.

unread,
Oct 1, 2016, 1:41:39 PM10/1/16
to jackson-dev

On Saturday, October 1, 2016 at 12:38:58 PM UTC-4, Christopher Currie wrote:
Not without seeing more of the POM. As an aside, what is the motivation for this work?

The motivation is that I'm trying to upgrade a client's system on a closed intranet (i.e. air-gap'd from Github) from Scala 2.10.4 and jackson-module-scala_2.10-2.3.2 for which they modified the source code to not include lazy values and replace nulls with None among other things.  And, Maven is the standard build tool; i.e. sbt is not used.

...
<build>
   
<resources>
     
<!-- create target/classes/com/fasterxml/jackson/module/scala/build.properties ->
     
<directory>src/main/resources</directory>
      <filtering>true</
filtering>
   
</resources>
   <plugins>
      <plugin>
         <groupId>net.alchim31.maven</
groupId>
         
<artifactId>scala-maven-plugin</artifactId>
         <version>3.2.2</
version>
         
<executions>
           
<execution>
               
<id>scala-compile-first</id>
               <phase>process-resources</
phase>
               
<goals>
                 
<goal>add-source</goal>
                  <goal>compile</
goal>
               
</goals>
            </
execution>
           
<execution>
               
<id>scala-test-compile</id>
               <phase>process-test-resources</
phase>
               
<goals>
                 
<goal>testCompile</goal>
               </
goals>
           
</execution>
         </
executions>
         
<configuration>
           
<args>
               
<arg>-deprecation</arg>
               <arg>-unchecked</
arg>
               
<arg>-feature</arg>
            </args>
           
<jvmArgs>
               
<jvmArg>-Xms256m</jvmArg>
               <jvmArg>-Xmx1024m</
jvmArg>
               
<jvmArg>-XX:+UseCodeCacheFlushing</jvmArg>
            </
jvmArgs>
           
<javacArgs>
               
<javacArg>-source</javacArg><javacArg>1.7</javacArg>
               
<javacArg>-target</javacArg><javacArg>1.7</javacArg>
           
</javacArgs>
         </
configuration>
     
</plugin>
      <plugin>
         <groupId>org.apache.maven.plugins</
groupId>
         
<artifactId>maven-compiler-plugin</artifactId>
         <version>3.5.1</
version>
         
<configuration>
           
<argLine>-XX:-UseSplitVerifier</argLine>
            <source>1.7</
source>
           
<target>1.7</target>
         </
configuration>
         
<executions>
           
<execution>
               
<phase>compile</compile>
               <goals>
                  <goal>compile</
goal>
               
</goals>
            </
execution>
         
</executions>
      </
plugin>
...

Christopher Currie

unread,
Oct 4, 2016, 11:01:49 PM10/4/16
to jackson-dev
Some syntax errors aside, that looks more or less reasonable, and I don't know why that particular test would be failing, given the same code passes using sbt. My only guess is that the change in build platform is somehow tickling some order-dependent bug in creator detection, either in the Scala module or in Jackson Databind. It will probably take a fair amount of break-point debugging in the code to track it down. I don't have the bandwidth to work on it, but if you have questions about how the code works, I'll do my best to answer them.

Christopher

Reply all
Reply to author
Forward
0 new messages