[ 
https://issues.apache.org/jira/browse/CXFXJC-24?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Freeman Fang resolved CXFXJC-24.
--------------------------------
       Resolution: Fixed
    Fix Version/s: 3.2.2

> Cant compile against java10
> ---------------------------
>
>                 Key: CXFXJC-24
>                 URL: https://issues.apache.org/jira/browse/CXFXJC-24
>             Project: CXF XJC Utils
>          Issue Type: Bug
>          Components: Maven Plugin
>    Affects Versions: 3.2.1
>            Reporter: Gareth Healy
>            Assignee: Freeman Fang
>            Priority: Major
>             Fix For: 3.2.2
>
>
> When compiling against java10, get the following error:
>  
> {code:java}
> [INFO] --- cxf-xjc-plugin:3.2.1:xsdtojava-tests (generate-sources) @ 
> dozer-core ---
> [WARNING] The POM for com.sun.xml.bind:jaxb-xjc:jar:2.2.11 is invalid, 
> transitive dependencies (if any) will not be available, enable debug logging 
> for more details
> [WARNING] The POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11 is invalid, 
> transitive dependencies (if any) will not be available, enable debug logging 
> for more details
> [WARNING] The POM for com.sun.xml.bind:jaxb-core:jar:2.2.11 is invalid, 
> transitive dependencies (if any) will not be available, enable debug logging 
> for more details
> [WARNING] Failed to build parent project for 
> com.sun.xml.bind.mvn:jaxb-bundles:pom:2.2.11
> [WARNING] Failed to build parent project for 
> com.sun.xml.bind:jaxb-xjc:jar:2.2.11
> [WARNING] Invalid POM for com.sun.xml.bind:jaxb-xjc:jar:2.2.11, transitive 
> dependencies (if any) will not be available, enable debug logging for more 
> details
> [WARNING] Failed to build parent project for 
> com.sun.xml.bind.mvn:jaxb-bundles:pom:2.2.11
> [WARNING] Failed to build parent project for 
> com.sun.xml.bind:jaxb-core:jar:2.2.11
> [WARNING] Invalid POM for com.sun.xml.bind:jaxb-core:jar:2.2.11, transitive 
> dependencies (if any) will not be available, enable debug logging for more 
> details
> [WARNING] Failed to build parent project for 
> com.sun.xml.bind.mvn:jaxb-bundles:pom:2.2.11
> [WARNING] Failed to build parent project for 
> com.sun.xml.bind:jaxb-impl:jar:2.2.11
> [WARNING] Invalid POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11, transitive 
> dependencies (if any) will not be available, enable debug logging for more 
> details
> [ERROR] /Users/garethah/Documents/github/garethahealy/dozer/null [-1:-1]: 
> Failed to create model
> com.sun.istack.SAXParseException2; Failed to create model
> at com.sun.tools.xjc.ErrorReceiver.error(ErrorReceiver.java:94)
> at 
> org.apache.cxf.maven_plugin.XSDToJavaRunner.loadModel(XSDToJavaRunner.java:232)
> at org.apache.cxf.maven_plugin.XSDToJavaRunner.run(XSDToJavaRunner.java:168)
> at 
> org.apache.cxf.maven_plugin.AbstractXSDToJavaMojo.run(AbstractXSDToJavaMojo.java:350)
> at 
> org.apache.cxf.maven_plugin.AbstractXSDToJavaMojo.execute(AbstractXSDToJavaMojo.java:252)
> at 
> org.apache.cxf.maven_plugin.TestXSDToJavaMojo.execute(TestXSDToJavaMojo.java:46)
> at 
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
> at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
> at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
> at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
> 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:51)
> at 
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method)
> at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:564)
> 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.reflect.InvocationTargetException
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method)
> at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:564)
> at 
> org.apache.cxf.maven_plugin.XSDToJavaRunner.loadModel(XSDToJavaRunner.java:230)
> ... 26 more
> Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException
> at com.sun.tools.xjc.reader.Ring.get(Ring.java:113)
> at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.<init>(BGMBuilder.java:147)
> at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:117)
> at com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:425)
> at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:174)
> at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:119)
> ... 31 more
> Caused by: java.lang.reflect.InvocationTargetException
> at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>  Method)
> at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at 
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
> at com.sun.tools.xjc.reader.Ring.get(Ring.java:102)
> ... 36 more
> Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException
> at com.sun.tools.xjc.reader.Ring.get(Ring.java:113)
> at 
> com.sun.tools.xjc.reader.xmlschema.BindingComponent.getClassSelector(BindingComponent.java:65)
> at com.sun.tools.xjc.reader.xmlschema.ColorBinder.<init>(ColorBinder.java:62)
> at com.sun.tools.xjc.reader.xmlschema.BindGreen.<init>(BindGreen.java:63)
> ... 41 more
> Caused by: java.lang.reflect.InvocationTargetException
> at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>  Method)
> at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at 
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
> at com.sun.tools.xjc.reader.Ring.get(Ring.java:102)
> ... 44 more
> Caused by: java.lang.NoClassDefFoundError: 
> javax/activation/MimeTypeParseException
> at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
> at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3090)
> at java.base/java.lang.Class.getConstructor0(Class.java:3295)
> at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2512)
> at com.sun.tools.xjc.reader.Ring.get(Ring.java:100)
> at 
> com.sun.tools.xjc.reader.xmlschema.DefaultClassBinder.<init>(DefaultClassBinder.java:98)
> at 
> com.sun.tools.xjc.reader.xmlschema.ClassSelector.<init>(ClassSelector.java:214)
> ... 49 more
> Caused by: java.lang.ClassNotFoundException: 
> javax.activation.MimeTypeParseException
> at 
> org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
> at 
> org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
> at 
> org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
> at 
> org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
> ... 56 more
> [ERROR] 
> /Users/garethah/Documents/github/garethahealy/dozer/src/test/xsd/jaxb/Employee.xsd
>  [0:0]: Failed to create model
> {code}
>  
> Adding javax.activation to dependancy fixes:
> {code:java}
> <plugin>
>     <groupId>org.apache.cxf</groupId>
>     <artifactId>cxf-xjc-plugin</artifactId>
>     <configuration>
>         <extensions>
>             
> <extension>org.apache.cxf.xjcplugins:cxf-xjc-dv:${cxf-xjc-plugin.version}</extension>
>         </extensions>
>     </configuration>
>     <executions>
>         <execution>
>             <id>generate-sources</id>
>             <phase>generate-test-sources</phase>
>             <goals>
>                 <goal>xsdtojava-tests</goal>
>             </goals>
>             <configuration>
>                 <xsdOptions>
>                     <xsdOption>
>                         <xsd>src/test/xsd/jaxb/Employee.xsd</xsd>
>                     </xsdOption>
>                 </xsdOptions>
>             </configuration>
>         </execution>
>     </executions>
>     <dependencies>
>         <dependency>
>             <groupId>javax.activation</groupId>
>             <artifactId>activation</artifactId>
>             <version>1.1.1</version>
>         </dependency>
>     </dependencies>
> </plugin>
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to