Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 11 support #167

Closed
anuraggupta opened this issue Mar 28, 2019 · 9 comments
Closed

Java 11 support #167

anuraggupta opened this issue Mar 28, 2019 · 9 comments
Assignees
Labels

Comments

@anuraggupta
Copy link

While moving to java 11 (Open JDK 11) I'm getting the following error
Caused by: java.lang.ClassNotFoundException: com.sun.tools.xjc.model.Aspect
Complete StackTrace

-----------------------------------------------------

    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:169)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    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: java.lang.NoClassDefFoundError: com/sun/tools/xjc/model/Aspect
    at org.jvnet.jaxb2_commons.plugin.simpleequals.SimpleEqualsPlugin.generate (SimpleEqualsPlugin.java:111)
    at org.jvnet.jaxb2_commons.plugin.codegenerator.AbstractCodeGeneratorPlugin.processClassOutline (AbstractCodeGeneratorPlugin.java:82)
    at org.jvnet.jaxb2_commons.plugin.codegenerator.AbstractCodeGeneratorPlugin.run (AbstractCodeGeneratorPlugin.java:74)
    at com.sun.tools.xjc.model.Model.generateCode (Model.java:292)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.generateCode (XJC23Mojo.java:66)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:41)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:28)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute (RawXJC2Mojo.java:478)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute (RawXJC2Mojo.java:320)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    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: java.lang.ClassNotFoundException: com.sun.tools.xjc.model.Aspect
    at java.net.URLClassLoader.findClass (URLClassLoader.java:471)
    at org.jvnet.jaxb2.maven2.ParentFirstClassLoader.loadClass (ParentFirstClassLoader.java:65)
    at org.jvnet.jaxb2.maven2.ParentFirstClassLoader.loadClass (ParentFirstClassLoader.java:35)
    at org.jvnet.jaxb2_commons.plugin.simpleequals.SimpleEqualsPlugin.generate (SimpleEqualsPlugin.java:111)
    at org.jvnet.jaxb2_commons.plugin.codegenerator.AbstractCodeGeneratorPlugin.processClassOutline (AbstractCodeGeneratorPlugin.java:82)
    at org.jvnet.jaxb2_commons.plugin.codegenerator.AbstractCodeGeneratorPlugin.run (AbstractCodeGeneratorPlugin.java:74)
    at com.sun.tools.xjc.model.Model.generateCode (Model.java:292)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.generateCode (XJC23Mojo.java:66)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:41)
    at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute (XJC23Mojo.java:28)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute (RawXJC2Mojo.java:478)
    at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute (RawXJC2Mojo.java:320)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    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)

Plugin configuration

                <plugin>
                    <groupId>org.jvnet.jaxb2.maven2</groupId>
                    <artifactId>maven-jaxb2-plugin</artifactId>
                    <version>0.14.0</version>
                    <dependencies>
                        <dependency>
                            <groupId>com.adobe.ans</groupId>
                            <artifactId>ans-util</artifactId>
                            <version>${project.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>com.fasterxml.jackson.core</groupId>
                            <artifactId>jackson-annotations</artifactId>
                            <version>${jackson.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>com.fasterxml.jackson.core</groupId>
                            <artifactId>jackson-databind</artifactId>
                            <version>${jackson.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>commons-logging</groupId>
                            <artifactId>commons-logging</artifactId>
                            <version>${commons.logging.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <args>
                            <arg>-enableIntrospection</arg>
                            <arg>-Xannotate</arg>
                            <arg>-Xsetters</arg>
                            <arg>-XtoString</arg>
                            <arg>-XsimpleEquals</arg>
                            <arg>-XsimpleHashCode</arg>
                            <arg>-Xfluent-api</arg>
                            <arg>-Xsetters-mode=direct</arg>
                            <arg>-no-header</arg>
                            <arg>-Xinheritance</arg>
                        </args>
                        <extension>true</extension>
                        <markGenerated>true</markGenerated>
                        <plugins>
                            <plugin>
                                <groupId>org.jvnet.jaxb2_commons</groupId>
                                <artifactId>jaxb2-basics</artifactId>
                                <version>${jaxb2.basics.version}</version>
                            </plugin>
                            <plugin>
                                <groupId>org.jvnet.jaxb2_commons</groupId>
                                <artifactId>jaxb2-basics-annotate</artifactId>
                                <version>${jaxb2.basics.annotate.version}</version>
                            </plugin>
                            <plugin>
                                <groupId>org.jvnet.jaxb2_commons</groupId>
                                <artifactId>jaxb2-fluent-api</artifactId>
                                <version>${jaxb2.fluent.api.version}</version>
                            </plugin>
                            <plugin>
                                <groupId>com.github.jaxb-xew-plugin</groupId>
                                <artifactId>jaxb-xew-plugin</artifactId>
                                <version>${jaxb.xew.plugin.version}</version>
                            </plugin>
                        </plugins>
                    </configuration>
                </plugin>
        <jaxb2.basics.version>1.11.1</jaxb2.basics.version>
        <jaxb2.basics.annotate.version>1.0.2</jaxb2.basics.annotate.version>
        <jaxb2.fluent.api.version>3.0</jaxb2.fluent.api.version>
        <jaxb.xew.plugin.version>1.7</jaxb.xew.plugin.version>
@anuraggupta
Copy link
Author

@highsource any comment on this ?

@highsource
Copy link
Owner

highsource commented Apr 3, 2019

Did not come to this yet, sorry.

BTW 1.11.1 is a wrong version of JAXB2-Basics. Was published by mistake. Use 0.11.1 or 0.12.0:
https://mvnrepository.com/artifact/org.jvnet.jaxb2_commons/jaxb2-basics

@highsource
Copy link
Owner

Continued in xjc-maven-plugin#3.

@highsource highsource self-assigned this May 11, 2019
@highsource highsource modified the milestone: 0.14.x May 11, 2019
@puce77
Copy link

puce77 commented Sep 19, 2019

Is this part of any Milestone?

@JSamir
Copy link

JSamir commented Jan 20, 2020

Was trying to migrate some of our projects to Java11 and got this error too. Do we need to wait for an update or is there a workaround?

@jkzu
Copy link

jkzu commented Apr 4, 2022

The status of this issue is 'closed', but no new release gets published, and maven repository is still in 0.12.0.

@mattrpav
Copy link
Collaborator

mattrpav commented Apr 4, 2022

@jkzu I'm picking up the maintenance of this plugin. I'll be releasing updated versions over the next few weeks that include full Java 11 support.

FYI-- 0.14.0 is available via maven central:

https://mvnrepository.com/artifact/org.jvnet.jaxb2.maven2/maven-jaxb2-plugin/0.14.0

@yvanzo
Copy link

yvanzo commented Oct 26, 2022

Hi @mattrpav. Thank you for having released version 0.15.1 but it doesn't seem to support Java 11 or am I missing something? What is the current status of Java 11 support? Are you still working on it? What might be the currently major issue blocking it?

@mattrpav
Copy link
Collaborator

@yvanzo what error are you getting?

laurentschoelens added a commit to laurentschoelens/jaxb-tools that referenced this issue Jul 3, 2023
…ce#167)

Co-authored-by: Laurent SCHOELENS <laurent.schoelens@sfr.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants