0
votes

I have tomcat 7.0.39 installed in a server accessed via https. I have successfully deployed and currently accessing jenkins v1.575. I am using SVN for jenkins to checkout the latest copy of my grails project, build and deploy it in the server where tomcat is also running. I have also installed the Deploy Plugin to make it possible for jenkins to deploy war file in a container.

Below is the Post-build actions:

enter image description here

Creating a new build was successful, but whenever jenkins is trying to deploy its built war file, I am getting this error.

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

I cant find the right solution and walkthrough for this since I am still new to jenkins. I can successfully deploy war files in tomcat manually, but using jenkins, I can't. What do I need to configure to fix this?

thanks.

2
Did you try out the suggestion?Technext

2 Answers

0
votes

Your issue seems to be related to SSL certificate as stated in this link. Approach to resolving it depends on whether you're using Java keytool or OpenSSL for generating certificate.

It suggests using -ext option while generating certificate. Preferably, you should be using Hostname instead of IP.

For certificate generation using keytool, you can use this link. For OpenSSL, you will have to make changes to openssl.cnf file which is usually present in /etc/ssl directory.

0
votes

Changing your tomcat URL from https to http will fix this problem. I guess your tomcat server isn't really running in https.