Tomcat immediately undeploys .war after a successful deploy to webapps directory - java-8

I have an Octopus deployment plan using the Tomcat Manager step to deploy a .war to a linux box's instance of Tomcat. The deployment seems to succeed, but Tomcat will immediately undeploy it, causing a cycle of deployment attempts until Octopus gives up and fails the deployment.
In my catalina.out log on the target linux box, I see this:
07-Mar-2018 21:16:46.084 INFO [http-nio-8080-exec-120] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /var/lib/tomcat8/webapps/myWebApp.war has finished in 118,532 ms
07-Mar-2018 21:16:56.355 INFO [http-nio-8080-exec-123] org.apache.catalina.startup.HostConfig.undeploy Undeploying context [/myWebApp]
There's 10 seconds in between deploying and undeploying. There's nothing in between these log lines to suggest why Tomcat decided to undeploy the webapps/myWebApp directory. What's strange is, after the final deployment attempt, the /myWebApp directory remains even though Octopus gives up and fails the deployment plan.
I'm wondering if anyone else has seen similar behavior while deploying .war files to Tomcat Manager, or if this behavior suggests a wonky config somewhere I don't know to look for.

Today I had the same problem. I tried to deploy a third application on Tomcat and got the same log output as above (yes, even with a ten to twelve second delay).
After hours I finally found the solution: My new application was developed with Java 11 but Tomcat still runs on Java 8.
I'm sure there must be any exception during deployment but it was not logged to catalina.out. Even in other log files I didn't find any clues.

Related

Time-out w/ Gradle deploy of Spring-based web application to WAS Liberty

I am trying to write a simple Spring-based web service to run on WAS Liberty 8.5.5.9. The application is a Gradle project, and I build and deploy the application with the command gradle clean build deploy. However, this fails with the following message:
[ant:deploy] CWWKM2006I: Deploying application .../userSetting.war to the dropins folder.
[ant:deploy] CWWKM2010I: Searching for CWWKZ0001I.*userSetting in
/home/lavin/WASLiberty/usr/servers/defaultServer/logs/messages.log.
This search will timeout after 30 seconds.
[ant:deploy] CWWKM2011E: Timed out searching for CWWKZ0001I.*userSetting in
/home/lavin/WASLiberty/usr/servers/defaultServer/logs/messages.log.
:deploy FAILED
I do see userSetting.war in the dropins/ folder, but I run into problems trying to start the application, so I assume the deployment is broken.
Can someone please explain what the problem is and how to fix?
The tooling here is waiting for up to 30 seconds to see the CWWKZ0001I message, which is the "application XYZ started" message ID. Since the build script did not find this message in 30 seconds, there are 2 possibilities:
The application failed to start (probably the case)
The application is taking longer than 30s to start (probably not the case, unless your .war application is massive)
I'll assume that the application simply failed to start, in which case you will want to check the server logs to figure out why the application failed to start. As the console indicates, the message.log can be found at /home/lavin/WASLiberty/usr/servers/defaultServer/logs/messages.log
On a side-note, Liberty 8.5.5.9 is rather old, and the Liberty team has made specific efforts to better support Spring applications since then. In particular, check out this blog post:
Open Liberty Spring Boot Starter
In case you haven't heard of OpenLiberty before, its an open-source subset of WAS Liberty (meaning anything that works on OpenLiberty will work on WAS Liberty).

IBM Websphere War Deployment Is Slow

We are deploying our application war [180 mb] to IBM Websphere admin 8.5.5.9. It takes around 30 min to deploy a war.
In Weblogic there is a option for deploying a war, that is we don't need deploy a war second time onwards, so we just replace the updated war in that path and it takes a war from that path second time. Like, Is there any option in websphere. Please help me to resolve this.
This page Options for accelerating application deployment gives you several options for accelerating deployments. Article is to big to quote it here.
As alternative you can also do partial updates if you only need to change several files.

Debugging 2 webapps in the same Tomcat

I'm looking for a way to deploy 2 different webapp projects (not opened in the same IntelliJ window). I have created 2 distinct debug configurations that both target the same tomcat which is run separately (i.e. it is not started via IntelliJ). However once one of the 2 applications is deployed in debug mode it seems that it hogs the debugging port and the other one might deploy successfully but it is impossible to debug it. I also tried with shared memory and I tried to connect 2 remote debug configurations which also resulted in a failure. I even tried to deploy both applications from one Debug configuration inside IntelliJ and remotely connect the debugger of one of the applications from another instance of IntelliJ and it still fails.
What is the correct way to debug 2 distinct webapps that are deployed under the same tomcat server?

Jboss deploying a ear and war file in the same server instance

Is it possible in Jboss deploying a ear and war file in the same server instance? If so any good source to get started? Any suggestion.
I have two applications deployed under my default deploy folder of jboss. I am running one application from which i have to call the other application to get some data. Is this possible? If so how to get started??
It is actually recommended that you only put 1 application in a server instance as a time. That said, I have had multiple ears and wars running in the same instance while I am developing. But for production it is better to separate them out. Since there is no extra cost involved this makes it easier to observe and debug apps.
Do you have a specific reason for wanting them to run side by side?
What version of JBoss are you running.

App hangs on --> 'Initializing Spring root WebApplicationContext' on websphere

When I try to deploy the app ear through RSA on websphere, the deployment hangs on the following line:
Initializing Spring root WebApplicationContext.
Initialization successful.
And then server times out.
How can I troubleshoot this problem?
Which log should I see? The logs folder is rather confusing with too many files.
When I deploy the app through the admin console by building .ear first, it deploys fine.
I assume you are referring to publish the application within RSA/RAD. The logs are the same whether you deploy through this or via the admin console.
SystemOut, SystemErr and trace.logs would be my first points of check.
I am assuming your application spits out this info line:
Initializing Spring root WebApplicationContext. Initialization successful
When does it do this? This would likely occur after the application has been deployed and the application is in its starting phase.
I would check this location
/profiles//installedApps/
Replace all the <...> with the respective values in your environment.
Once deployment is successful you should see a directory with the name of your application eg.
This tells you that the application is installed in your Test environment server.
Publishing effectively does two activities - Install and Start the application.
Once you see the EAR here you know that your problem lies in your application start up activities.
Try and see if you can narrow down from there.
HTH
Manglu

Resources