Deploying war files in tomcat6

30,938

Solution 1

You'll need to use the "manager web-app" to deploy the war file.

  • First: create a manager user for tomcat6. Edit /var/lib/tomcat6/conf/tomcat-users.xml and add something like the following (remember to use a unique password):

    role rolename="admin"

    role rolename="manager"

    user username="admin" password="password" roles="admin,manager"

    (Note: look at the examples in /var/lib/tomcat6/conf/tomcat-users.xml. These lines are tags but I can't post tags on AskUbuntu :( Hopefully, it's not too confusing.)

  • Next: restart tomcat:

    $sudo /etc/init.d/tomcat6 restart

  • Finally, open http://localhost:8080/manager/html and log-in with the username and password that you just set. On the bottom of the page, there's a dialog box that lets you select and deploy a war file.

HTH

Solution 2

Sounds like your servlet context is having some trouble getting started. You might check this link and see if it helps: Debugging Severe Error: listenerStart

Share:
30,938

Related videos on Youtube

phwd
Author by

phwd

Updated on September 17, 2022

Comments

  • phwd
    phwd almost 2 years

    I am using tomcat5.5 for a long on Ubuntu servers 8.10 and 9.10 and /usr/share/tomcat/webapps/ is the path where I place my .war files and access them on the browser over network.

    On a sytem I've installed tomcat6 and I'm failing to find that where do I place my .war file of tomcat6's webapps. I checked deploying war under /var/lib/tomcat6/webapps/ and the war file is extracted and I think this should be the location but I could not access the page when I tried http://serverip:8080/myapp. I could access the default page properly when I navigate to http://serverip:8080. The same war file is working fine on tomcat servers which were not installed from apt repository.

    Log Messages:

    INFO: Stopping Coyote HTTP/1.1 on http-8080
    2 Dec, 2010 10:06:29 AM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    2 Dec, 2010 10:06:29 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 523 ms
    2 Dec, 2010 10:06:29 AM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    2 Dec, 2010 10:06:29 AM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
    2 Dec, 2010 10:06:30 AM org.apache.catalina.startup.HostConfig deployWAR
    INFO: Deploying web application archive myapp.war
    2 Dec, 2010 10:06:32 AM org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    2 Dec, 2010 10:06:32 AM org.apache.catalina.core.StandardContext start 
    SEVERE: Context [/myapp] startup failed due to previous errors
    2 Dec, 2010 10:06:32 AM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    2 Dec, 2010 10:06:32 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 3110 ms
    2 Dec, 2010 10:06:39 AM org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    2 Dec, 2010 10:06:39 AM org.apache.catalina.core.StandardContext start
    SEVERE: Context [/myapp] startup failed due to previous error
    

    Any help?

    • Michael Gundlach
      Michael Gundlach over 13 years
      On this system is there any other process or Daemon using port 8080? Like Apache, or Tomcat5? netstat -nta | grep LISTEN
    • phwd
      phwd over 13 years
      tcp6 0 0 :::8080 :::* LISTEN. This is listed only one time.
    • Michael Gundlach
      Michael Gundlach over 13 years
      @user3215 Please edit your question with the additional information, and with the output of sudo /etc/init.d/tomcat6 status Those two combined will help sort if possibly something else is listening on port 8080.
    • phwd
      phwd over 13 years
      /etc/init.d/tomcat6 status * Tomcat servlet engine is running with pid 1931. If any other services is running on 8080 I should not get the default tomcat6 page. I'm thinking what additional info. i can give you.
    • phwd
      phwd over 13 years
      I even tried changing the port number to 8088 but the result is same. My work is to just deploy the war under webapps and restart tomcat and it works but not working here for tomcat6. As I'm just a sys. analyst I'm failing to provide you with more info. that what that war file consists of.
    • phwd
      phwd over 13 years
      Googling, I heard saying that tomcat installed from apt repository does not work as intended. Is that true?
    • phwd
      phwd over 13 years
      @Juan: Are you placing war file under /var/lib/tomcat6/webapps
    • theTuxRacer
      theTuxRacer over 13 years
      @user3215 I have instaleld tomcat6 on debian, from the repo. and it works fine for me. I place the webapp in var/lib/tomcat6/webapps and navigating to IP:8080/WARname displays the webapp correctly, so I dont think it is an issue with tomcat being installed from the repo.
    • theTuxRacer
      theTuxRacer over 13 years
      also, it seems there is a missing jar, that needs to be on your classpath.
    • phwd
      phwd over 13 years
      @Kaustubh P: Yeah, I'm also getting the tomcat's default page, did you check placing war file under webapps and if it extracts and renders the page when pointed the browser to the ServerName of VirtualHost?
    • theTuxRacer
      theTuxRacer over 13 years
      Yes, the war is extracted, and deployed. Do you have correct read permissions? I am guessing it might, since you havent tinkered with them. Well, neither have I, I just used the default permissions.
  • phwd
    phwd over 13 years
    Following the link I could not figure out for myself yet.