Project

General

Profile

Bug #7282

Can't build d1_common_java under java 1.8

Added by Jing Tao over 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
d1_common_java
Target version:
Start date:
2015-07-29
Due date:
% Done:

100%

Estimated time:
0.00 h
Milestone:
None
Product Version:
*
Story Points:
Sprint:

Description

When i tried to build d1_common_java (from the svn trunk) in java 1.8 (oracle) by the command "mvn install", it failed:
[ERROR] Failed to execute goal org.jibx:maven-jibx-plugin:1.2.5:bind (default) on project d1_common_java: Error loading class java.lang.CharSequence: Error reading path java/lang/CharSequence.class for class java.lang.CharSequence -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jibx:maven-jibx-plugin:1.2.5:bind (default) on project d1_common_java: Error loading class java.lang.CharSequence: Error reading path java/lang/CharSequence.class for class java.lang.CharSequence
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error loading class java.lang.CharSequence: Error reading path java/lang/CharSequence.class for class java.lang.CharSequence
at org.jibx.maven.AbstractBaseBindingMojo.compile(AbstractBaseBindingMojo.java:166)
at org.jibx.maven.AbstractBaseBindingMojo.execute(AbstractBaseBindingMojo.java:133)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: java.lang.IllegalStateException: Error loading class java.lang.CharSequence: Error reading path java/lang/CharSequence.class for class java.lang.CharSequence
at org.jibx.binding.classes.ClassCache$ClassCacheLocator.getClassInfo(ClassCache.java:291)
at org.jibx.binding.model.ClassHierarchyContext.accumulateInterfaces(ClassHierarchyContext.java:95)
at org.jibx.binding.model.ClassHierarchyContext.addTypedComponent(ClassHierarchyContext.java:121)
at org.jibx.binding.model.DefinitionContext.addFormat(DefinitionContext.java:527)
at org.jibx.binding.model.BindingElement.defineBaseFormat(BindingElement.java:843)
at org.jibx.binding.model.BindingElement.runValidation(BindingElement.java:865)
at org.jibx.binding.model.BindingElement.runValidation(BindingElement.java:899)
at org.jibx.binding.model.BindingElement.validateBinding(BindingElement.java:969)
at org.jibx.binding.Utility.validateBinding(Utility.java:226)
at org.jibx.binding.Utility.loadBinding(Utility.java:269)
at org.jibx.binding.Utility.loadFileBinding(Utility.java:420)
at org.jibx.binding.Compile.compile(Compile.java:217)
at org.jibx.maven.AbstractBaseBindingMojo.compile(AbstractBaseBindingMojo.java:163)
... 23 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

But it succeeded under java 1.7.

pom.xml Magnifier (17.7 KB) Rob Nahf, 2016-06-21 22:43


Related issues

Related to Infrastructure - Story #7832: migrate from JibX to JAXB for XML binding / codegen In Progress 2016-06-24

History

#1 Updated by Jing Tao over 8 years ago

  • Category set to d1_common_java

#2 Updated by Rob Nahf over 8 years ago

This is widely reported and from the JibX github pages:

https://github.com/jibx/jibx/issues/3

with a particularly salient line from a commenter made mid June, 2105

"I contacted Dennis Sosnosky, the original developer of JiBX and he confirmed that he has no plans of upgrading to Java 8 because his estimate was 8-12 weeks and he could not afford to invest that much effort outside of his regular work hours. Dennis also mentioned that he had made a proposal on the JiBX users list to sponsor a project for him to port over to ASM but no one showed interest."

Momentum for a release 6.0 of apache BCEL - the apparent culprit - seems to be building, with a flurry of recent commit activity. JibX has been waiting on a BCEL fix for a while now (over at last 8 months).

See also:
http://stackoverflow.com/questions/24301986/the-type-java-lang-charsequence-cannot-be-resolved-in-package-declaration/24302496#24302496

#3 Updated by Rob Nahf over 8 years ago

The big difference between JibX and JAXB for marshalling and unmarshalling is JAXB uses reflection. We should probably test JAXB performance before committing to it. http://www.quora.com/What-if-any-are-the-advantages-of-JiBX-over-JAXB.

For tips on creating a good JAXB implementation see all of the answers on this: http://stackoverflow.com/questions/2479886/java-marshaller-performance
The answers here indicate that reflection is only used to create a context (so only do it once!) - but that can very very slow.

#4 Updated by Rob Nahf almost 8 years ago

the JIBX dependency on BCEL getting an update out seems to be less intractable than ten months ago. The BCEL 6.0-SNAPSHOT is more readily available - the apache snapshots repository is no longer necessary to include in the pom.

So, by specifying BCEL v6.0-SNAPSHOT in the d1_common_java jar (just the in the jibx plugins), I was able to get d1_common_java to compile under java 1.8. details below:

EPSCoR-MBP-7BAC:d1_common_java rnahf$ mvn -version
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T13:58:10-07:00)
Maven home: /opt/local/share/java/maven3
Java version: 1.8.0_25, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.5", arch: "x86_64", family: "mac"
EPSCoR-MBP-7BAC:d1_common_java rnahf$

I didn't need to add the SNAPSHOTS repository to the pom file, so perhaps BCEL 6.0-SNAPSHOT is more mainstream than it was 10 months ago. Attaching the modified pom file, but I'm holding off on committing for now.

#5 Updated by Rob Nahf almost 8 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 30

#6 Updated by Rob Nahf almost 8 years ago

  • Related to Story #7832: migrate from JibX to JAXB for XML binding / codegen added

#7 Updated by Rob Nahf over 7 years ago

  • translation missing: en.field_remaining_hours set to 0.0
  • % Done changed from 30 to 100
  • Status changed from In Progress to Closed

I removed JiBX from d1_common_java, so the cause of this compilation failure should be resolved.

#8 Updated by Rob Nahf over 7 years ago

  • Parent task deleted (#6625)
  • Estimated time set to 0.00

#9 Updated by Rob Nahf over 7 years ago

  • Tracker changed from Task to Bug

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)