Problem with REST request in Teamcity v6.5.5

I am getting 404 error when I send a REST request to get customized information from TeamCity v6.5.5. Below are environment details:

Teamcity version: v6.5.5

Environment: Linux 2.6 kernel 64bit OS

Same customized plug-in code is working fine in "Teamcity v6.0.1" under "Windows 7 OS"

Below is the trace of the exception in the teamcity-server.log file:

[2012-01-03 01:45:10,059] ERROR - gins.spring.SpringPluginLoader - Failed to initialize spring context for plugin Admin Extensions
java.lang.NoClassDefFoundError: jetbrains.buildServer.web.plugins.bean.ServerPluginInfo
at java.lang.Class.getDeclaredConstructorsImpl(Native Method)
at java.lang.Class.getDeclaredConstructors(Class.java:477)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:191)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:859)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:831)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(AccessController.java:224)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:206)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at jetbrains.buildServer.plugins.spring.SpringPluginLoader$1.configsExtracted(SpringPluginLoader.java:65)
at jetbrains.buildServer.plugins.spring.SpringPluginConfigExtracter.start(SpringPluginConfigExtracter.java:42)
at jetbrains.buildServer.plugins.spring.SpringPluginLoader.pluginClassesLoaded(SpringPluginLoader.java:73)
at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at jetbrains.buildServer.util.EventDispatcher.dispatch(EventDispatcher.java:112)
at jetbrains.buildServer.util.EventDispatcher$2.invoke(EventDispatcher.java:64)
at $Proxy8.pluginClassesLoaded(Unknown Source)
at jetbrains.buildServer.plugins.PluginManagerImpl$2.visitPlugin(PluginManagerImpl.java:121)
at jetbrains.buildServer.plugins.PluginsCollection.foreachLoadedPlugins(PluginsCollection.java:107)
at jetbrains.buildServer.plugins.PluginManagerImpl.firePluginClassesLoaded(PluginManagerImpl.java:119)
at jetbrains.buildServer.plugins.PluginManagerImpl.loadPlugins(PluginManagerImpl.java:80)
at jetbrains.buildServer.web.plugins.PluginManagerConfigurator.initializePlugins(PluginManagerConfigurator.java:6)
at jetbrains.buildServer.web.impl.BuildServerConfigurator.loadConfiguration(BuildServerConfigurator.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(AccessController.java:224)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:206)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at jetbrains.buildServer.rootDispatcher.spring.WebDispatcherServlet.createWebApplicationContext(WebDispatcherServlet.java:7)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.createServerServlet(TeamCityDispatcherServlet.java:458)
at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processStartupServerInternal(TeamCityDispatcherServlet.java:238)
at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processStartupServerSafe(TeamCityDispatcherServlet.java:123)
at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$400(TeamCityDispatcherServlet.java:80)
at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$6.run(TeamCityDispatcherServlet.java)
at java.lang.Thread.run(Thread.java:736)
Caused by:
java.lang.ClassNotFoundException: Class 'jetbrains.buildServer.web.plugins.bean.ServerPluginInfo' was not found
at java.lang.Throwable.<init>(Throwable.java:80)
at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:77)
at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.doLoadClass(TeamCityClassLoader.java:57)
at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.loadClass(TeamCityClassLoader.java:37)
at java.lang.ClassLoader.loadClass(ClassLoader.java:618)

In the customized plug-in, we are trying to create Project in teamcity server. Login authentication is happening properly using "/httpAuth".

I have properly configured the "teamcity-plugin.xml", the URL that we are referring to from the customized plug-in.

3 comments
Comment actions Permalink

Hi

REST plugin 6.0 is not compatible with TeamCity 6.5 server. It should be upgraded, even without any customizations.
So, you'll need to re-apply your changes to 6.5-compatible branch of REST plugin's sources.

0
Comment actions Permalink

Thank you Michael !!!

The issue got resolved. Problem is with the older version of rest-api.jar that I was using. I have updated the rest-api.jar from the latest source code from Jetbrain SVN repository.

Now, the REST requests are working fine with TeamCity v6.5.x & also TeamCity v6.0.x versions. I am maintaining 2 different versions of rest-api.jar compatible with both the versions of the TeamCity. Very soon we will be upgrading to later version of TeamCity from v6.0.3.

Thanks again...

0
Comment actions Permalink

Murali,

BTW, TeamCIty 7.0 is going to have project and build configuration management via REST as a bundled feature (TW-8394). You are welcome to try latest EAPs and tell us what you think on the new API.

0

Please sign in to leave a comment.