Results 1 to 9 of 9
  1. #1
    pan
    pan is offline Member
    Join Date
    Oct 2009
    Posts
    5
    Rep Power
    0

    Default problem in deploying WAR file in server

    Hi,

    I want to deploy my website in the server. When I create WAR file and deploy in the localhost it works fine. But the same WAR file does not run in Tomcat server.
    I try to access it like

    in local server:

    "...//localhost:8080/myApp/index.html"

    it works fine

    but in webhosting server:

    "....mysite.com/myApp/index.html"

    it gives me 404 error.

    I deployed the WAR file inside 'www' folder.

    The Tomcat version in 5.5.28 in local system and 5.5.20 in the server. JVM version is same in both.
    Please help me out.

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Ask the webhost provider for the instructions on how to deploy your app on their server.

  3. #3
    pan
    pan is offline Member
    Join Date
    Oct 2009
    Posts
    5
    Rep Power
    0

    Default

    Hi r035198x,

    Thanks for the swift response.

    I tried that option. I talked with them several times. They have restarted tomcat for multiple times. Now they are saying there is nothing to do from their side. The problem has to be sorted out by the developer. In their term the error is happening because of the "Servlet package is not resolving on the server". I did not quite understand this term.
    Is there any particular difference between the deployment in localhost server and production server?

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    What kind of server are they running? The servlet packages should already be available on tomcat.

  5. #5
    pan
    pan is offline Member
    Join Date
    Oct 2009
    Posts
    5
    Rep Power
    0

    Default

    They are running Apache Server with Tomcat 5.5.20. Though, I have put servlet-api.jar in my 'WEB-INF/lib'.

  6. #6
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    844
    Rep Power
    6

    Default

    just ask them the folder structure and check web.xml is properly placed.
    Ramya:cool:

  7. #7
    pan
    pan is offline Member
    Join Date
    Oct 2009
    Posts
    5
    Rep Power
    0

    Default

    Hi Ramya,

    Thanks for the response,

    'www' is the default package provided by the web-hosting where i should put all my files.
    I tried putting my 'index.html' just inside the 'www'. And accessed it successfully with the url '...//mysitename.com/index.html' not '...//mysitename.com/www/index.html' (accessing it this way does not solve my problem). If i put my 'index.html' outside 'www' folder, server can't identify that.

    So it proves that 'www' is the root folder for me.

    but if i create a WAR i.e. myApp.war and put inside 'www' folder, then server expand in such a manner that a folder named 'myApp' gets created inside 'www' folder, and all my files inside 'myApp' folder.

    Now

    '...//mysitename.com/index.html'
    '...//mysitename.com/myApp/index.html'
    '...//mysitename.com/www/index.html'
    '...//mysitename.com/www/myApp/index.html'

    none of them works.

    Now if i place the 'myApp.war' outside 'www' folder, then after expansion by the server 'myApp' folder gets created outside 'www' and there is nothing inside 'www'. So nothing can be accessed.

    in all the cases my 'web.xml' resides in 'myApp/WEB-INF/'.

  8. #8
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Don't put any servlet api jars in your application's WEB-INF. As I said already, tomcat already has them.

  9. #9
    pan
    pan is offline Member
    Join Date
    Oct 2009
    Posts
    5
    Rep Power
    0

    Default

    Hi,

    I got a solution of the problem. After expanding the WAR file, server creates folder 'myApp' and place my entire application inside it.

    So I took out all the contents from 'myApp' folder and placed it out in the root (i.e. in my case 'www' folder).

    Then

    '...//mysitename.com/index.html'

    worked fine.

    Thanks for all the suggestions.

Similar Threads

  1. Problem deploying applet to browser
    By nfteodoro in forum Java Applets
    Replies: 4
    Last Post: 09-25-2009, 11:03 AM
  2. Replies: 2
    Last Post: 02-21-2009, 04:36 AM
  3. Deploying a java application on an web or appp server.
    By CharanZ in forum Advanced Java
    Replies: 1
    Last Post: 10-29-2008, 11:45 PM
  4. (Server)Socket application deploying
    By mdinant in forum Networking
    Replies: 0
    Last Post: 04-09-2008, 06:10 PM
  5. Having problem hot-deploying JSP's
    By kurt_cobain in forum Eclipse
    Replies: 0
    Last Post: 04-03-2008, 06:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •