TeamCity Plugin 2.4.5 fails to load

The 2.4.5 version of the TC plugin fails to load. Log from TC below. Reverting to 2.3.x version of the plugin resolves the issue for the time being.

[2014-05-14 20:09:20,303]  ERROR - gins.spring.SpringPluginLoader - Failed to initialize spring context for plugin Octopus.TeamCity 
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [octopus.teamcity.server.OctopusBuildRunTypeExtension] for bean with name 'octopus.teamcity.server.OctopusBuildRunTypeExtension#0' defined in plugin: Octopus.TeamCity#Octopus.TeamCity.jar!/META-INF/build-server-plugin-Octopus.TeamCity.xml: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: octopus/teamcity/server/OctopusBuildRunTypeExtension : Unsupported major.minor version 52.0
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1253)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1319)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:885)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:562)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
	at jetbrains.buildServer.plugins.spring.SpringPluginLoader.pluginClassesLoaded(SpringPluginLoader.java:72)
	at sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at jetbrains.buildServer.util.EventDispatcher.dispatch(EventDispatcher.java:117)
	at jetbrains.buildServer.util.EventDispatcher$2.invoke(EventDispatcher.java:67)
	at com.sun.proxy.$Proxy7.pluginClassesLoaded(Unknown Source)
	at jetbrains.buildServer.plugins.PluginManagerImpl$2.visitPlugin(PluginManagerImpl.java:122)
	at jetbrains.buildServer.plugins.PluginsCollection.foreachLoadedPlugins(PluginsCollection.java:107)
	at jetbrains.buildServer.plugins.PluginManagerImpl.firePluginClassesLoaded(PluginManagerImpl.java:120)
	at jetbrains.buildServer.plugins.PluginManagerImpl.loadPlugins(PluginManagerImpl.java:80)
	at jetbrains.buildServer.web.plugins.PluginManagerConfigurator.initializePlugins(PluginManagerConfigurator.java:9)
	at jetbrains.buildServer.web.impl.BuildServerConfigurator.loadConfiguration(BuildServerConfigurator.java:105)
	at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet$WebApplicationCreatorAndDestroyer.createApplication(TeamCityDispatcherServlet.java:0)
	at jetbrains.buildServer.maintenance.StartupProcessor.doApplicationStarting(StartupProcessor.java:83)
	at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStage(StartupProcessor.java:613)
	at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStageSafe(StartupProcessor.java:486)
	at jetbrains.buildServer.maintenance.StartupProcessor.processTeamCityLifecycle(StartupProcessor.java:448)
	at jetbrains.buildServer.maintenance.StartupProcessor.access$000(StartupProcessor.java:450)
	at jetbrains.buildServer.maintenance.StartupProcessor$1.run(StartupProcessor.java:1)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.UnsupportedClassVersionError: octopus/teamcity/server/OctopusBuildRunTypeExtension : Unsupported major.minor version 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.doLoadClass(TeamCityClassLoader.java:71)
	at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.loadClass(TeamCityClassLoader.java:40)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1271)
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1242)
	... 27 more

Thanks Adam, and sorry about this. We’ll fix this and get a new version out shortly.

Paul

Hi Adam,

Really sorry about this, we moved to a new build environment and upgraded the JDK on our build servers, which meant we were building the plugin using the wrong JDK version. We’ve released a new build - it’s on the downloads page or you can get it directly here:

http://octopusdeploy.com/downloads/latest/TeamCityPlugin

Sorry again, hope this helps.

Paul

Confirmed. The new build works nicely. Thanks for the fix Paul.

This is still happening with me. I also downgraded to 2.3.x and it also still doesnt load the bean. Also you might want to update the download page with the latest.

Could not create the main application servlet: Error creating bean with name ‘jetbrains.buildServer.spring.candidates.MainAutowireCandidateResolver#0’ defined in URL [jar:file:/C:/Accounts/TeamCity/webapps/ROOT/WEB-INF/lib/common-impl.jar!/META-INF/teamcity-global-spring-candidate-resolver.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [jetbrains.buildServer.spring.candidates.TeamCityAutowireCandidateResolver[]]: : Error loading class [octopus.teamcity.server.OctopusBuildRunTypeExtension] for bean with name ‘octopus.teamcity.server.OctopusBuildRunTypeExtension#0’ defined in URL [jar:file:/C:/Accounts/TeamCity/lib/Octopus.TeamCity.jar!/META-INF/build-server-plugin-Octopus.TeamCity.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: jetbrains/buildServer/serverSide/RunTypeExtension; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [octopus.teamcity.server.OctopusBuildRunTypeExtension] for bean with name ‘octopus.teamcity.server.OctopusBuildRunTypeExtension#0’ defined in URL [jar:file:/C:/Accounts/TeamCity/lib/Octopus.TeamCity.jar!/META-INF/build-server-plugin-Octopus.TeamCity.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: jetbrains/buildServer/serverSide/RunTypeExtension

Hi Eric,

Thanks for getting in touch, this does seem to be a different issue. What version of TeamCity are you running? In TeamCity, if you go to Administration > Diagnostics and scroll to the bottom, it should say something like:

Java version: _______

What version of Java does it show on that page?

Paul

Hey Paul

Using the following version : 8.0.6 (build 27767)
Java version: 1.7.0_21

Hi Eric,

Thanks for the reply, that’s a bit strange. The error comes down to:

java.lang.NoClassDefFoundError: jetbrains/buildServer/serverSide/RunTypeExtension

Basically, one of our types inherits from one built-in to TeamCity.

We’ve tested the plugin against TeamCity since version 7. Right now I’m running a server with 8.1.2 (Java version: 1.7.0_51) and it’s working, so it’s hard to imagine that the class could have been removed and added again.

Would it be possible to stop TeamCity, remove the Octopus plugin, start it and confirm the plugin isn’t loaded, stop TeamCity again, install the latest plugin, and start it?

Paul