Include third party jars in the plugin package

Hi!

I've created a plugin that uses apache-xml-rpc jars (xmlrpc-client-3.1.3.jar, xmlrpc-common-3.1.3, ws-commons-util-1.0.2.jar). If I place these jars to TeamCity/bin, my plugin works OK, but each time I update the server I need to remember to copy all 3rd party jars which is not desirable. I wanted to include all of them in the package zip (to <plugin.zip>/server/), however I get the following error:

23.01.2014 18:51:23 org.apache.catalina.core.StandardWrapperValve invoke

SEVERE: Servlet.service() for servlet [buildServer] in context with path [] threw exception [Handler processing failed; nested exception is java.lang.IncompatibleClassChangeError: Implementing class] with root cause

java.lang.IncompatibleClassChangeError: Implementing class

 at java.lang.ClassLoader.defineClass1(Native Method)

 at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)

 at java.lang.ClassLoader.defineClass(ClassLoader.java:621)

 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

 at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

 at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

 at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

 at java.security.AccessController.doPrivileged(Native Method)

 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

 at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.doLoadClass(TeamCityClassLoader.java:68)

 at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.loadClass(TeamCityClassLoader.java:37)

 at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

...

 at jetbrains.buildServer.controllers.ActionErrors.fillErrors(ActionErrors.java:139)

 at jetbrains.buildServer.controllers.admin.projects.EditBuildTriggersController.validate(EditBuildTriggersController.java:25)

 at jetbrains.buildServer.controllers.admin.projects.AbstractEditBuildTypeController.doPost(AbstractEditBuildTypeController.java:10)

 at jetbrains.buildServer.controllers.BaseFormXmlController$1.handleRequest(BaseFormXmlController.java:54)

 at jetbrains.buildServer.controllers.AjaxRequestProcessor.processRequest(AjaxRequestProcessor.java:45)

 at jetbrains.buildServer.controllers.BaseFormXmlController.doHandle(BaseFormXmlController.java:52)

 at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:73)

 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:647)

 at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

 at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:17)

 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

 at jetbrains.buildServer.web.ParametersProviderCalculationContextFilter.doFilter(ParametersProviderCalculationContextFilter.java:7)

 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

 at jetbrains.buildServer.web.DisableSessionIdFromUrlFilter.doFilter(DisableSessionIdFromUrlFilter.java:1)

 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.doFilter(DiagnosticFilter.java:63)

 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

 at jetbrains.buildServer.web.ResponseFragmentFilter.doFilter(ResponseFragmentFilter.java:3)

 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:222)

 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)

 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)

 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:1004)

 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)

 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1686)

 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)

 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

 at java.lang.Thread.run(Thread.java:695)

The stacktrace starts when I call XmlRpcClient client = new XmlRpcClient(); //from xmlrpc-client-3.1.3.jar

I not very experienced in java, what is the best way to ship 3rd parties with the plugin?

2 comments
Comment actions Permalink

the error was because I used the downloaded xml-prec with version 3 and TC has 2, I switched to the TC's and it worked

0
Comment actions Permalink

see the resolution

0

Please sign in to leave a comment.