maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Davidson <adavids...@apple.com>
Subject trouble running jaxb2-maven-plugin : You are running with invalid JAXP api or implementation
Date Fri, 25 Jul 2014 01:31:42 GMT
Hello

I am having a heck of a time working with XSD files and maven. I am working on a mac. It looks
like I have the latest and greatest xjc. 

Any idea what my bug is?

Kind regards

Andy

$ which java
/usr/bin/java
$ java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b12)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
$ which xjc
/usr/bin/xjc
$ xjc -version
xjc 2.2.4-2
$ 


[INFO] --- jaxb2-maven-plugin:1.6:xjc (xjc) @ athena-aide-myaccess ---
[INFO] Generating source...
[INFO] parsing a schema...
Jul 24, 2014 6:22:34 PM com.sun.xml.bind.v2.util.XmlFactory createDocumentBuilderFactory
SEVERE: null
java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V
	at com.sun.xml.bind.v2.util.XmlFactory.createDocumentBuilderFactory(XmlFactory.java:192)
	at com.sun.tools.xjc.reader.internalizer.DOMForest.<init>(DOMForest.java:162)
	at com.sun.tools.xjc.ModelLoader.buildDOMForest(ModelLoader.java:315)
	at com.sun.tools.xjc.ModelLoader.loadXMLSchema(ModelLoader.java:377)
	at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:174)
	at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:119)
	at com.sun.tools.xjc.Driver.run(Driver.java:333)
	at org.codehaus.mojo.jaxb2.AbstractXjcMojo.execute(AbstractXjcMojo.java:316)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
	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:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
	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:601)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.843s
[INFO] Finished at: Thu Jul 24 18:22:34 PDT 2014
[INFO] Final Memory: 9M/24M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:1.6:xjc (xjc) on project
athena-aide-myaccess: You are running with invalid JAXP api or implementation. JAXP api/implementation
of version 1.3.1 (included in JDK6) or higher is required. In case you are using ant, make
sure ant 1.7.0 or higher is used - older versions of ant contain JAXP api/impl version 1.2
(in xml-apis.jar). If you want to keep using older ant versions, you have to configure it
to use higher the JAXP api/impl versions. javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V
-> [Help 1]
[ERROR] 


In my parent pom.xml I have

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                        <fork>true</fork>
					    <meminitial>512m</meminitial>
					    <maxmem>1024m</maxmem>
    				</configuration>
                </plugin>

I have the following in my child pom.xm

	<build>
		<plugins>
			<plugin>
				<!-- 
				http://www.journaldev.com/1312/how-to-generate-java-classes-from-xsd-using-xjc-maven-plugin
				http://mojo.codehaus.org/jaxb2-maven-plugin/
				 -->
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>jaxb2-maven-plugin</artifactId>
				<version>1.6</version>
				<executions>
					<execution>
						<id>xjc</id>
						<goals>
							<goal>xjc</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
				    <arguments>-extension -npa -b ${project.basedir}/src/main/xsd/global.xjb</arguments>

					<!-- <packageName>com.example.myschema</packageName> --> <!-- The
name of your generated source package -->
				</configuration>
			</plugin>
		</plugins>
	</build>



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message