无法使用jenkins在tomcat中成功部署war文件

时间:2014-08-29 03:02:52

标签: tomcat grails jenkins

我在通过tomcat 7.0.39访问的服务器中安装了https。我已成功部署并正在访问jenkins v1.575。我正在使用SVN for jenkins来检查我的grails项目的最新副本,在tomcat运行的服务器上构建和部署它。我还安装了Deploy Plugin,以便jenkins可以在容器中部署war文件。

以下是构建后的操作:

enter image description here

创建新版本是成功的,但每当jenkins尝试部署其构建的war文件时,我都会收到此错误。

|Done creating WAR target/doe-lubes-0.1.war
Deploying /var/www/tomcat/.jenkins/jobs/doe-lubes/workspace/target/doe-lubes-0.1.war to container Tomcat 7.x Remote
ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [/var/www/tomcat/.jenkins/jobs/doe-lubes/workspace/target/doe-lubes-0.1.war]
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:193)
    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:922)
    at hudson.FilePath.act(FilePath.java:895)
    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:772)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:736)
    at hudson.model.Build$BuildExecution.post2(Build.java:183)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:685)
    at hudson.model.Run.execute(Run.java:1765)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:234)
Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present
    at sun.security.ssl.Alerts.getSSLException(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
    at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
    at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
    at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
    at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
    at sun.security.ssl.Handshaker.processLoop(Unknown Source)
    at sun.security.ssl.Handshaker.process_record(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:534)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)

由于我还是詹金斯的新手,我找不到合适的解决方案和演练。我可以手动在tomcat中成功部署war文件,但是使用jenkins,我不能。 我需要配置什么来解决这个问题?

感谢。

2 个答案:

答案 0 :(得分:0)

您的问题似乎与此link中所述的SSL证书有关。解决它的方法取决于您是使用Java keytool还是OpenSSL来生成证书。

建议在生成证书时使用-ext选项。 最好使用主机名而不是IP

要使用 keytool 生成证书,您可以使用this链接。对于OpenSSL,您必须对openssl.cnf目录中的/etc/ssl文件进行更改。

答案 1 :(得分:0)

将tomcat URL从https更改为http将解决此问题。我猜你的tomcat服务器实际上并没有在https中运行。