Hi All,
I am using the Maven2-JAXB plugin and am facing a problem. When I
try to generate the sources from the XSD. I get the following error.
[FATAL ERROR] com.sun.tools.xjc.maven2.XJCMojo#execute() caused a linkage
error (java.lang.NoClassDefFoundError) and may be out-of-date. Check the
realms:
[FATAL ERROR] Plugin realm =
app0.child-container[com.sun.tools.xjc.maven2:maven-jaxb-plugin]
urls[0] = file:/C:/Documents and
Settings/naanand/.m2/repository/com/sun/tools/xjc/maven2/maven-jaxb-plugin/1.0/maven-jaxb-plugin-1.0.jar
urls[1] = file:/C:/Documents and
Settings/naanand/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
urls[2] = file:/C:/Documents and
Settings/naanand/.m2/repository/javax/xml/bind/jaxb-api/2.0/jaxb-api-2.0.jar
urls[3] = file:/C:/Documents and
Settings/naanand/.m2/repository/javax/xml/bind/jsr173_api/1.0/jsr173_api-1.0.jar
urls[4] = file:/C:/Documents and
Settings/naanand/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar
urls[5] = file:/C:/Documents and
Settings/naanand/.m2/repository/com/sun/xml/bind/jaxb-impl/2.0-SNAPSHOT/jaxb-impl-2.0-SNAPSHOT.jar
urls[6] = file:/C:/Documents and
Settings/naanand/.m2/repository/ant/ant/1.6.5/ant-1.6.5.jar
urls[7] = file:/C:/Documents and
Settings/naanand/.m2/repository/com/sun/xml/bind/jaxb-xjc/2.0-SNAPSHOT/jaxb-xjc-2.0-SNAPSHOT.jar
urls[8] = file:/C:/Documents and
Settings/naanand/.m2/repository/jaxb/jsr173_api/1.0/jsr173_api-1.0.jar
[FATAL ERROR] Container realm = plexus.core
urls[0] =
file:/d:/Software/Java/apache-maven-2.0.9/bin/../lib/maven-2.0.9-uber.jar
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] org/apache/tools/ant/Task
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.NoClassDefFoundError: org/apache/tools/ant/Task
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:891)
at java.lang.ClassLoader.loadClass(ClassLoader.java:301)
at
org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
at
org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
at
org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at
org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
at
org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
at
org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at com.sun.tools.xjc.maven2.XJCMojo.execute(XJCMojo.java:190)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
I'm not sure why this error happens and how it is corrected. Any help in
this regard would be much appreciated.!
--
Thanks & Regards,
--
A.Srijith.K.Unni
Home Page : http://srijithunni.blogspot.com/