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

estou com o seguinte problema no tomcat

ERROR: Build step failed with exception org.codehaus.cargo.container.ContainerException: Failed to undeploy [C:\Users\Pupilo.jenkins\workspace\argentum-web\target\argentum-web.war] at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:136) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:173) at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:81) at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167) at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136) at hudson.FilePath.act(FilePath.java:1075) at hudson.FilePath.act(FilePath.java:1058) at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133) at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95) at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113) at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:112) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690) at hudson.model.Build$BuildExecution.post2(Build.java:186) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635) at hudson.model.Run.execute(Run.java:1905) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:428) Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The Tomcat Manager responded "FAIL - Unable to delete [C:\Users\Pupilo\tomcat\apache-tomcat-7.0.104\webapps\argentum-web]. The continued presence of this file may cause problems. " instead of the expected "OK" message

9 respostas

ele não está fazendo o deploy

Olá Alessandro, tudo bem? Seu problema parece ser o mesmo de um outro colega, o Renato, e eu indiquei uma solução que resolveu o problema dele nesse outro tópico você poderia dar uma olhada nele, caso o erro permaneça então comenta aqui pra eu ti ajudar.

Outra coisa, talvez você possa ter algum problema com o SonarQube como você está no Windows, então esse outro tópico vai ti ajudar também.

Espero ter ajudado!

mesmo com as variáveis de ambiente configuradas e o sonar-scanner.properties está dando error, se puder passar as configurações das variaveis de ambiente para comparar com as minhas

[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 FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 20.470 s [INFO] Finished at: 2020-06-29T09:02:08-03:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.19.1:verify (default) on project argentum-web: There are test failures. [ERROR] [ERROR] Please refer to C:\Users\Pupilo.jenkins\workspace\argentum-web\target\surefire-reports for the individual test results. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException Build step 'Chamar alvos Maven de alto nível' marked build as failure WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeeded? [DeployPublisher][INFO] Build failed, project not deployed

Alessandro, eu não tenho essas mesmas variáveis de ambiente, porque utilizo o Ubuntu 18.04, e tudo unica variável de ambiente que utilizei foi a do java, que você já fez, então você fez o procedimento que eu indiquei nesse tópico?

O procedimento é:

Você consegue acessar a interface gráfica do SonarQube usando a URL http://localhost:9000 no navegador? Como na imagem:

SonarQube painel

Se você consegue acessar , então faz o seguinte, pare o SonarQube, e depois exclua a pasta dele no disco C:\ e depois exclua também a pasta .sonar que fica em: C:\Users*SEU_USUÁRIO*.sonar.

Depois faça novamente o processo de instalação do SonarQube:

Crie uma pasta com o nome sonarqube dentro do disco local "C:" e descompacte o arquivo baixado dentro dessa pasta C:\sonarqube. Agora você deve ir na pasta bin (dentro de C:\sonarqube), e entrar na pasta correspondente ao seu sistema operacional:

Entre na pasta windows-x86-32 caso seu sistema seja de 32bits.

Ou então entre pasta windows-x86-64 caso seu sistema seja de 64bits.

E por fim execute o arquivo StartSonar.bat. E depois tente realizar o Build novamente.

Outra coisa, esse é o log completo do Jenkins? Poderia colocar ele em um bloco de código (basta clicar no botão INSERIR CÓDIGO aqui no fórum) assim vai ficar mais fácil pra gente verificar.

problema acho que está em outro lugar essa e a url da classe https://github.com/alura-cursos/argentum-web/blob/master/src/test/java/br/com/caelum/argentum/bean/FiltraNegociacoesIT.java

e a parte de build minha está assim clean verify sonar:sonar -Ptestes-integracao -Dphantomjs.binary.path=/Users/Pupilo/phantomjs/phantomjs-2.1.1-windows/bin/phantomjs

Results :

Tests in error: 
  FiltraNegociacoesIT.iniciaNavegador:63->iniciaPhantomJs:137 » IllegalState The...

Tests run: 1, Failures: 0, Errors: 1, 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] ------------------------------------------------------------------------
[INFO] Skipping argentum-web
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  27.601 s
[INFO] Finished at: 2020-06-30T08:36:27-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.19.1:verify (default) on project argentum-web: There are test failures.
[ERROR] 
[ERROR] Please refer to C:\Users\Pupilo\.jenkins\workspace\argentum-web\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Build step 'Chamar alvos Maven de alto nível' marked build as failure
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeeded?
[DeployPublisher][INFO] Build failed, project not deployed
Finished: FAILURE

Na verdade Alessandro esse é o mesmo problema que o Thiago também passou nesse outro tópico, você só precisa adicionar o executável, pelo que vi você só indicou a pasta bin/phantomjs mas precisamos informar o arquivo com a extensão .exe da seguinte forma:

clean verify -Ptestes-integracao -Dphantomjs.binary.path=/Users/Pupilo/phantomjs/phantomjs-2.1.1-windows/bin/phantomjs.exe

Caso o problema persista você poderia informar o caminho usando a barra invertida ( \ ) da seguinte forma:

clean verify -Ptestes-integracao -Dphantomjs.binary.path=C:\Users\Pupilo\phantomjs\phantomjs-2.1.1-windows\bin\phantomjs.exe

E fala pra gente o resultado!

Deu certo a parte do phantom, porém está com o seguinte problema ainda

[DeployPublisher][INFO] Attempting to deploy 1 war file(s)
[DeployPublisher][INFO] Deploying C:\Users\Pupilo\.jenkins\workspace\argentum-web\target\argentum-web.war to container Tomcat 7.x Remote with context argentum-web
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\Users\Pupilo\.jenkins\workspace\argentum-web\target\argentum-web.war]
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:188)
    at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:81)
    at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167)
    at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136)
    at hudson.FilePath.act(FilePath.java:1075)
    at hudson.FilePath.act(FilePath.java:1058)
    at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133)
    at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95)
    at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113)
    at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:112)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
    at hudson.model.Build$BuildExecution.post2(Build.java:186)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
    at hudson.model.Run.execute(Run.java:1905)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:428)
Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.<init>(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:567)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:882)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:895)
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:169)
    ... 19 more
java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.<init>(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:567)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:882)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:895)
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:169)
    at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:81)
    at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167)
    at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136)
    at hudson.FilePath.act(FilePath.java:1075)
    at hudson.FilePath.act(FilePath.java:1058)
    at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133)
    at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95)
    at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113)
    at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:112)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
    at hudson.model.Build$BuildExecution.post2(Build.java:186)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
    at hudson.model.Run.execute(Run.java:1905)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:428)
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE
solução!

Que bom que deu certo a parte do phantom Alessandro! E bem os passos mudam um pouco no Windows, e por isso temos alguns problemas para ir contornando.

Agora sobre esse erro, o Tomcat está em execução? Para executar o Tomcat você precisa ir na pasta bin do Tomcat, no disco local "C" e executar o comando:

startup

Ou então usando .exe dentro da pasta bin:

Tomcat7.exe start

Onde o 7 é a versão do seu Tomcat.

Porque como é um erro de conexão (java.net.ConnectException: Connection refused: connect) pode ser isso, então verifica isso corretamente.