Problem while executing REST request in TeamCity v7.x

Environment details are:

Server Version: TeamCity v7.0 and also TeamCity v7.0.3

Operating System: Windows 7

I am trying to execute the REST API request to create a project in TeamCity. It is failing with the below error:

[2012-05-23 11:02:00,740]  ERROR [ Java/1.6.0_23 ] - - Error initializing REST API:  
java.lang.RuntimeException: The scope of the component class must be a singleton
at com.sun.jersey.core.spi.component.ioc.IoCProviderFactory.wrap(
at com.sun.jersey.core.spi.component.ioc.IoCProviderFactory._getComponentProvider(
at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(
at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(
at com.sun.jersey.core.spi.component.ProviderServices.getComponent(
at com.sun.jersey.core.spi.component.ProviderServices.getProvidersAndServices(
at com.sun.jersey.core.spi.factory.InjectableProviderFactory.configure(
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(
at com.sun.jersey.spi.container.servlet.WebComponent.load(
at com.sun.jersey.spi.container.servlet.WebComponent.init(
at com.sun.jersey.spi.container.servlet.ServletContainer.init(
at com.sun.jersey.spi.container.servlet.ServletContainer.init(
at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(
at org.springframework.web.servlet.DispatcherServlet.doDispatch(
at org.springframework.web.servlet.DispatcherServlet.doService(
at org.springframework.web.servlet.FrameworkServlet.processRequest(
at org.springframework.web.servlet.FrameworkServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at jetbrains.buildServer.web.DisableSessionIdFromUrlFilter.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at jetbrains.buildServer.web.DiagnosticFilter.runChainWithModifiedThreadName(
at jetbrains.buildServer.web.DiagnosticFilter.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.AbstractHttp11Processor.process(
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$ Source)
at Source)

I followed the below URL to understand the issue, but couldn't succeed. I have installed the CCTray plugin which is available in the link and tried the same operation, but failed. In Teamcity v6.5.5, this is working fine without any issue.

It is not working on v7.x version of TeamCity.

Please help me resolving this issue.

Comment actions Permalink


Seems the error is generated by an older version of plugin. Please note that CCTray URL is supported natively in TeamCity 7.0, so you no longer need to install separate plugins.

Please ensure you do not have any cctray or REST -related plugins in .BuildServer/plugins.

Comment actions Permalink


Thank you for your reply!!!

I have not installed any RTC plug-in in .BuildServer/plugins folder. I do have one customized REST plugin to handle our application specific requests. This plugin has rest-api.jar specific to TeamCity v6.x.

Is this causing any problem with the current TeamCity v7.0 version?

Do I need to use rest-api.jar file compiled from the source code hosted in Jetbrains SVN repository rest-api branch? Below is the URL of the same:

Please help me understand.

Comment actions Permalink


> Is this causing any problem with the current TeamCity v7.0 version?

Yes, using rest-api plugin from another TeamCIty version is definitely going to cause problems.

> Do I need to use rest-api.jar file compiled from the source code hosted in Jetbrains SVN repository rest-api branch?

REST API plugin is bundled and you should not change it. You can, however, base your plugin on it's currnet sources. See the note on this.

For TeamCity 7.0.x version you woul dneed to base your plugin on branch.

Comment actions Permalink

Thank you so much Yegor!!!

Issue is resolved. I have downloaded the source code from Jetbrains SVN rep and built the rest-api.jar file compatible with TeamCity v7.x.

Now, the REST requests are working properly in the application.

Thank you for timely response.


Please sign in to leave a comment.