JetBrains / teamcity-deployer-plugin

Deployer plugin for TeamCity CI server
http://confluence.jetbrains.net/display/TW/Deployer+plugin
Apache License 2.0
39 stars 29 forks source link

Deploy to Tomcat 7 fails on some war #37

Closed nskvortsov closed 9 years ago

nskvortsov commented 9 years ago

I have a build defined in TeamCity that has to deploy 6 war on the same Tomcat. 4 of them are deployed fine when on the other 2 I got the following error :

Build failure message received: org.codehaus.cargo.container.ContainerException: Failed to create deployable with implementation class org.codehaus.cargo.container.tomcat.TomcatWAR for the parameters (container [id = [tomcat7x]], deployable type [war]).

The deployment steps are the same due the fact that I've to deploy all the war on the same Tomcat server


nskvortsov commented 9 years ago

It seems that if the war contains the file context.xml in META-INF the deploy failed. It means that the plugin never try to deploy on Tomcat, it just stopped before.


Original comment by: Alessandro Lentini

nskvortsov commented 9 years ago

I've got the same issue. I've also tried to put an empty file called context.xml into META-INF, and it breaks the deploy the same. The same war file, but without the even empty context.xml, works well.


Original comment by: Nicola Lacquaniti

nskvortsov commented 9 years ago

@alentini-eurostar can you please attach teamcity-agent.log file with the error message? Also a context.xml content would be very useful.


Original comment by: Nikita Skvortsov

nskvortsov commented 9 years ago

@nicopam using empty context.xml indeed causes such an error. Please, create valid context.xml file.


Original comment by: Nikita Skvortsov

nskvortsov commented 9 years ago

@nskvortsov please find below the log and and the context.xml. Please note that the same war can be deployed manually on the same destination tomcat without any problem.

log :

[13:14:00] : Step 5/8: Deploy Captor (Container Deployer) (6s) [13:14:00] : [Step 5/8] ##teamcity[buildStatisticValue key='buildStageDuration:buildStepRUNNER_11' value='0.0'] [13:14:00] : [Step 5/8] Deploying [GamblingCapturadorServerEs\target\GamblingCapturadorServerEs-dev.war] to [172.31.44.170:8080], container type [tomcat7x] [13:14:06] : [Step 5/8] Deploy finished. [13:14:06] : [Step 5/8] ##teamcity[buildStatisticValue key='buildStageDuration:buildStepRUNNER_11' value='6056.0'] [13:14:06]E: Step 6/8: Deploy Exalogic Service (Container Deployer) [13:14:06] : [Step 6/8] ##teamcity[buildStatisticValue key='buildStageDuration:buildStepRUNNER_16' value='0.0'] [13:14:06] : [Step 6/8] org.codehaus.cargo.container.ContainerException: Failed to create deployable with implementation class org.codehaus.cargo.container.tomcat.TomcatWAR for the parameters (container [id = [tomcat7x]], deployable type [war]). [13:14:06] : [Step 6/8] ##teamcity[buildStatisticValue key='buildStageDuration:buildStepRUNNER_16' value='181.0'] [13:14:06]E: [Step 6/8] Step Deploy Exalogic Service (Container Deployer) failed [13:14:06] : Step 7/8: Deploy Exalogic BackOffice (Container Deployer)

context.xml


Original comment by: Alessandro Lentini

nskvortsov commented 9 years ago

@alentini-eurostar thank you for fast reply.


Original comment by: Nikita Skvortsov

nskvortsov commented 9 years ago

@alentini-eurostar , could you please attach here a teamcity-agent.log file (not the build log)? I hope to see the full stacktrace in the file. The file is located under logs directory inside TeamCity agent installation.


Original comment by: Nikita Skvortsov

nskvortsov commented 9 years ago

Duplicate of #32.


Original comment by: Nikita Skvortsov

nskvortsov commented 9 years ago

Please find the teamcity-agent.log

[2014-08-26 13:14:06,338] INFO - .impl.runner.CallRunnerService - Found runner cargo-deploy-runner for 243 [2014-08-26 13:14:06,338] INFO - erStages.start.CallRunnerStage - Found runner cargo-deploy-runner for 243 [2014-08-26 13:14:06,338] INFO - erStages.start.CallRunnerStage - Start build runner for build 243 cargo-deploy-runner [2014-08-26 13:14:06,338] INFO - erStages.start.CallRunnerStage - ----------------------------------------- [ Winga Backend::Build #148 (buildId = 243) ] ----------------------------------------- [2014-08-26 13:14:06,429] ERROR - jetbrains.buildServer.AGENT - org.codehaus.cargo.container.ContainerException: Failed to create deployable with implementation class org.codehaus.cargo.container.tomcat.TomcatWAR for the parameters (container [id = [tomcat7x]], deployable type [war]).

jetbrains.buildServer.RunBuildException: org.codehaus.cargo.container.ContainerException: Failed to create deployable with implementation class org.codehaus.cargo.container.tomcat.TomcatWAR for the parameters (container [id = [tomcat7x]], deployable type [war]). at jetbrains.buildServer.deployer.agent.cargo.CargoBuildProcessAdapter.runProcess(CargoBuildProcessAdapter.java:104) at jetbrains.buildServer.deployer.agent.SyncBuildProcessAdapter.start(SyncBuildProcessAdapter.java:58) at jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.CallRunnerStage.doBuildStage(CallRunnerStage.java:58) at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:25) at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:18) at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:78) at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:37) at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor.doStages(RunnerStagesExecutor.java:18) at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.RunnerContextExecutor.callRunnerStages(RunnerContextExecutor.java:43) at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.StepExecutor.processNextStep(StepExecutor.java:25) at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.executeRunnerStep(ForEachBuildRunnerStage.java:138) at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.runStep(ForEachBuildRunnerStage.java:123) at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.executeBuildRunners(ForEachBuildRunnerStage.java:83) at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.doBuildStage(ForEachBuildRunnerStage.java:44) at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:31) at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:24) at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:78) at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:37) at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor.doStages(BuildStagesExecutor.java:24) at jetbrains.buildServer.agent.impl.BuildRunAction.doStages(BuildRunAction.java:70) at jetbrains.buildServer.agent.impl.BuildRunAction.runBuild(BuildRunAction.java:50) at jetbrains.buildServer.agent.impl.BuildAgentImpl.doActualBuild(BuildAgentImpl.java:265) at jetbrains.buildServer.agent.impl.BuildAgentImpl.access$100(BuildAgentImpl.java:52) at jetbrains.buildServer.agent.impl.BuildAgentImpl$1.run(BuildAgentImpl.java:231) at java.lang.Thread.run(Thread.java:744) Caused by: org.codehaus.cargo.container.ContainerException: Failed to create deployable with implementation class org.codehaus.cargo.container.tomcat.TomcatWAR for the parameters (container [id = [tomcat7x]], deployable type [war]). at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:154) at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory.createImplementation(AbstractIntrospectionGenericHintFactory.java:93) at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.createDeployable(DefaultDeployableFactory.java:156) at jetbrains.buildServer.deployer.agent.cargo.CargoBuildProcessAdapter.runProcess(CargoBuildProcessAdapter.java:93) ... 24 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.createInstance(DefaultDeployableFactory.java:196) at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.createInstance(DefaultDeployableFactory.java:47) at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:150) ... 27 more Caused by: java.lang.ExceptionInInitializerError at org.codehaus.cargo.module.webapp.tomcat.TomcatContextXmlIo.(TomcatContextXmlIo.java:40) at org.codehaus.cargo.module.webapp.tomcat.TomcatContextXmlIo.parseTomcatConfigXml(TomcatContextXmlIo.java:54) at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.parseTomcatContextXml(TomcatWarArchive.java:92) at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.(TomcatWarArchive.java:59) at org.codehaus.cargo.container.tomcat.TomcatWAR.(TomcatWAR.java:50) ... 34 more Caused by: java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source) at org.codehaus.cargo.module.Dtd.(Dtd.java:144) at org.codehaus.cargo.module.webapp.tomcat.TomcatContextXmlType.(TomcatContextXmlType.java:52) at org.codehaus.cargo.module.webapp.tomcat.TomcatContextXmlType.(TomcatContextXmlType.java:34) ... 39 more [2014-08-26 13:14:06,430] INFO - ges.RunnerFinishStagesExecutor - Call finish stage jetbrains.buildServer.agent.impl.buildStages.runnerStages.finish.UnsubscribePropertiesFileUpdaterRunnedFStage [2014-08-26 13:14:06,430] INFO - ges.RunnerFinishStagesExecutor - Call finish stage jetbrains.buildServer.agent.impl.buildStages.runnerStages.finish.FlushBuildLogRunnerFStage [2014-08-26 13:14:06,434] INFO - ges.RunnerFinishStagesExecutor - Call finish stage jetbrains.buildServer.agent.impl.buildStages.runnerStages.finish.FireRunnerFinishedFStage [2014-08-26 13:14:06,450] INFO - mpl$TeamCitySpringSubConatiner - Closing SubContext: running build runner context id=243 runner 6 of 8: startup date [Tue Aug 26 13:14:06 UTC 2014]; parent: SubContext: running build context id=243 [2014-08-26 13:


Original comment by: Alessandro Lentini

nskvortsov commented 9 years ago

@alentini-eurostar thank you very much for your help! This is exactly the duplicate of issue #32. I have fixed it. Hopefully. Please try fresh build of plugin.


Original comment by: Nikita Skvortsov

nskvortsov commented 9 years ago

@nskvortsov Sorry, can you give me the URL to download and try the new build please ? I've tried using the URL in the other issue but I ot a login page in teamcity ...


Original comment by: Alessandro Lentini

nskvortsov commented 9 years ago

Try this url: http://teamcity.jetbrains.com/guestAuth/app/rest/builds/id:156111/artifacts/files/deploy-runner.zip?guest=1


Original comment by: Nikita Skvortsov

nskvortsov commented 9 years ago

@nskvortsov It works!!!! Thank you!!!!!!!!


Original comment by: Alessandro Lentini

srinathrajappa commented 9 years ago

Hi i want automate deployment using teamcity please me out ( using Deployer plugins)

srinathrajappa commented 9 years ago

I have maven war (E:\Sonar\TeamCity\buildAgent\work\36114405910b4a80\target\war) using tomcat or jetty to deploy automate

nskvortsov commented 9 years ago

@srinathrajappa please, use this doc: https://confluence.jetbrains.com/display/TW/Deployer+plugin

velikanov commented 9 years ago

@nskvortsov, first of all thank you for great plugin! but I don't understand what to write in "Target:" and "Path to war archive:" (I'm trying to deploy on Tomcat 8) can you share some examples in documentation? Thank you in advance!

