Solucionado (ver solução)
Solucionado
(ver solução)
3
respostas

Problemas com o Redeploy no Tomcat7

Pessoal,

O meu Tomcat7 não está aceitando o redeploy e está devolvendo erro para o Jenkins. A única coisa que resolve é reiniciá-lo. Alguém consegue ajudar?

Se eu tentar fazer o undeploy na tela de Manager Applications ele também não consegue:

FAIL - Unable to delete [C:\apache-tomcat-7.0.72\webapps\argentum-web]. The continued presence of this file may cause problems.

Um abraço, André.

Started by user Andre Building in workspace C:\Users\Franz.jenkins\workspace\Argentum-web

C:\Program Files\Git\cmd\git.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository C:\Program Files\Git\cmd\git.exe config remote.origin.url https://github.com/alura-cursos/argentum-web.git # timeout=10 Fetching upstream changes from https://github.com/alura-cursos/argentum-web.git C:\Program Files\Git\cmd\git.exe --version # timeout=10 C:\Program Files\Git\cmd\git.exe fetch --tags --progress https://github.com/alura-cursos/argentum-web.git +refs/heads/:refs/remotes/origin/ C:\Program Files\Git\cmd\git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10 C:\Program Files\Git\cmd\git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10 Checking out Revision e1c09b7b6dc948b66c633bf950b6eebe7c630136 (refs/remotes/origin/master) C:\Program Files\Git\cmd\git.exe config core.sparsecheckout # timeout=10 C:\Program Files\Git\cmd\git.exe checkout -f e1c09b7b6dc948b66c633bf950b6eebe7c630136 C:\Program Files\Git\cmd\git.exe rev-list e1c09b7b6dc948b66c633bf950b6eebe7c630136 # timeout=10 [Argentum-web] $ cmd.exe /C "C:\apache-maven-3.3.9\bin\mvn.cmd clean verify -Ptestes-integracao -Dphantomjs.binary.path=C:\Users\Franz\Downloads\phantomjs-2.1.1-windows\phantomjs-2.1.1-windows\bin\phantomjs.exe && exit %%ERRORLEVEL%%" [INFO] Scanning for projects... [INFO][INFO] ------------------------------------------------------------------------ [INFO] Building argentum-web 1.0.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ argentum-web --- [INFO] Deleting C:\Users\Franz.jenkins\workspace\Argentum-web\target [INFO] [INFO] --- jacoco-maven-plugin:0.7.6.201602180812:prepare-agent (default) @ argentum-web --- [INFO] argLine set to -javaagent:C:\Users\Franz\.m2\repository\org\jacoco\org.jacoco.agent\0.7.6.201602180812\org.jacoco.agent-0.7.6.201602180812-runtime.jar=destfile=C:\Users\Franz\.jenkins\workspace\Argentum-web\target\jacoco.exec [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ argentum-web --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ argentum-web --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 13 source files to C:\Users\Franz.jenkins\workspace\Argentum-web\target\classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ argentum-web --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ argentum-web --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 7 source files to C:\Users\Franz.jenkins\workspace\Argentum-web\target\test-classes [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ argentum-web --- [INFO] Surefire report directory: C:\Users\Franz.jenkins\workspace\Argentum-web\target\surefire-reports


T E S T S

Running br.com.caelum.argentum.indicadores.MediaMovelPonderadaTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.202 sec Running br.com.caelum.argentum.indicadores.MediaMovelSimplesTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec Running br.com.caelum.argentum.modelo.CandlestickFactoryTest Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec Running br.com.caelum.argentum.modelo.NegociacaoTest Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec Running br.com.caelum.argentum.reader.LeitorXMLTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.835 sec

Results :

Tests run: 13, Failures: 0, Errors: 0, Skipped: 0

[INFO] [INFO] --- maven-surefire-report-plugin:2.19.1:report-only (default) @ argentum-web --- [WARNING] Unable to locate Test Source XRef to link to - DISABLED [INFO] [INFO] --- maven-war-plugin:2.6:war (default-war) @ argentum-web --- [INFO] Packaging webapp [INFO] Assembling webapp [argentum-web] in [C:\Users\Franz.jenkins\workspace\Argentum-web\target\argentum-web] [INFO] Processing war project [INFO] Copying webapp resources [C:\Users\Franz.jenkins\workspace\Argentum-web\src\main\webapp] [INFO] Webapp assembled in [201 msecs] [INFO] Building war: C:\Users\Franz.jenkins\workspace\Argentum-web\target\argentum-web.war [INFO] [INFO] --- maven-failsafe-plugin:2.19.1:integration-test (default) @ argentum-web ---


T E S T S

Running br.com.caelum.argentum.bean.FiltraNegociacoesIT nov 05, 2016 3:20:18 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-8888"] nov 05, 2016 3:20:19 PM org.apache.catalina.core.StandardService startInternal INFO: Starting service arquillian-tomcat-embedded-7 nov 05, 2016 3:20:19 PM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.64 nov 05, 2016 3:20:19 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8888"] nov 05, 2016 3:20:23 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive C:\Users\Franz.jenkins\workspace\Argentum-web\target\tomcat-embedded-7\webapps\ROOT.war nov 05, 2016 3:20:24 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment INFO: No global web.xml found nov 05, 2016 3:20:26 PM org.apache.catalina.startup.TldConfig execute INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. nov 05, 2016 3:20:27 PM com.sun.faces.config.ConfigureListener contextInitialized INFO: Initializing Mojarra 2.2.6 ( 20140304-1537 https://svn.java.net/svn/mojarra~svn/tags/2.2.6@12949) for context '' nov 05, 2016 3:20:27 PM com.sun.faces.spi.InjectionProviderFactory createInstance INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed. nov 05, 2016 3:20:27 PM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation SEVERE: Unknow type constant pool 18 at position 27 nov 05, 2016 3:20:27 PM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation SEVERE: Unknow type constant pool 0 at position 28 nov 05, 2016 3:20:27 PM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation SEVERE: Unknow type constant pool 0 at position 29 nov 05, 2016 3:20:27 PM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation SEVERE: Unknow type constant pool 0 at position 30 nov 05, 2016 3:20:27 PM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation SEVERE: Unknow type constant pool -85 at position 31 nov 05, 2016 3:20:29 PM org.primefaces.webapp.PostConstructApplicationEventListener processEvent INFO: Running on PrimeFaces 5.3 nov 05, 2016 3:20:29 PM org.primefaces.webapp.PostConstructApplicationEventListener processEvent INFO: Running on PrimeFaces 5.3 nov 05, 2016 3:20:29 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deployment of web application archive C:\Users\Franz.jenkins\workspace\Argentum-web\target\tomcat-embedded-7\webapps\ROOT.war has finished in 5,523 ms nov 05, 2016 3:20:30 PM org.openqa.selenium.phantomjs.PhantomJSDriverService INFO: executable: C:\Users\Franz\Downloads\phantomjs-2.1.1-windows\phantomjs-2.1.1-windows\bin\phantomjs.exe nov 05, 2016 3:20:30 PM org.openqa.selenium.phantomjs.PhantomJSDriverService INFO: port: 55568 nov 05, 2016 3:20:30 PM org.openqa.selenium.phantomjs.PhantomJSDriverService INFO: arguments: [--webdriver=55568, --webdriver-logfile=C:\Users\Franz.jenkins\workspace\Argentum-web\phantomjsdriver.log] nov 05, 2016 3:20:30 PM org.openqa.selenium.phantomjs.PhantomJSDriverService INFO: environment: {} [INFO - 2016-11-05T17:20:32.526Z] GhostDriver - Main - running on port 55568 log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager). log4j:WARN Please initialize the log4j system properly. [INFO - 2016-11-05T17:20:33.789Z] Session [28d70070-a37c-11e6-b5c0-bf845efbe73d] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1","webSecurityEnabled":true} [INFO - 2016-11-05T17:20:33.790Z] Session [28d70070-a37c-11e6-b5c0-bf845efbe73d] - page.customHeaders: - {} [INFO - 2016-11-05T17:20:33.790Z] Session [28d70070-a37c-11e6-b5c0-bf845efbe73d] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"2.1.1","driverName":"ghostdriver","driverVersion":"1.2.0","platform":"windows-10-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}} [INFO - 2016-11-05T17:20:33.790Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 28d70070-a37c-11e6-b5c0-bf845efbe73d [INFO - 2016-11-05T17:20:39.881Z] ShutdownReqHand - _handle - About to shutdown nov 05, 2016 3:20:41 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [UrlChecker-2] but has failed to stop it. This is very likely to create a memory leak. nov 05, 2016 3:20:41 PM org.apache.catalina.startup.ExpandWar deleteDir SEVERE: [C:\Users\Franz.jenkins\workspace\Argentum-web\target\tomcat-embedded-7\webapps\ROOT\WEB-INF\lib] could not be completely deleted. The presence of the remaining files may cause problems nov 05, 2016 3:20:41 PM org.apache.catalina.startup.ExpandWar deleteDir SEVERE: [C:\Users\Franz.jenkins\workspace\Argentum-web\target\tomcat-embedded-7\webapps\ROOT\WEB-INF] could not be completely deleted. The presence of the remaining files may cause problems nov 05, 2016 3:20:41 PM org.apache.catalina.startup.ExpandWar deleteDir SEVERE: [C:\Users\Franz.jenkins\workspace\Argentum-web\target\tomcat-embedded-7\webapps\ROOT] could not be completely deleted. The presence of the remaining files may cause problems Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 24.297 sec - in br.com.caelum.argentum.bean.FiltraNegociacoesIT nov 05, 2016 3:20:41 PM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["http-bio-8888"] nov 05, 2016 3:20:41 PM org.apache.catalina.core.StandardService stopInternal INFO: Stopping service arquillian-tomcat-embedded-7 nov 05, 2016 3:20:41 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["http-bio-8888"]

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] [INFO] --- maven-pmd-plugin:3.6:pmd (default) @ argentum-web --- [WARNING] Unable to locate Source XRef to link to - DISABLED [INFO] [INFO] --- jacoco-maven-plugin:0.7.6.201602180812:report (default) @ argentum-web --- [INFO] Analyzed bundle 'argentum-web' with 12 classes [INFO] [INFO] --- maven-failsafe-plugin:2.19.1:verify (default) @ argentum-web --- [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 41.053 s [INFO] Finished at: 2016-11-05T15:20:44-02:00 [INFO] Final Memory: 39M/350M [INFO] ------------------------------------------------------------------------ Deploying C:\Users\Franz.jenkins\workspace\Argentum-web\target\argentum-web.war to container Tomcat 7.x Remote Redeploying [C:\Users\Franz.jenkins\workspace\Argentum-web\target\argentum-web.war] Undeploying [C:\Users\Franz.jenkins\workspace\Argentum-web\target\argentum-web.war] ERROR: Build step failed with exception org.codehaus.cargo.container.ContainerException: Failed to undeploy [C:\Users\Franz.jenkins\workspace\Argentum-web\target\argentum-web.war] at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:140) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:178) at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103) at hudson.FilePath.act(FilePath.java:996) at hudson.FilePath.act(FilePath.java:974) at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103) at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665) at hudson.model.Run.execute(Run.java:1745) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:401) Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unable to delete [C:\apache-tomcat-7.0.72\webapps\argentum-web]. The continued presence of this file may cause problems.

at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:480) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:420) at org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:62) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:130) ... 17 more org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unable to delete [C:\apache-tomcat-7.0.72\webapps\argentum-web]. The continued presence of this file may cause problems.

at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:480) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:420) at org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:62) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:130) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:178) at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103) at hudson.FilePath.act(FilePath.java:996) at hudson.FilePath.act(FilePath.java:974) at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103) at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665) at hudson.model.Run.execute(Run.java:1745) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:401) Build step 'Deploy war/ear to a container' marked build as failure Finished: FAILURE

3 respostas
solução!

Oi André, tudo bom?

Dei uma pesquisada e me parece que isso é um problema relacionado a lock de arquivos feito pelo Windows. Para arrumar isso adicione

<Context antiResourceLocking="true">

ao context.xml

Para se informar melhor sobre essa treta dá uma olhada aqui: https://confluence.atlassian.com/bamkb/deploying-artifacts-to-tomcat-will-sometimes-fail-on-due-to-file-locking-397083103.html

Se não rolar me fala.

Abs, Romulo.

Oi André, e aí funcionou?

Eu vou marcar essa thread como finalizada, mas se o problema persistir vc pode lançar aqui, ok?

Abs, Romulo.

Tive o mesmo problema, estou usando o Windows. Deu Certo! Acertou na mosca Rômulo!