Our Plugin is not working on TeamCity 2020
Hello all,
our plugin stopped working on TeamCity 2020, (Checkmarx Plugin)
when we install ( upload the plugin to the teamcity server) and try to run it as a step we are getting the following :
our plugin worked fine on earlier versions, pre V2020.
we are using
-TeamCity Professional 2020.1.2 (build 78726)
as for TeamCity Dependencies
<properties>
<teamcity-version>2018.2</teamcity-version>
</properties>
I tried to change it to 2020.1 but it didnt work for me, And I didn't Find the new packages in mvn repos, but I tried 2020.1 and I got the following error:
Failed to collect dependencies at org.jetbrains.teamcity:server-api:jar:2020.1 -> org.apache.tomcat:tomcat-an
notations-api:jar:8.5.54: Failed to read artifact descriptor for org.apache.tomcat:tomcat-annotations-api:jar:8.5.54: Could not transfer artifact org.apache.tomcat:tomcat-annotations-api:pom:8.5.54 from/to central (http://cx-artifactory:8081/artifactory/plugins-rel
ease-local): No such host is known (cx-artifactory) -> [Help 1]
<dependency>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>server-api</artifactId>
<version>${teamcity-version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>server-web-api</artifactId>
<version>${teamcity-version}</version>
<type>war</type>
<scope>provided</scope>
</dependency>
I would like to know why it stopped working, is it because of the teamcity version for dependencies inside pom xml ?
and what is the proper version to have in order to work with v2020+, and will that cause the plugin not to work with older versions ?
Thanks allot and have a great day,
Majd Mahajenah
Please sign in to leave a comment.
Hi, do you see any errors in teamcity-server.log and in the browser console?
Hello Dmitry,
well yes I do
and this is from the log
[2020-08-11 12:37:56,985] WARN - jetbrains.buildServer.SERVER - Unexpected error during Ajax request processing: java.lang.NoSuchMethodError: 'jetbrains.buildServer.controllers.BasePropertiesBean jetbrains.buildServer.controllers.admin.projects.BuildRunnerBean.getPropertiesBean()'. Request: POST '/admin/editRunType.html?id=buildType%3ACli_Build&runnerId=__NEW_RUNNER__&submitBuildType=store&-ufd-teamcity-ui-runTypeInfoKey=Checkmarx&runTypeInfoKey=checkmarx&showDSL=&showDSLVersion=&showDSLPortable=&submitButton=Save&tc-csrf-token=b1254c88-4ceb-4619-ac37-a0fe766f81b0&numberOfSettingsChangesEvents=4', from client [0:0:0:0:0:0:0:1]:60623, authenticated as 'admin' {id=1}
java.lang.NoSuchMethodError: 'jetbrains.buildServer.controllers.BasePropertiesBean jetbrains.buildServer.controllers.admin.projects.BuildRunnerBean.getPropertiesBean()'
at com.checkmarx.teamcity.server.CxEditRunTypeControllerExtension.validate(CxEditRunTypeControllerExtension.java:79)
at jetbrains.buildServer.controllers.admin.projects.RunTypeExtensionProcessor.validate(RunTypeExtensionProcessor.java:22)
at jetbrains.buildServer.controllers.admin.projects.AdminEditRunTypeController.validate(AdminEditRunTypeController.java:48)
at jetbrains.buildServer.controllers.admin.projects.AbstractEditBuildTypeController._doPost(AbstractEditBuildTypeController.java:148)
at jetbrains.buildServer.controllers.admin.projects.AbstractEditBuildTypeController.doPost(AbstractEditBuildTypeController.java:100)
at jetbrains.buildServer.controllers.BaseFormXmlController$1.handleRequest(BaseFormXmlController.java:54)
at jetbrains.buildServer.controllers.AjaxRequestProcessor.processRequest(AjaxRequestProcessor.java:48)
at jetbrains.buildServer.controllers.BaseFormXmlController.doHandle(BaseFormXmlController.java:52)
at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:114)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:174)
at jetbrains.buildServer.controllers.BaseController.handleRequest(BaseController.java:93)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.processedByMainServlet(TeamCityDispatcherServlet.java:50)
at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:49)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at jetbrains.buildServer.web.jsp.JspPrecompilerFilter.doFilter(JspPrecompilerFilter.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at jetbrains.buildServer.web.DisableSessionIdFromUrlFilter.doFilter(DisableSessionIdFromUrlFilter.java:9)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at jetbrains.buildServer.web.UserIdProviderFilter.doFilter(UserIdProviderFilter.java:12)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at jetbrains.buildServer.web.NodeInfoHeaderFilter.doFilter(NodeInfoHeaderFilter.java:4)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:107)
at jetbrains.buildServer.diagnostic.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:75)
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:112)
at jetbrains.buildServer.web.DependencyParametersCalculationContextFilter.doFilter(DependencyParametersCalculationContextFilter.java:14)
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:112)
at jetbrains.buildServer.diagnostic.web.HttpRequestsDurationMetricsReporter.doFilter(HttpRequestsDurationMetricsReporter.java:6)
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:112)
at jetbrains.buildServer.web.HttpSecurityHeadersFilter.doFilter(HttpSecurityHeadersFilter.java:60)
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:112)
at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:73)
at jetbrains.buildServer.web.DelegatingFilter.doFilter(DelegatingFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at jetbrains.buildServer.web.ResponseFragmentFilter.doFilter(ResponseFragmentFilter.java:14)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:615)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1627)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:834)
there been a discussion about this and i saw that the advice was to recompile the project, as we can see here in the upgrade notes
Changes from 2019.2.x to 2020.1
Need for plugin recompilation
Plugins which implement some build runners might need to be recompiled/upgraded.
The corresponding error might look like
java.lang.NoSuchMethodError: jetbrains.buildServer.controllers.admin.projects.BuildRunnerBean.getPropertiesBean
when a new build step for the corresponding custom build runner is created or updated.See the related issues about the Checkmarx plugin and the SonarQube Runner plugin.
we can see the problem here as well https://youtrack.jetbrains.com/issue/TW-66311
but what changes should i make to make it work ? i recompiled the project with no changes, that did nothing. is there something that I'm missing ?
Thanks allot
Majd
Hi, you need to rebuild the plugin and after that the new version should work.
Hi Dmitry,
Thanks for the response, it's not working though, maybe i'm missing something.
what i did:
1-rebuild the project using the Build Project Button form Intellij
2-mvn clean install since it creates the new Plugin zip
3-upload zip to teamcity and restart server
and I'm still getting the same error,
Am I missing something ? there is no need to change any thing in the dependencies ?
Thanks Allot
Majd
Did you change the teamcity version to 2020.1 before rebuilding the plugin using maven?
No I didn't :)
but when I do i get the following error
[ERROR] Failed to execute goal on project cxplugin-server: Could not resolve dependencies for project com.checkmarx.teamcity:cxplugin-server:jar:2020.1.20:
Failed to collect dependencies at org.jetbrains.teamcity:server-api:jar:2020.1 -> org.apache.tomcat:tomcat-an
notations-api:jar:8.5.54: Failed to read artifact descriptor for org.apache.tomcat:tomcat-annotations-api:jar:8.5.54:
Could not transfer artifact org.apache.tomcat:tomcat-annotations-api:pom:8.5.54 from/to central (http://cx-artifactory:8081/artifactory/plugins-rel
ease-local): No such host is known (cx-artifactory) -> [Help 1]
and i cant find the teamcity 2020.1 on mvn central as well.
Edit:
it was a connectivity issue, i fixed that and the mvn clean install ran well with 2020.1, and i will try it right now.
Thanks
Majd
Hi Dmitry,
Thanks Allot, it worked :)
but my only concern is compatability, do we need to have 2 version one for older teamcity versions and one for 2020 + ?
or is it backward compatible with older teamcity versions ?
Thanks allot
Hi Majd,
Yes, you will need to have 2 versions of the plugin, sorry for inconvenience
Thats OK, Thanks for the help :)