Answers: <p>I realize it's because the link for tomcat I was deploying to was: <code>https://localhost:portNo</code>, instead of simply, <code>http://localhost:portNo</code></p>
  
Answers: CC BY-SA 4.0
Answers: 2019-11-11T15:11:15.267Z
Answers: 2019-11-11T15:21:18.707Z
Answers: 2019-11-11T15:21:18.707Z
Answers: mamajava
Body: <p>I've been attempting to <strong>build</strong> and <strong>deploy</strong> a local copy of a repository, whilst still providing the remote depository to Jenkins, to a Tomcat version 9 server.</p>
  
  <p>I have both Jenkins and Tomcat running on different ports. </p>
  
  <p>I did get a handful of successful builds and deployments but I found that when I would visit my successful deployments via the Tomcat server, any page other than the home page of the build had a 404 error.</p>
  
  <p>I thought it was because the dependencies were absent because it was using Jenkins workspace instead of the local repository on my device, so after switching directories, I relieved the following error:</p>
  
  <pre><code>[INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time:  10.906 s
  [INFO] Finished at: 2019-11-07T14:11:59-05:00
  [INFO] ------------------------------------------------------------------------
  [DeployPublisher][INFO] Attempting to deploy 1 war file(s)
  [DeployPublisher][INFO] Deploying C:\Users\(myusername)\Projects\ier_ui\target\derui.war to container Tomcat 9.x Remote with context derui
  ERROR: Build step failed with exception
  org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\Users\(myusername)\Projects\ier_ui\target\derui.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:1078)
      at hudson.FilePath.act(FilePath.java:1061)
      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 hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
      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:1840)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
  Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
      at sun.security.ssl.InputRecord.handleUnknownRecord(Unknown Source)
      at sun.security.ssl.InputRecord.read(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: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)
      ... 18 more
  javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
      at sun.security.ssl.InputRecord.handleUnknownRecord(Unknown Source)
      at sun.security.ssl.InputRecord.read(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: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:1078)
      at hudson.FilePath.act(FilePath.java:1061)
      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 hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
      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:1840)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
  Build step 'Deploy war/ear to a container' marked build as failure
  Finished: FAILURE
  </code></pre>
  
  <p>After struggling with this error for a couple days, I decided to completely delete and reinstall Jenkins and started from scratch. The reason I did this is because I wanted to get a successful build and start working from Jenkins Worksapce directory again, instead of my local repo, but even after the reinstall I have been getting the error which I thought was unique to me changing the workspace location.</p>
  
  <p>Any ideas what this might be due to? Perhaps access issues to the apache-tomcat folder? But even then, it was working before. Your insights would be highly appreciated.</p>
  
  <p>Just to be clear, I do provide the correct credentials for Tomcat and my git repository platform. This include <code>manager-gui</code> and <code>manager-script</code> roles.</p>
  
Tags: <jenkins><git><deployment><ssl><tomcat>
Title: Jenkins Deployment Issue - Unrecognized SSL Message, Plaintext Connection?
UserDisplayName: mamajava
ThreadText: # Jenkins Deployment Issue - Unrecognized SSL Message, Plaintext Connection?
  
  (Asked by: username_0 on 2019-11-11)
  
  I've been attempting to **build** and **deploy** a local copy of a repository, whilst still providing the remote depository to Jenkins, to a Tomcat version 9 server.
  
  I have both Jenkins and Tomcat running on different ports.
  
  I did get a handful of successful builds and deployments but I found that when I would visit my successful deployments via the Tomcat server, any page other than the home page of the build had a 404 error.
  
  I thought it was because the dependencies were absent because it was using Jenkins workspace instead of the local repository on my device, so after switching directories, I relieved the following error:
  
  ```
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time:  10.906 s
  [INFO] Finished at: 2019-11-07T14:11:59-05:00
  [INFO] ------------------------------------------------------------------------
  [DeployPublisher][INFO] Attempting to deploy 1 war file(s)
  [DeployPublisher][INFO] Deploying C:\Users\(myusername)\Projects\ier_ui\target\derui.war to container Tomcat 9.x Remote with context derui
  ERROR: Build step failed with exception
  org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\Users\(myusername)\Projects\ier_ui\target\derui.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:1078)
      at hudson.FilePath.act(FilePath.java:1061)
      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 hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
      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:1840)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
  Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
      at sun.security.ssl.InputRecord.handleUnknownRecord(Unknown Source)
      at sun.security.ssl.InputRecord.read(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: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)
      ... 18 more
  javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
      at sun.security.ssl.InputRecord.handleUnknownRecord(Unknown Source)
      at sun.security.ssl.InputRecord.read(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: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:1078)
      at hudson.FilePath.act(FilePath.java:1061)
      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 hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
      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:1840)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
  Build step 'Deploy war/ear to a container' marked build as failure
  Finished: FAILURE
  
  ```
  
  After struggling with this error for a couple days, I decided to completely delete and reinstall Jenkins and started from scratch. The reason I did this is because I wanted to get a successful build and start working from Jenkins Worksapce directory again, instead of my local repo, but even after the reinstall I have been getting the error which I thought was unique to me changing the workspace location.
  
  Any ideas what this might be due to? Perhaps access issues to the apache-tomcat folder? But even then, it was working before. Your insights would be highly appreciated.
  
  Just to be clear, I do provide the correct credentials for Tomcat and my git repository platform. This include `manager-gui` and `manager-script` roles.
  
  **Tags:** jenkins, git, deployment, ssl, tomcat
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-11-11. Score: 1 | Accepted answer
  
  I realize it's because the link for tomcat I was deploying to was: `https://localhost:portNo`, instead of simply, `http://localhost:portNo`
  
  
  ---
  
  