0

I've got bitnami tomcat installed on Amazon EC2. And I have 2 .war files, the old.war and new.war one, there're generated from the same web app, but the 2nd one is supposed to work more properly, or rather, accurately. Also the 2nd one is generated by myself (jar -cvf my_new.war *) and I have the its sources whereas the 1st by someone else.

I put them in /opt/bitnami/apache-tomcat/webapps. The 1st one is working well, at least in the sense that the webapp gets accessible from the internet at http://ec2-xx-xx-xx-xx.us-west-1.compute.amazonaws.com/old/, unlike the new one which always returns this at http://ec2-xx-xx-xx-xx.us-west-1.compute.amazonaws.com/new/:

enter image description here

To recap: At EC2 I deploy them the exact same way. Maybe I don't generate the new.war properly?

What could be the reason? P.S.

One of the logs say this

Sep 28, 2015 4:41:19 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
Sep 28, 2015 4:41:19 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
Sep 28, 2015 4:41:45 AM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet myAppServet as unavailable
Sep 28, 2015 4:41:45 AM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet [myAppServet] in web application [/my_app] threw load() exception
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
  at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1858)
  at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1709)
  at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506)
  at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488)
  at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115)
  at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1148)
  at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
  at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5253)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5543)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
  at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1095)
  at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1930)
  at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
  at java.util.concurrent.FutureTask.run(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)

Sep 28, 2015 4:41:46 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Sep 28, 2015 4:41:46 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Sep 28, 2015 4:41:46 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@528a709d')

I've changed the original name to my_app in this log. Why isn't it found? What exactly not found?

4
  • what do the logs say? Commented Sep 28, 2015 at 2:48
  • @Kishore, which one? There're a few. Commented Sep 28, 2015 at 2:49
  • I think catalina.out file under $TOMCAT_HOME/logs/. More on that is here - wiki.apache.org/tomcat/FAQ/Logging Commented Sep 28, 2015 at 2:52
  • 1
    From logs in looks like app is not able to get required Spring Jars. stackoverflow.com/questions/11227395/… might help. Commented Sep 28, 2015 at 7:17

1 Answer 1

1

Since I don't have enough reputation yet to put a comment, I'll say this here. One possible reason is that your WAR file wasn't exploded (extracted). Can you check if your webapps/ directory has webapps/new/ directory? If not one thing to try is restart Tomcat.

Also, it's better if you use Tomcat manager when deploying WARs and not copying them manually to the webapps directory. That will ensure that WAR files are exploded. If it fails, you'll get an error message right away. Usually the manager app is accessible via http://localhost:8080/manager in a local installation of Tomcat, so most likely it's in http://ec2-xx-xx-xx-xx.us-west-1.compute.amazonaws.com/manager in your case.

Sign up to request clarification or add additional context in comments.

3 Comments

the manager asks for me the credentials. which credentials? from my amazon account? they're not working.
Did you set it when you installed tomcat? Are you using tomcat 7? The credentials are set in a configuration file (<TOMCAT_HOME>/conf/tomcat-users.xml). See mkyong.com/tomcat/tomcat-default-administrator-password - it needs to have something like this: <user username="admin" password="yourpassword" roles="admin,manager"/>
Btw, I just read your updates on your question. Seeing the stack trace, this seems to be the case of missing dependencies. Are you using Maven? If not, you should include the JAR files in the packaged WAR. Take a look at this thread: stackoverflow.com/questions/17381026/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.