nskvortsov commented 9 years ago

@velikanov , "Target" is your Tomcat's url (e.g., http:hostname:8080/) and "Path to war archive" is a path to *.war file on a build agent (relative to checkout directory). Note, that you will need "manager" webapp on the tomcat server and "manager-script" role for the user.

velikanov commented 9 years ago

@nskvortsov, you are perfectly right! thank you!

srinathrajappa commented 9 years ago

Org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\TeamCity\buildAgent\work\c0194affbb0412cb\target\careonline-0.0.1-SNAPSHOT.wa

srinathrajappa commented 9 years ago

Org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\TeamCity\buildAgent\work\c0194affbb0412cb\target\careonline-0.0.1-SNAPSHOT.war

srinathrajappa commented 9 years ago

[2015-05-07 00:28:23,918] INFO - .impl.runner.CallRunnerService - Found runner cargo-deploy-runner for 78 [2015-05-07 00:28:23,918] INFO - erStages.start.CallRunnerStage - Found runner cargo-deploy-runner for 78 [2015-05-07 00:28:23,918] INFO - erStages.start.CallRunnerStage - Start build runner for build 78 cargo-deploy-runner [2015-05-07 00:28:23,918] INFO - erStages.start.CallRunnerStage - ----------------------------------------- [ Careonline-portal::CareOninePortal #6 (buildId = 78) ] ----------------------------------------- [2015-05-07 00:28:29,845] ERROR - jetbrains.buildServer.AGENT - org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\TeamCity\buildAgent\work\c0194affbb0412cb\target\careonline-0.0.1-SNAPSHOT.war]

jetbrains.buildServer.RunBuildException: org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\TeamCity\buildAgent\work\c0194affbb0412cb\target\careonline-0.0.1-SNAPSHOT.war] at jetbrains.buildServer.deployer.agent.cargo.CargoBuildProcessAdapter.runProcess(CargoBuildProcessAdapter.java:104) at jetbrains.buildServer.deployer.agent.SyncBuildProcessAdapter.start(SyncBuildProcessAdapter.java:58) at jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.CallRunnerStage.doBuildStage(CallRunnerStage.java:58) at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:25) at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:18) at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:78)

jfsaaf commented 8 years ago

Is there any fix for this ContainerException: Failed to create deployable... error above? I have spent hours on this without a single step in the right direction. Thanks in advance.

nskvortsov commented 8 years ago

@jfsaaf issue #71, mentioned above, did not require any fixes other than providing correct path to *.war archive to be deployed. Please, avoid commenting closed issue and create new one. Attach full build log and relevant part of teamcity-agent.log file for investigation