You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the jaxb2-maven-plugin to generate XML Schema from annotated Java classes. Everything seems to work fine so far, except that I get tons of warnings in the Maven logs during the build.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jaxb-facets-sandbox 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jaxb-facets-sandbox ---
[INFO]
[INFO] --- jaxb2-maven-plugin:1.6:schemagen (schemagen) @ jaxb-facets-sandbox ---
Jan 09, 2015 5:34:12 PM at.ac.tuwien.infosys.jaxb.XmlSchemaEnhancer writeCustomOccurs
WARNING: Unable to get @MinOccurs annotation from type com.sun.xml.bind.v2.model.impl.TypeRefImpl@667de82c
java.lang.ClassCastException: com.sun.tools.javac.code.Type$ClassType cannot be cast to java.lang.Class
at at.ac.tuwien.infosys.jaxb.XmlSchemaEnhancer.getAnnotationOfProperty(XmlSchemaEnhancer.java:908)
at at.ac.tuwien.infosys.jaxb.XmlSchemaEnhancer.writeCustomOccurs(XmlSchemaEnhancer.java:466)
at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace$2.write(XmlSchemaGenerator.java:1178)
at com.sun.xml.bind.v2.schemagen.TreeWrapper.write(TreeWrapper.java:90)
at com.sun.xml.bind.v2.schemagen.Tree$Group.write(Tree.java:255)
at com.sun.xml.bind.v2.schemagen.Tree.write(Tree.java:138)
at com.sun.xml.bind.v2.schemagen.Tree.write(Tree.java:141)
at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeClass(XmlSchemaGenerator.java:1039)
at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeTo(XmlSchemaGenerator.java:721)
at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.access$800(XmlSchemaGenerator.java:519)
at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.write(XmlSchemaGenerator.java:501)
at com.sun.tools.xjc.api.impl.j2s.JAXBModelImpl.generateSchema(JAXBModelImpl.java:183)
at com.sun.tools.jxc.ap.SchemaGenerator.process(SchemaGenerator.java:115)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
at com.sun.tools.javac.main.Main.compile(Main.java:439)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132)
at com.sun.tools.jxc.SchemaGenerator$Runner.compile(SchemaGenerator.java:240)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.tools.jxc.SchemaGenerator.run(SchemaGenerator.java:171)
at com.sun.tools.jxc.SchemaGenerator.run(SchemaGenerator.java:86)
at org.codehaus.mojo.jaxb2.AbstractSchemagenMojo.execute(AbstractSchemagenMojo.java:215)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
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:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jaxb-facets-sandbox ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ jaxb-facets-sandbox ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\dev\grails\ws\jaxb-facets-sandbox\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jaxb-facets-sandbox ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ jaxb-facets-sandbox ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ jaxb-facets-sandbox ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ jaxb-facets-sandbox ---
[INFO] Building jar: D:\dev\grails\ws\jaxb-facets-sandbox\target\jaxb-facets-sandbox-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ jaxb-facets-sandbox ---
[INFO] Installing D:\dev\grails\ws\jaxb-facets-sandbox\target\jaxb-facets-sandbox-0.0.1-SNAPSHOT.jar to C:\Users\pappmar\.m2\repository\jaxb-facets\jaxb-facets-sandbox\0.0.1-SNAPSHOT\jaxb-facets-sandbox-0.0.1-SNAPSHOT.jar
[INFO] Installing D:\dev\grails\ws\jaxb-facets-sandbox\pom.xml to C:\Users\pappmar\.m2\repository\jaxb-facets\jaxb-facets-sandbox\0.0.1-SNAPSHOT\jaxb-facets-sandbox-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.218 s
[INFO] Finished at: 2015-01-09T17:34:13+00:00
[INFO] Final Memory: 20M/226M
[INFO] ------------------------------------------------------------------------
The number of log messages depends on the number of domain classes.
Hello,
I am using the jaxb2-maven-plugin to generate XML Schema from annotated Java classes. Everything seems to work fine so far, except that I get tons of warnings in the Maven logs during the build.
The Java class:
The pom.xml:
The output log:
The number of log messages depends on the number of domain classes.
The generated XML schema is fine:
It is not a blocking issue, I would just like to get rid of the warnings in the build logs. Is that possible?
Regards,
Marton
The text was updated successfully, but these errors were encountered: