• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

where is my webapp?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello-
I am a newbie when it comes to Tomcat.
I've downloaded it and edited my batch files (startup.bat, catalina.bat, shutdown.bat and setclasspath.bat) so that I am able to start and stop tomcat.
I created a .war file in eclipse using ant and load into firefox this url:

I get the following:
OK - Started application at context path /mywebapp
But I don't see my web app! Apparently it's started but where is it?
Can anyone help me on this? I would be grateful for any clues.
Thanks.
-G
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you use a browser to try and see it?
 
Reginald Carter
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes
In firefox's address bar I put:
http://localhost:8080/manager/start?path=/mywebapp
and then I got
OK - Started application at context path /mywebapp
-R
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And so then you entered the URL for the web app and what happened?
 
Reginald Carter
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm obviously missing something here..
Would the URL for the web app be the path to the .war file?
-R
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It already told you:

OK - Started application at context path /mywebapp

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please check where exactly the .war file is located. You can see the instance and properties from User Interface.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The war file is immaterial -- it's the context path that forms the address of the application.
 
Reginald Carter
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK My context.xml:

When I look at the folder:C:/MyWebApp
I don't see any URL!
-R
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<Context path="C:/MyWebApp" docBase="../../MyWebApp"




Remove the "C:" from the context path, what's that doing there? Also, the relative path "../.." not a good idea. Put the absolute file path.

Then:


 
Reginald Carter
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for all your help.
I know how frustrating it can be.
I think I'm just going to start over.
-R
 
Reginald Carter
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK Now when I enter:
http:/localhost:8080/mywebapp
I get

What to do now?
-R
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you still getting the correct startup message? How did you change the context xml file? Is there an index.html or index.jsp file in the root folder?

You're not giving us much help in helping you.
 
Reginald Carter
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry.
I edited my context.xml like so:

I am still getting the same startup message.
In the folder C:/MyWebApp are all the files the eclipse project needs to run the program plus the WAR file and context.xml as well.
-R
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you trying to run this in eclipse or as standalone Tomcat?
 
Reginald Carter
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to use tomcat, but since the war file contains classes which need some of the files in the root folder of my eclipse project I thought I should do everything from there. Is this not a good idea?
I admit its confusing.
Maybe I should copy the war file to the tomcat directory and try to do it from there?
I don't know I am really confused at this point.
-R
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are trying to run a real application -- one that's not dependent upon an IDE -- then there can be no dependencies to things in the IDE. Sounds like your problem is that you are straddling the fence and getting your britches caught up in the barbed witre.

Either use the IDE to run the app, or create a self-contained, real web application that can run outside the IDE. There is no middle ground.
 
Reginald Carter
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well shoot-Y'all wouldn't happen t' have a pair of war cutters on ya wouldja pilgrim?
Seriously though, since until two days ago I thought tomcat referred to a feline of the male gender, I don't know how to create
a "real" web app using tomcat.
Do you know of any tutorials that I could read?
Maybe a good primer?
Also I'm not really using the IDE for this, only to generate the WAR file.
Hopefully the class files I have can still be used?
Anyways thanks for your efforts to help me.
I really do appreciate it.
-R.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As long as the war file is correctly structured and all jar files needed are in WEB-INF/lib (except for those provided by Tomcat itself), it should work fine.

The Tomcat docs spell out what's required, as does the Servlet Specification, or any tutorial or book on JSP/servlets.

Of particular note. Make sure that you have a WEB-INF, which contains the web.xml. And a WEB-INF/lib that contains the referenced jar files.

If you have any loose class files, they need to be in the package hierarchy under WEB-INF/classes.

Do you get any errors in the logs when you start the app up? What does the manager app at /manager/html have to say?
 
Reginald Carter
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello-
Would that be
C:\tomcat\server\webapps\host-manager\WEB-INF
or
C:\tomcat\server\webapps\manager\WEB-INF
or
C:\tomcat\webapps\balancer\WEB-INF
or
C:\tomcat\webapps\ROOT\WEB-INF
or
C:\tomcat\webapps\servlets-examples\WEB-INF
or
C:\tomcat\webapps\webdav\WEB-INF
??
You see when you say

and all jar files needed are in WEB-INF/lib


My head starts to spin.
Where should my files go?
-R

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic