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

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

The agent start up fails with the following stack trace:

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

 

 

Last modified on Nov 30, 2017

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.