Failed to execute goal org.jibx:maven-jibx-plugin:1.2.6:bind when upgrading from Java 1.6 to 1.8

三世轮回 提交于 2019-12-13 00:19:28

问题


Unable to build project due to an exception in the maven-jibx-plugin during mvn install.

Environment Info:

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00)
Maven home: C:\Data\apps\apache-maven-3.3.9\bin\..
Java version: 1.8.0_112, vendor: Oracle Corporation
Java home: C:\Program Files (x86)\Java\jdk1.8.0_112\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "dos"

ERROR:

Failed to execute goal org.jibx:maven-jibx-plugin:1.2.6:bind (default) on project xxxx-core: Error loading class java.lang.CharSequence

pom.xml:

  <plugin>
    <groupId>org.jibx</groupId>
    <artifactId>maven-jibx-plugin</artifactId>
    <version>1.2.6</version>
    <configuration>
      <includes>
        <includes>*-binding.xml</includes>
      </includes>
    </configuration>
    <executions>
      <execution>
        <goals>
          <goal>bind</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

Stack Trace:

[ERROR] Failed to execute goal org.jibx:maven-jibx-plugin:1.2.6:bind (default) on project xxxx-core: 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.6:bind (default) on project xxxx-core: 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:212)
        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:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        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:498)
        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:207)
        ... 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

回答1:


Found the fix.

Override the BCEL dependancy w/ verion 6.0:

<plugin>
    <groupId>org.jibx</groupId>
    <artifactId>maven-jibx-plugin</artifactId>
    <version>1.2.6</version>
    <configuration>
        <includes>
            <includes>*-binding.xml</includes>
        </includes>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>bind</goal>
            </goals>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.apache.bcel</groupId>
            <artifactId>bcel</artifactId>
            <version>6.0</version>
        </dependency>
    </dependencies>
</plugin>



回答2:


Actually, the new version of JiBX, 1.3.0, is compatible with jdk 1.8. This version of JiBX will be released by 11/30/16. You can download the pre-release version here: JiBX 1.3.0-SNAPSHOT.

The maven artifacts have been uploaded to the maven central snapshot repo. The JIBX version is 1.3.0-SNAPSHOT.



来源:https://stackoverflow.com/questions/40494748/failed-to-execute-goal-org-jibxmaven-jibx-plugin1-2-6bind-when-upgrading-from

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!