facebook

Very NOVICE question on deploying WAR

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #242065 Reply

    Jeff Brewer
    Member

    I’ve got an embarrassingly simple question…

    I’ve got a domain, call it http://www.mydomain.com, hosted on godaddy.com running tomcat 5 and I’m using MyEclipse to build a JSF project. My Eclipse project name is mydomain. I can deploy my project to my local server (also tomcat 5) and I can see it if I open up a browser and go to “http://localhost/mydomain/index.faces” and it all works fine.

    I then created a war file, mydomain.war and uploaded it to the root directory of my web host. After a few minutes it exploded the directory and I ended up with all my files in a subdirectory named mydomain.

    If I open up a browser and go to http://www.mydomain.com/index.faces I get a file can’t be found error, but if I go to http://www.mydomain.com/mydomain/index.faces everything works fine.

    So my horribly embarrassing question is, how do I deploy my project to my web host so that my files end up in the ?root? directory instead of a sub-directory?

    Thanks to all with the patience to help me out!

    #242069 Reply

    Scott Anderson
    Participant

    For Tomcat, you need to right-click on your web project in the project explorer and select MyEclipse-Web. Set the Web Context-root parameter to ROOT. That will cause the deployer to install the application as the root application on Tomcat 5.

    #242083 Reply

    Jeff Brewer
    Member

    Thank you for replying.

    I tried that, and tried on variation of that, but neither worked. When I changed it to ROOT and uploaded the war, it exploded the war in a subdirectory called ROOT but I could not access anything, i.e. when I go to http://www.myweb.com I get a “can’t browse directory error” and when I go to http://www.myweb.com/ROOT I get a blank page.

    It doesn’t seem to matter what I do, every time I upload a WAR file it creates a subdirectory with the same name as the WAR file and explodes the files into that subdirectory. I think I need it to explode into the same directory where I upload the WAR file, but it won’t.

    #242086 Reply

    Scott Anderson
    Participant

    when I go to http://www.myweb.com I get a “can’t browse directory error”

    That’s because you didn’t provide an index.html file in your web application or specify the welcome page in your web.xml file. The browser needs to know what page to load by default when you go to http://www.myweb.com and unless you tell it differently it will try index.html. If that’s not there it will provide a directory listing if permitted, which generally Apache is configured to deny.

    #242089 Reply

    Jeff Brewer
    Member

    Thanks for the help.

    I guess my problem is that I’m thinking there ought to be some way to deploy a WAR file and have it expand in the root directory and it’s becoming increasingly obvious that this can’t be done.

    As far as I can tell, WAR files always deploy to sub-directories of the same name as the WAR file, so there’s no way to put an index.html page or a web-inf directory structure (and all those associated files, classes, libraries, etc.) into a WAR file and have it expand into the root directory. It seems like somehow I’d have to get the WAR file deployed to the parent directory of the root directory in order to get it to expand into the root directory, but neither of my tomcat accounts gives me access to anything above the root directory, so I’m not sure how people do that.

    #242145 Reply

    Scott Anderson
    Participant

    I guess my problem is that I’m thinking there ought to be some way to deploy a WAR file and have it expand in the root directory and it’s becoming increasingly obvious that this can’t be done.

    For Tomcat, the root application is installed in a direectory named ROOT, not in the ‘root’ directory as you seem to be trying to do. Actually it seemed your app was working fine in your third post, except that you hadn’t told Tomcat what the default page was supposed to be.

    If you’re determined to deploy is some other location, however, you have full control of that if you use the Custom Deployment locations rather than the specific server targets. With a custom location you’ll be able to place your application wherever you like. However, this likely isn’t your problem.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Very NOVICE question on deploying WAR

You must be logged in to post in the forum log in