jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2 & 3
  • MNG-3668

maven-eclipse-plugin 2.5 is failing with java.lang.LinkageError

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 3.0-alpha-1
  • Fix Version/s: Issues to be reviewed for 3.x
  • Component/s: Command Line
  • Labels:
    None
  • Complexity:
    Intermediate

Description

eclipse:eclipse goal in maven-eclipse-plugin 2.5 is failing with the following exception. same thing is working with 2.4

Exception in thread "main" java.lang.LinkageError: loader constraint violation: when resolving method 
  "org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Lorg/codehaus/plexus/util/xml/XMLWriter;Lorg/codehaus/plexus/util/xml/Xpp3Dom;)V" 
  the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) of the current class, 
  org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpApplicationXMLWriter, 
  and the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) 
  for resolved class, org/codehaus/plexus/util/xml/Xpp3DomWriter, have different Class objects for the type 
  org/codehaus/plexus/util/xml/XMLWriter used in the signature
        at org.apache.maven.plugin.eclipse.writers.wtp.EclipseWtpApplicationXMLWriter.writePrettyXmlFile(EclipseWtpApplicationXMLWriter.java:624)
        at org.apache.maven.plugin.eclipse.writers.wtp.EclipseWtpApplicationXMLWriter.write(EclipseWtpApplicationXMLWriter.java:157)
        at org.apache.maven.plugin.eclipse.EclipsePlugin.writeConfiguration(EclipsePlugin.java:957)
        at org.apache.maven.plugin.ide.AbstractIdeSupportMojo.execute(AbstractIdeSupportMojo.java:494)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:577)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)
        at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223)
        at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)
        at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:903)
        at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)
        at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
        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.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:408)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:31)

Issue Links

is depended upon by

Bug - A problem which impairs or prevents the functions of the product. MNGECLIPSE-745 [mng] importing EAR project fails with a LinkageError

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Open - The issue is open and ready for the assignee to start work on it.
is related to

Improvement - An improvement or enhancement to an existing feature or task. MNG-3503 Shade MX* classes from plexus-utils

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Yann Albou added a comment - 05/Nov/08 2:16 PM

Now it works with maven-eclipse-plugin 2.5.
But with a plugin that use JDK classes (for instance com.sun.mirror.apt.AnnotationProcessorFactory) it fails :

org.test.simplePlugin.MyMojo#execute() caused a linkage error (java.lang.NoClassDefFoundError). Check the realms:
....
java.lang.NoClassDefFoundError: com.sun.mirror.apt.AnnotationProcessorFactory
        at org.test.simplePlugin.MyMojo.class$(MyMojo.java:33)
        at org.test.simplePlugin.MyMojo.execute(MyMojo.java:33)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:623)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:521)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:288)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:214)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:172)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:208)
        at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:854)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
        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:585)
        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:408)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:31)

of course the plugin use the dependency:

<dependency>
	<groupId>com.sun</groupId>
	<artifactId>tools</artifactId>
	<version>1.5</version>
	<scope>system</scope>
	<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>

see MNGECLIPSE-745 for a test case.

Show
Yann Albou added a comment - 05/Nov/08 2:16 PM Now it works with maven-eclipse-plugin 2.5. But with a plugin that use JDK classes (for instance com.sun.mirror.apt.AnnotationProcessorFactory) it fails :
org.test.simplePlugin.MyMojo#execute() caused a linkage error (java.lang.NoClassDefFoundError). Check the realms:
....
java.lang.NoClassDefFoundError: com.sun.mirror.apt.AnnotationProcessorFactory
        at org.test.simplePlugin.MyMojo.class$(MyMojo.java:33)
        at org.test.simplePlugin.MyMojo.execute(MyMojo.java:33)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:623)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:521)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:288)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:214)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:172)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:208)
        at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:854)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
        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:585)
        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:408)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:31)
of course the plugin use the dependency:
<dependency>
	<groupId>com.sun</groupId>
	<artifactId>tools</artifactId>
	<version>1.5</version>
	<scope>system</scope>
	<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
see MNGECLIPSE-745 for a test case.
Hide
Permalink
Jason van Zyl added a comment - 30/Dec/09 10:24 AM

Working now with 3.0-alpha-5 and the maven-eclipse-plugin 2.7:

bash-3.2$ mvn eclipse:eclipse
[INFO] Scanning for projects...
Downloading: http://repository.sonatype.org/content/groups/sonatype-grid/org/apache/maven/plugins/maven-metadata.xml
9 KB downloaded at 9.9 KB/sec
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building dependencybug (jar) 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — maven-eclipse-plugin:2.7:eclipse (default-cli) @ dependencybug —
[INFO] Using Eclipse Workspace: null
[INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAINER
[WARNING] While downloading jtds:jtds:1.2
This artifact has been relocated to net.sourceforge.jtds:jtds:1.2.

[INFO] File /Users/jvanzyl/work/dependencybug/.project already exists.
Additional settings will be preserved, run mvn eclipse:clean if you want old settings to be removed.
[INFO] Wrote Eclipse project for "dependencybug" to /Users/jvanzyl/work/dependencybug.
[INFO]
Sources for some artifacts are not available.
Please run the same goal with the -DdownloadSources=true parameter in order to check remote repositories for sources.
List of artifacts without a source archive:
o net.sourceforge.jtds:jtds:1.2
o junit:junit:4.4

Javadoc for some artifacts is not available.
Please run the same goal with the -DdownloadJavadocs=true parameter in order to check remote repositories for javadoc.
List of artifacts without a javadoc archive:
o net.sourceforge.jtds:jtds:1.2
o junit:junit:4.4

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.815s
[INFO] Finished at: Wed Dec 30 11:24:05 EST 2009
[INFO] Final Memory: 8M/80M
[INFO] ------------------------------------------------------------------------

Show
Jason van Zyl added a comment - 30/Dec/09 10:24 AM Working now with 3.0-alpha-5 and the maven-eclipse-plugin 2.7: bash-3.2$ mvn eclipse:eclipse [INFO] Scanning for projects... Downloading: http://repository.sonatype.org/content/groups/sonatype-grid/org/apache/maven/plugins/maven-metadata.xml 9 KB downloaded at 9.9 KB/sec [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building dependencybug (jar) 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] — maven-eclipse-plugin:2.7:eclipse (default-cli) @ dependencybug — [INFO] Using Eclipse Workspace: null [INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAINER [WARNING] While downloading jtds:jtds:1.2 This artifact has been relocated to net.sourceforge.jtds:jtds:1.2. [INFO] File /Users/jvanzyl/work/dependencybug/.project already exists. Additional settings will be preserved, run mvn eclipse:clean if you want old settings to be removed. [INFO] Wrote Eclipse project for "dependencybug" to /Users/jvanzyl/work/dependencybug. [INFO] Sources for some artifacts are not available. Please run the same goal with the -DdownloadSources=true parameter in order to check remote repositories for sources. List of artifacts without a source archive: o net.sourceforge.jtds:jtds:1.2 o junit:junit:4.4 Javadoc for some artifacts is not available. Please run the same goal with the -DdownloadJavadocs=true parameter in order to check remote repositories for javadoc. List of artifacts without a javadoc archive: o net.sourceforge.jtds:jtds:1.2 o junit:junit:4.4 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.815s [INFO] Finished at: Wed Dec 30 11:24:05 EST 2009 [INFO] Final Memory: 8M/80M [INFO] ------------------------------------------------------------------------

People

  • Assignee:
    Unassigned
    Reporter:
    Eugene Kuleshov
Vote (3)
Watch (3)

Dates

  • Created:
    16/Jul/08 2:32 PM
    Updated:
    30/Dec/09 10:24 AM
    Resolved:
    30/Dec/09 10:24 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.