What is causing a broken class on re-build of mixed Scala/Java project?

I'm working on a mixed Scala/Java project.

I receive this broke class in Eclipse "problem" tab everytime I re-build the Scala code :

Description Resource    Path    Location    Type
error while loading JsonSerialize$Inclusion, class file 'C:\Users\Adrian\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.13\jackson-mapper-asl-1.9.13.jar(org/codehaus/jackson/map/annotate/JsonSerialize$Inclusion.class)' is broken (class java.lang.UnsupportedOperationException/addChild inapplicable for <none>)   rec-manager     Unknown Scala Problem

Description Resource    Path    Location    Type
error while loading org.codehaus.jackson.map.annotate., class file 'C:\Users\Adrian\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.13\jackson-mapper-asl-1.9.13.jar(org/codehaus/jackson/map/annotate/JsonSerialize$Inclusion.class)' is broken (class java.lang.UnsupportedOperationException/addChild inapplicable for <none>)    rec-manager     Unknown Scala Problem

This issue does not occur when I re-build the Java portion of the code base.

The class does not seem to broken as all is fine when I re-build the Java code.What could be causing this issue ?

If I perform a clean rebuild of the entire project then the issue does not occur.

Answers


I am not sure if this counts as an answer or a work-around. Perhaps you are using m2e plug-in. And from the screen-shot it seems that the problem is not in the project code, but rather in resolving the dependency library classes / methods ( it refers to .m2 repository ).

Could you try generating an Eclipse project from the command prompt and importing the created project into Eclipse.

Open command prompt and cd into the location where pom.xml is located.

Now generate the Eclipse project using Maven command line tool. Note that mvn should be in your PATH variable.

C:\> cd Users\Adrian\project1
REM this folder should contains pom.xml 
C:\Users\Adrian\project1> mvn eclipse:clean eclipse:eclipse

Now import the project into Eclipse

Also I personally never use m2e plugin as it consumes extra resources. Rather, I generate the project using mvn eclipse:eclipse or when using SBT, I do sbt eclipse.

I hope that helps.


Ive updated to the latest version of Ecliplse (Helios) and Scala plugin and this problem no longer occurs.


Need Your Help

Three.js cubeCamera envmap not working

javascript html5 three.js

Hey i got a 2 problems with cubecamera with the three.js plugin.