Bad Version Number in Class File
I deployed an updated Ant extension to my cluster this afternoon (Windows agents). What I have seen is that when agents are running in console mode they are fine. But if they are running as a service I see an infinite loop of exceptions like this. Any idea why it's different depending on console vs. service mode? The service logs in as the same user account that I run the console agent as. I have also rebooted to ensure all system variables are consistent for both.
Thanks for any ideas.
Tom
[jar:file:/C:/BuildAgent/plugins/BCDevAntExtension/lib/BCDevAntExtension.jar!/META-INF/build-agent-plugin.xml]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: Bad version number in .class file
INFO | jvm 1 | 2009/02/13 16:29:13 | at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:570)
INFO | jvm 1 | 2009/02/13 16:29:13 | at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:190)
INFO | jvm 1 | 2009/02/13 16:29:13 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:923)
INFO | jvm 1 | 2009/02/13 16:29:13 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:833)
INFO | jvm 1 | 2009/02/13 16:29:13 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
INFO | jvm 1 | 2009/02/13 16:29:13 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
INFO | jvm 1 | 2009/02/13 16:29:13 | at java.security.AccessController.doPrivileged(Native Method)
INFO | jvm 1 | 2009/02/13 16:29:13 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
Please sign in to leave a comment.
Hello Tom,
It looks you have a custom BCDevAntExtension plugin installed, and you probably run build agent under JDK 1.5 when this plugin is compiled under JDK 1.6.
Regards,
KIR
Hi Kirill,
What I couldn't figure out was why this could happen. I'm compiling with JDK 1.6 but I have my JAVA_HOME on the agent set to point to 1.6 (only one I installed) AND the agent.properties file also points to 1.6.
env.TEAMCITY_JRE=C\:\\Program Files\\Java\\jdk1.6.0_04
Moreover, the agent started fine in console mode. It only failed in service mode. I finally noticed this line in the wrapper.log:
INFO | jvm 1 | 2009/02/17 09:31:21 | c:\TeamCity\jre\bin\java -ea -Xmx512m ...
and tracked it down to a line in buildAgent\launcher\conf\wrapper.conf.
wrapper.java.command=../jre/bin/java (or ../../jre/bin/java on the server machine)
I changed this to:
wrapper.java.command=%JAVA_HOME%/jre/bin/java
and all is well. I'm including this all here because I'm sure it will come up again.
Thanks,
Tom