org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from file [D:/projects/prj/trunk/application/ejb/com.mycorp.prj.application.ejb.remote-ejb-services/src/main/resources/META-INF/spring/prjcommon-remote-ejb-services-spring.xml]; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of java/net/URLClassLoader) previously initiated loading for a different type with name "org/springframework/core/type/classreading/MetadataReader"

Spring JIRA | !!Use pwebb rather than philw | 6 years ago
  1. 0

    I have a fairly simple namespace scanner that allows annotated interfaces to be scanned and beans created based on a template. This method lets me wire up remote EJB proxies quickly: For example: {code:xml} <bean name="interfaceScanTemplate" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean" abstract="true"> <property name="resourceRef" value="false"/> <property name="lookupHomeOnStartup" value="false"/> <property name="exposeAccessContext" value="true"/> <property name="cacheHome" value="false"/> </bean> <custom-spring:interface-scan base-package="com.mycorp.project" bean-definition-factory="com.mycorp.common.spring.context.annotation.TemplateBasedWebLogicEjbBeanDefinitionFactory" bean-definition-factory-template="interfaceScanTemplate"> </custom-spring:interface-scan> {code} When STS parses namespaces I get the following error: {noformat} !ENTRY org.springframework.ide.eclipse.beans.core 4 0 2011-01-17 16:55:27.482 !MESSAGE Internal Error !STACK 0 org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from file [D:/projects/prj/trunk/application/ejb/com.mycorp.prj.application.ejb.remote-ejb-services/src/main/resources/META-INF/spring/prjcommon-remote-ejb-services-spring.xml]; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of java/net/URLClassLoader) previously initiated loading for a different type with name "org/springframework/core/type/classreading/MetadataReader" at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$2.loadBeanDefinitions(BeansConfig.java:374) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$3.call(BeansConfig.java:418) at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$3.call(BeansConfig.java:1) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of java/net/URLClassLoader) previously initiated loading for a different type with name "org/springframework/core/type/classreading/MetadataReader" at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at com.mycorp.common.spring.context.annotation.ServiceAnnotationBeanNameGenerator.<init>(ServiceAnnotationBeanNameGenerator.java:37) at com.mycorp.common.spring.context.annotation.InterfaceClassPathBeanDefinitionScanner.<init>(InterfaceClassPathBeanDefinitionScanner.java:50) at com.mycorp.common.spring.config.InterfaceComponentScanBeanDefinitionParser.createScanner(InterfaceComponentScanBeanDefinitionParser.java:57) at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.configureScanner(ComponentScanBeanDefinitionParser.java:99) at com.mycorp.common.spring.config.InterfaceComponentScanBeanDefinitionParser.configureScanner(InterfaceComponentScanBeanDefinitionParser.java:24) at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:83) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73) at org.springframework.ide.eclipse.beans.core.internal.model.namespaces.DelegatingNamespaceHandlerResolver$ElementTrackingNamespaceHandler.parse(DelegatingNamespaceHandlerResolver.java:177) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1335) at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$ErrorSuppressingBeanDefinitionParserDelegate.parseCustomElement(BeansConfig.java:1270) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$2.registerBeanDefinitions(BeansConfig.java:388) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) ... 13 more {noformat}

    Spring JIRA | 6 years ago | !!Use pwebb rather than philw
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from file [D:/projects/prj/trunk/application/ejb/com.mycorp.prj.application.ejb.remote-ejb-services/src/main/resources/META-INF/spring/prjcommon-remote-ejb-services-spring.xml]; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of java/net/URLClassLoader) previously initiated loading for a different type with name "org/springframework/core/type/classreading/MetadataReader"
  2. 0

    I have a fairly simple namespace scanner that allows annotated interfaces to be scanned and beans created based on a template. This method lets me wire up remote EJB proxies quickly: For example: {code:xml} <bean name="interfaceScanTemplate" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean" abstract="true"> <property name="resourceRef" value="false"/> <property name="lookupHomeOnStartup" value="false"/> <property name="exposeAccessContext" value="true"/> <property name="cacheHome" value="false"/> </bean> <custom-spring:interface-scan base-package="com.mycorp.project" bean-definition-factory="com.mycorp.common.spring.context.annotation.TemplateBasedWebLogicEjbBeanDefinitionFactory" bean-definition-factory-template="interfaceScanTemplate"> </custom-spring:interface-scan> {code} When STS parses namespaces I get the following error: {noformat} !ENTRY org.springframework.ide.eclipse.beans.core 4 0 2011-01-17 16:55:27.482 !MESSAGE Internal Error !STACK 0 org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from file [D:/projects/prj/trunk/application/ejb/com.mycorp.prj.application.ejb.remote-ejb-services/src/main/resources/META-INF/spring/prjcommon-remote-ejb-services-spring.xml]; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of java/net/URLClassLoader) previously initiated loading for a different type with name "org/springframework/core/type/classreading/MetadataReader" at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$2.loadBeanDefinitions(BeansConfig.java:374) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$3.call(BeansConfig.java:418) at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$3.call(BeansConfig.java:1) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of java/net/URLClassLoader) previously initiated loading for a different type with name "org/springframework/core/type/classreading/MetadataReader" at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at com.mycorp.common.spring.context.annotation.ServiceAnnotationBeanNameGenerator.<init>(ServiceAnnotationBeanNameGenerator.java:37) at com.mycorp.common.spring.context.annotation.InterfaceClassPathBeanDefinitionScanner.<init>(InterfaceClassPathBeanDefinitionScanner.java:50) at com.mycorp.common.spring.config.InterfaceComponentScanBeanDefinitionParser.createScanner(InterfaceComponentScanBeanDefinitionParser.java:57) at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.configureScanner(ComponentScanBeanDefinitionParser.java:99) at com.mycorp.common.spring.config.InterfaceComponentScanBeanDefinitionParser.configureScanner(InterfaceComponentScanBeanDefinitionParser.java:24) at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:83) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73) at org.springframework.ide.eclipse.beans.core.internal.model.namespaces.DelegatingNamespaceHandlerResolver$ElementTrackingNamespaceHandler.parse(DelegatingNamespaceHandlerResolver.java:177) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1335) at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$ErrorSuppressingBeanDefinitionParserDelegate.parseCustomElement(BeansConfig.java:1270) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) at org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$2.registerBeanDefinitions(BeansConfig.java:388) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) ... 13 more {noformat}

    Spring JIRA | 6 years ago | !!Use pwebb rather than philw
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from file [D:/projects/prj/trunk/application/ejb/com.mycorp.prj.application.ejb.remote-ejb-services/src/main/resources/META-INF/spring/prjcommon-remote-ejb-services-spring.xml]; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of java/net/URLClassLoader) previously initiated loading for a different type with name "org/springframework/core/type/classreading/MetadataReader"
  3. 0

    Hi, I succeed to run Hudson in Jonas Application Server (http://wiki.jenkins-ci.org/display/JENKINS/Jonas). Adding the sonar plugin lead to the following error: {quote} 2010-10-26 16:44:04,519 : J2EEServer.__info : JOnAS AS v5.1.4 named 'jonas' RUNNING 2010-10-26 16:44:04,925 : Hudson$4.onAttained : Started initialization 2010-10-26 16:44:34,691 : Hudson$4.onAttained : Listed all plugins 2010-10-26 16:44:34,722 : BackupPluginImpl.loadConfiguration : Loading configuration... 2010-10-26 16:44:34,722 : BackupPersistence.loadConfig : Config file not found. 2010-10-26 16:44:34,879 : Hudson$4.onAttained : Prepared all plugins 2010-10-26 16:44:34,957 : Hudson$4.onAttained : Started all plugins 2010-10-26 16:44:34,957 : Hudson$4.onAttained : Augmented all extensions 2010-10-26 16:44:39,785 : Hudson$4.onAttained : Loaded all jobs 2010-10-26 16:44:41,613 : ExtensionFinder$Sezpoz.find : Failed to load hudson.plugins.sonar.SonarPublisher$DescriptorImpl {color:red}java.lang.InstantiationException: java.lang.LinkageError: loader (instance of java/net/URLClassLoader): attempted duplicate class definition for name: "hudson/plugins/sonar/SonarPublisher"{color} at net.java.sezpoz.IndexItem.instance(IndexItem.java:180) at hudson.ExtensionFinder$Sezpoz.find(ExtensionFinder.java:156) at hudson.ExtensionFinder._find(ExtensionFinder.java:92) at hudson.ExtensionList.load(ExtensionList.java:259) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:216) at hudson.ExtensionList.getComponents(ExtensionList.java:124) at hudson.DescriptorExtensionList.load(DescriptorExtensionList.java:157) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:216) at hudson.ExtensionList.size(ExtensionList.java:132) at java.util.AbstractCollection.isEmpty(AbstractCollection.java:69) at hudson.model.labels.LabelAtom.updateTransientActions(LabelAtom.java:103) at hudson.model.labels.LabelAtom.load(LabelAtom.java:175) at hudson.model.Hudson.getLabelAtom(Hudson.java:1420) at hudson.model.Hudson.getSelfLabel(Hudson.java:2146) at hudson.model.Node.getAssignedLabels(Node.java:191) at hudson.model.Hudson$13.run(Hudson.java:2205) at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:146) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259) at hudson.model.Hudson$3.runTask(Hudson.java:691) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) {color:red}Caused by: java.lang.LinkageError: loader (instance of java/net/URLClassLoader): attempted duplicate class definition for name: "hudson/plugins/sonar/SonarPublisher"{color} at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at hudson.plugins.sonar.SonarPublisher$DescriptorImpl.<init>(SonarPublisher.java:443) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at net.java.sezpoz.IndexItem.instance(IndexItem.java:168) ... 23 more 2010-10-26 16:44:42,175 : Hudson$4.onAttained : Completed initialization 2010-10-26 16:44:43,347 : TcpSlaveAgentListener.<init> : JNLP slave agent listener started {quote} To avoid this error, I've made a little change, calling the no arg constructor: {code:title=SonarPublisher.java|borderStyle=solid} ... @Extension public static final class DescriptorImpl extends BuildStepDescriptor<Publisher> { @CopyOnWrite private volatile SonarInstallation[] installations = new SonarInstallation[0]; //NOSONAR public DescriptorImpl() { //Old call: super(SonarPublisher.class); super(); load(); } ... {code} Hudson and the sonar plugin are working fine. I don't know what is the difference between the two constructor, but other plugins also use the no arg constructor (like svn-tag). If it's ok for you, could you include this change into the next release of the sonar plugin ? Thanks

    Jenkins JIRA | 6 years ago | o_orand
    java.lang.LinkageError: loader (instance of java/net/URLClassLoader): attempted duplicate class definition for name: "hudson/plugins/sonar/SonarPublisher"{color}
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hi, I succeed to run Hudson in Jonas Application Server (http://wiki.jenkins-ci.org/display/JENKINS/Jonas). Adding the sonar plugin lead to the following error: {quote} 2010-10-26 16:44:04,519 : J2EEServer.__info : JOnAS AS v5.1.4 named 'jonas' RUNNING 2010-10-26 16:44:04,925 : Hudson$4.onAttained : Started initialization 2010-10-26 16:44:34,691 : Hudson$4.onAttained : Listed all plugins 2010-10-26 16:44:34,722 : BackupPluginImpl.loadConfiguration : Loading configuration... 2010-10-26 16:44:34,722 : BackupPersistence.loadConfig : Config file not found. 2010-10-26 16:44:34,879 : Hudson$4.onAttained : Prepared all plugins 2010-10-26 16:44:34,957 : Hudson$4.onAttained : Started all plugins 2010-10-26 16:44:34,957 : Hudson$4.onAttained : Augmented all extensions 2010-10-26 16:44:39,785 : Hudson$4.onAttained : Loaded all jobs 2010-10-26 16:44:41,613 : ExtensionFinder$Sezpoz.find : Failed to load hudson.plugins.sonar.SonarPublisher$DescriptorImpl {color:red}java.lang.InstantiationException: java.lang.LinkageError: loader (instance of java/net/URLClassLoader): attempted duplicate class definition for name: "hudson/plugins/sonar/SonarPublisher"{color} at net.java.sezpoz.IndexItem.instance(IndexItem.java:180) at hudson.ExtensionFinder$Sezpoz.find(ExtensionFinder.java:156) at hudson.ExtensionFinder._find(ExtensionFinder.java:92) at hudson.ExtensionList.load(ExtensionList.java:259) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:216) at hudson.ExtensionList.getComponents(ExtensionList.java:124) at hudson.DescriptorExtensionList.load(DescriptorExtensionList.java:157) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:216) at hudson.ExtensionList.size(ExtensionList.java:132) at java.util.AbstractCollection.isEmpty(AbstractCollection.java:69) at hudson.model.labels.LabelAtom.updateTransientActions(LabelAtom.java:103) at hudson.model.labels.LabelAtom.load(LabelAtom.java:175) at hudson.model.Hudson.getLabelAtom(Hudson.java:1420) at hudson.model.Hudson.getSelfLabel(Hudson.java:2146) at hudson.model.Node.getAssignedLabels(Node.java:191) at hudson.model.Hudson$13.run(Hudson.java:2205) at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:146) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259) at hudson.model.Hudson$3.runTask(Hudson.java:691) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) {color:red}Caused by: java.lang.LinkageError: loader (instance of java/net/URLClassLoader): attempted duplicate class definition for name: "hudson/plugins/sonar/SonarPublisher"{color} at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at hudson.plugins.sonar.SonarPublisher$DescriptorImpl.<init>(SonarPublisher.java:443) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at net.java.sezpoz.IndexItem.instance(IndexItem.java:168) ... 23 more 2010-10-26 16:44:42,175 : Hudson$4.onAttained : Completed initialization 2010-10-26 16:44:43,347 : TcpSlaveAgentListener.<init> : JNLP slave agent listener started {quote} To avoid this error, I've made a little change, calling the no arg constructor: {code:title=SonarPublisher.java|borderStyle=solid} ... @Extension public static final class DescriptorImpl extends BuildStepDescriptor<Publisher> { @CopyOnWrite private volatile SonarInstallation[] installations = new SonarInstallation[0]; //NOSONAR public DescriptorImpl() { //Old call: super(SonarPublisher.class); super(); load(); } ... {code} Hudson and the sonar plugin are working fine. I don't know what is the difference between the two constructor, but other plugins also use the no arg constructor (like svn-tag). If it's ok for you, could you include this change into the next release of the sonar plugin ? Thanks

    Jenkins JIRA | 6 years ago | o_orand
    java.lang.LinkageError: loader (instance of java/net/URLClassLoader): attempted duplicate class definition for name: "hudson/plugins/sonar/SonarPublisher"{color}
  6. 0

    Linkage error in JMockit 1.12

    GitHub | 2 years ago | svenwaibel
    java.lang.LinkageError: loader (instance of sun/misc/Launcher$AppClassLoader): attempted duplicate class definition for name: "..../ToTest$1"

    7 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.LinkageError

      loader constraint violation: loader (instance of java/net/URLClassLoader) previously initiated loading for a different type with name "org/springframework/core/type/classreading/MetadataReader"

      at java.lang.ClassLoader.defineClass1()
    2. Java RT
      ClassLoader.loadClass
      1. java.lang.ClassLoader.defineClass1(Native Method)
      2. java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
      3. java.lang.ClassLoader.defineClass(ClassLoader.java:616)
      4. java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
      5. java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
      6. java.net.URLClassLoader.access$000(URLClassLoader.java:58)
      7. java.net.URLClassLoader$1.run(URLClassLoader.java:197)
      8. java.security.AccessController.doPrivileged(Native Method)
      9. java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      10. java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      11. java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      11 frames
    3. com.mycorp.common
      InterfaceComponentScanBeanDefinitionParser.createScanner
      1. com.mycorp.common.spring.context.annotation.ServiceAnnotationBeanNameGenerator.<init>(ServiceAnnotationBeanNameGenerator.java:37)
      2. com.mycorp.common.spring.context.annotation.InterfaceClassPathBeanDefinitionScanner.<init>(InterfaceClassPathBeanDefinitionScanner.java:50)
      3. com.mycorp.common.spring.config.InterfaceComponentScanBeanDefinitionParser.createScanner(InterfaceComponentScanBeanDefinitionParser.java:57)
      3 frames
    4. Spring Context
      ComponentScanBeanDefinitionParser.configureScanner
      1. org.springframework.context.annotation.ComponentScanBeanDefinitionParser.configureScanner(ComponentScanBeanDefinitionParser.java:99)
      1 frame
    5. com.mycorp.common
      InterfaceComponentScanBeanDefinitionParser.configureScanner
      1. com.mycorp.common.spring.config.InterfaceComponentScanBeanDefinitionParser.configureScanner(InterfaceComponentScanBeanDefinitionParser.java:24)
      1 frame
    6. Spring Context
      ComponentScanBeanDefinitionParser.parse
      1. org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:83)
      1 frame
    7. Spring Beans
      NamespaceHandlerSupport.parse
      1. org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
      1 frame
    8. org.springframework.ide
      DelegatingNamespaceHandlerResolver$ElementTrackingNamespaceHandler.parse
      1. org.springframework.ide.eclipse.beans.core.internal.model.namespaces.DelegatingNamespaceHandlerResolver$ElementTrackingNamespaceHandler.parse(DelegatingNamespaceHandlerResolver.java:177)
      1 frame
    9. Spring Beans
      BeanDefinitionParserDelegate.parseCustomElement
      1. org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1335)
      1 frame
    10. org.springframework.ide
      BeansConfig$ErrorSuppressingBeanDefinitionParserDelegate.parseCustomElement
      1. org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$ErrorSuppressingBeanDefinitionParserDelegate.parseCustomElement(BeansConfig.java:1270)
      1 frame
    11. Spring Beans
      XmlBeanDefinitionReader.registerBeanDefinitions
      1. org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325)
      2. org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
      3. org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
      4. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
      4 frames
    12. org.springframework.ide
      BeansConfig$2.registerBeanDefinitions
      1. org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$2.registerBeanDefinitions(BeansConfig.java:388)
      1 frame
    13. Spring Beans
      XmlBeanDefinitionReader.loadBeanDefinitions
      1. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
      2. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
      2 frames
    14. org.springframework.ide
      BeansConfig$2.loadBeanDefinitions
      1. org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$2.loadBeanDefinitions(BeansConfig.java:374)
      1 frame
    15. Spring Beans
      XmlBeanDefinitionReader.loadBeanDefinitions
      1. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
      1 frame
    16. org.springframework.ide
      BeansConfig$3.call
      1. org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$3.call(BeansConfig.java:418)
      2. org.springframework.ide.eclipse.beans.core.internal.model.BeansConfig$3.call(BeansConfig.java:1)
      2 frames
    17. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:138)
      3. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      4. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      5. java.util.concurrent.FutureTask.run(FutureTask.java:138)
      6. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      7. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      8. java.lang.Thread.run(Thread.java:619)
      8 frames