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 ] - rver.server.rest.APIController - Error initializing REST API:  
java.lang.RuntimeException: The scope of the component class jetbrains.buildServer.server.rest.jersey.UrlBuilderProvider must be a singleton
at com.sun.jersey.core.spi.component.ioc.IoCProviderFactory.wrap(IoCProviderFactory.java:99)
at com.sun.jersey.core.spi.component.ioc.IoCProviderFactory._getComponentProvider(IoCProviderFactory.java:90)
at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:150)
at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:128)
at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:233)
at com.sun.jersey.core.spi.component.ProviderServices.getProvidersAndServices(ProviderServices.java:182)
at com.sun.jersey.core.spi.factory.InjectableProviderFactory.configure(InjectableProviderFactory.java:104)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:580)
at jetbrains.buildServer.server.rest.jersey.JerseyWebComponent.initiate(JerseyWebComponent.java:43)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:253)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:517)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:199)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:308)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:642)
at jetbrains.buildServer.server.rest.APIController.init(APIController.java:154)
at jetbrains.buildServer.server.rest.APIController.ensureInitialized(APIController.java:293)
at jetbrains.buildServer.server.rest.APIController.doHandle(APIController.java:203)
at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:74)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at jetbrains.buildServer.web.DisableSessionIdFromUrlFilter.doFilter(DisableSessionIdFromUrlFilter.java:3)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at jetbrains.buildServer.web.DiagnosticFilter.runChainWithModifiedThreadName(DiagnosticFilter.java:41)
at jetbrains.buildServer.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:17)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown 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.

4 comments
Comment actions Permalink

Murali,

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.

0
Comment actions Permalink

Yegor,

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:

http://svn.jetbrains.org/teamcity/plugins/rest-api/branches/

Please help me understand.

0
Comment actions Permalink

Murali,

> 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 http://svn.jetbrains.org/teamcity/plugins/rest-api/branches/Faradi-7.0.x/ branch.

0
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.

0

Please sign in to leave a comment.