Remote Agent fails to start up: Error creating bean with name jmsMessageConverterTarget

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

The agent start up fails with the following stack trace:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 2012-06-17 07:30:00,191 FATAL [Thread-1] [AgentBootstrap] Exiting due to fatal exception. java.lang.reflect.InvocationTargetException 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 com.atlassian.bamboo.agent.bootstrap.AgentRunner.run(AgentRunner.java:41) at java.lang.Thread.run(Thread.java:619) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsMessageConverterTarget' defined in class path resource [applicationContextCommon.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.bamboo.v2.build.queue.XStreamMessageConverter]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.thoughtworks.xstream.io.xml.AbstractXmlDriver.<init>(Lcom/thoughtworks/xstream/io/naming/NameCoder;)V at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:451) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:88) at com.atlassian.bamboo.v2.build.agent.remote.RemoteAgent.initApplicationContext(RemoteAgent.java:160) at com.atlassian.bamboo.v2.build.agent.remote.RemoteAgent.start(RemoteAgent.java:53) ... 6 more Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.bamboo.v2.build.queue.XStreamMessageConverter]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.thoughtworks.xstream.io.xml.AbstractXmlDriver.<init>(Lcom/thoughtworks/xstream/io/naming/NameCoder;)V at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:186) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:795) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:713) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386) ... 16 more Caused by: java.lang.NoSuchMethodError: com.thoughtworks.xstream.io.xml.AbstractXmlDriver.<init>(Lcom/thoughtworks/xstream/io/naming/NameCoder;)V at com.thoughtworks.xstream.io.xml.AbstractXppDriver.<init>(AbstractXppDriver.java:50) at com.thoughtworks.xstream.io.xml.Xpp3Driver.<init>(Xpp3Driver.java:35) at com.atlassian.bamboo.v2.build.queue.XStreamMessageConverter$1.<init>(XStreamMessageConverter.java:51) at com.atlassian.bamboo.v2.build.queue.XStreamMessageConverter.createXStream(XStreamMessageConverter.java:50) at com.atlassian.bamboo.v2.build.queue.XStreamMessageConverter.<init>(XStreamMessageConverter.java:38) 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 org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85) ... 21 more

Cause

We believe that the problem is that the ThoughtWorks XStream library is part of Bamboo and of JavaMelody. It is very likely that the Agents are sometimes picking the lib from the plugin (or local JavaMelody) and other times pick the correct one, shipped with Bamboo. This is exactly the lib the Agents stack traces are complaining about.

It's maybe also related to "Plugin 1" plugins installed on the server because when a "Plugin 1" is installed on the Server, it is always sent to the Agent.

Resolution

1. Un-install the plugin from the Server and restart it.

2. Remove the Agents Home-Dir and then install them again.

3. If other plugins or other JavaMelody files were made available to the Agents or to the Server somehow, please make sure they were also removed.

These steps will make sure that no JavaMelody libs are still in the Agents classpaths.

We've raised the following issue with JavaMelody so we can make sure this can be resolved on the plugin side as well.

http://code.google.com/p/javamelody/issues/detail?id=231

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.