Can anyone help me debug this problem? I am trying to push a Tomcat application, but it always fails and without any helpful error message (nor in cf logs). The application is rather large (6 MB war file), with the following components: an index.jsp main page, Dojo 1.6.1, a css, a custom Javascript library, and server-side Java that reads several configuration files (using getResourceAsStream). I deploy the app's war file using cf -push. It runs fine when I deploy to my local Windows Tomcat server, and previous versions have run fine on AIX. I have not created any special configuration files to tell Bluemix how to run or start it. I also tried the Liberty buildpack, but I got a different error with that one (a JSON exception). Could it be taking too long to start? Could it be the Java version? (I test with Java 1.6)
-----> Downloaded app package (6.5M) Initialized empty Git repository in /tmp/buildpacks/java-buildpack/.git/ -----> Java Buildpack source: https://github.com/cloudfoundry/java-buildpack.git#5051406e1332be58359c8d4c24b27f134403b459 -----> Downloading Open Jdk JRE 1.7.0_51 from http://d2vm4m9hl67ira.cloudfront.net/openjdk/lucid/x86_64/openjdk-1.7.0_51.tar.gz (1.0s) Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.5s) -----> Downloading Tomcat Instance 7.0.52 from http://d2vm4m9hl67ira.cloudfront.net/tomcat/tomcat-7.0.52.tar.gz (0.5s) Expanding Tomcat to .java-buildpack/tomcat (0.1s) -----> Downloading Tomcat Lifecycle Support 2.1.0_RELEASE from http://d2vm4m9hl67ira.cloudfront.net/tomcat-lifecycle-support/tomcat-lifecycle-support-2.1.0_RELEASE.jar (0.0s) -----> Downloading Tomcat Logging Support 2.1.0_RELEASE from http://d2vm4m9hl67ira.cloudfront.net/tomcat-logging-support/tomcat-logging-support-2.1.0_RELEASE.jar (0.0s) -----> Uploading droplet (45M)
0 of 1 instances running, 1 starting 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 failing FAILED Start unsuccessful
6MB is not a large war.
You should have been given instructions to execute "cf logs appname --recent" to see the log output from the failure. Did it give any indication of what went wrong? Can you include that information here?
Answer by 81X1_Doug_Billings (16) | Mar 18, 2014 at 09:35 PM
Problem solved. I was using cf 6.0.1, and it turns out 6.0.2 works just fine. Luckily someone had a hunch, and that was it.
There was a defect in the cf command line in earlier versions, causing corruptions of files that were deployed from Windows. It sounds like that was the cause of your troubles. Good to hear that the updated CLI version helped. Here is a link for anyone seeking that: https://github.com/cloudfoundry/cli
wow this was a tough one to debug. I guess the way to debug this is to do some sort of digest comparison of the files on local client and CF. Perhaps enable trace logging for the cli would have alerted us.
I set cf_trace=TRUE because I read somewhere that turned on trace, but later I found out that instead, that wrote the trace to a file named "TRUE". I didn't see that until much later. The file was quite large, 7 MB and 27,000 lines, but you would have seen the cf version right at the top, anyway.
Answer by R8NW_chuan_ran (11) | Mar 16, 2014 at 03:04 AM
Not sure if this is caused by you have not assigned the start command. Anyway, could you have a try with "cf push --command start_point"?
What is the start command or start point? I tried the application's main page (index.jsp) in various formats, but that didn't help. I don't believe I need to provide the command to start Tomcat, right?
Yes, it is supposed that no start command is need for starting Tomcat.
I had a try with a sample Tomcat application, with a "hello.jsp", index.html, and WEB-INFO directory which contains compiled .class file and a "web.xml" file.
Do you have a similar web.xml file in your application?
Answer by Denilson Nastacio (91) | Mar 17, 2014 at 08:02 AM
Can you export CF_TRACE=true in the OS shell before running the CF push? It will produce detailed trace messages and likely will indicate the root cause for the problem.
Additional question is whether this application successfully starts on a local Tomcat instance.
Answer by Rohit Kelapure (1001) | Mar 17, 2014 at 02:44 PM
Can you upload the app or the output from cf logs appname --recent.
Still no luck. I deployed it to Windows Tomcat just fine, and then pushed the same war file. Liberty gets further, it starts the app, but then I get a class not found error. Let me see if that helps.
Output with CF_TRACE:
-----> Downloaded app package (6.5M) -----> Downloaded app buildpack cache (41M) Initialized empty Git repository in /tmp/buildpacks/java-buildpack/.git/ -----> Java Buildpack source: https://github.com/cloudfoundry/java-buildpack.git
-----> Downloading Open Jdk JRE 1.7.0_51 from http://d2vm4m9hl67ira.cloudfront.n et/openjdk/lucid/x86_64/openjdk-1.7.0_51.tar.gz (0.0s) Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.5s) -----> Downloading Tomcat Instance 7.0.52 from http://d2vm4m9hl67ira.cloudfront. net/tomcat/tomcat-7.0.52.tar.gz (0.2s) Expanding Tomcat to .java-buildpack/tomcat (0.1s) -----> Downloading Tomcat Lifecycle Support 2.1.0_RELEASE from http://d2vm4m9hl6 7ira.cloudfront.net/tomcat-lifecycle-support/tomcat-lifecycle-support-2.1.0_RELE ASE.jar (0.0s) -----> Downloading Tomcat Logging Support 2.1.0_RELEASE from http://d2vm4m9hl67i ra.cloudfront.net/tomcat-logging-support/tomcat-logging-support-2.1.0_RELEASE.ja r (0.0s) -----> Uploading droplet (45M)
0 of 1 instances running, 1 starting 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 down 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 failing FAILED Start unsuccessful
logs:
2014-03-17T20:40:37.70-0400 [STG] OUT -----> Downloading Tomcat Instance 7.0 .52 from http://d2vm4m9hl67ira.cloudfront.net/tomcat/tomcat-7.0.52.tar.gz (0.2s)
2014-03-17T20:40:37.70-0400 [STG] OUT Expanding Tomcat to .java-build pack/tomcat (0.1s) 2014-03-17T20:40:37.70-0400 [STG] OUT -----> Downloading Tomcat Lifecycle Su pport 2.1.0_RELEASE from http://d2vm4m9hl67ira.cloudfront.net/tomcat-lifecycle-s upport/tomcat-lifecycle-support-2.1.0_RELEASE.jar (0.0s) 2014-03-17T20:40:37.70-0400 [STG] OUT -----> Downloading Tomcat Logging Supp ort 2.1.0_RELEASE from http://d2vm4m9hl67ira.cloudfront.net/tomcat-logging-suppo rt/tomcat-logging-support-2.1.0_RELEASE.jar (0.0s) 2014-03-17T20:40:48.07-0400 [STG] OUT -----> Uploading droplet (45M) 2014-03-17T20:40:57.89-0400 [DEA] OUT Registering instance 2014-03-17T20:41:24.78-0400 [DEA] OUT Registering instance
events:
2014-03-17T20:40:25.00-0400 app.crash index: 0, reason: CRASHED, exit _description: app instance exited, exit_status: 148 2014-03-17T20:40:34.00-0400 app.crash index: 0, reason: CRASHED, exit _description: app instance exited, exit_status: 148 2014-03-17T20:41:38.00-0400 app.crash index: 0, reason: CRASHED, exit _description: app instance exited, exit_status: 148