tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clay McCoy <>
Subject Getting 404's on embedded Tomcat.
Date Fri, 18 Dec 2009 23:39:32 GMT
OS X 10.6.2, Java 1.6.0_17, tomcat 6.0.18

I've spent hours researching how to configure embedded Tomcat.  It starts up fine, Spring
config works, but I get 404's when loading the jsps ( http://localhost:8080/App/test.jsp)
.  I have the code that I am using to start Tomcat here:

There is a directory generated from where I run the above script. (work/localEngine/localhost/App)
 but nothing gets copied there.  Are my JSPs supposed to end up there?
There are no errors on the console and no log files.
If I use a context that really doesn't exist I get a blank screen rather than a 404. ( http://localhost:8080/App1234/test.jsp)

I suspect that my configuration is wrong because I am making a lot of guesses. All I can find
is the api docs and some broken examples.  Can anyone explain or point me to better documentation?
I have some specific questions:

I'm pretty sure what I am passing to creatHost is wrong.
Embedded.createHost(...) requires an appBase - "Absolute pathname to the application base
directory for this virtual host." What is my appBase?
My project is a typical Maven project with a Web module.

Do I need Catalina_Home setup programatically or otherwise?  I have no Tomcat actually installed.
 I only reference Tomcat in my Maven pom.
Do I need a sever.xml somewhere.  Currently I just have a web.xml.

The best information that I have found is these examples:  (I'm using the same Maven
pom dependencies)
And the apis:,
int, boolean)

I've seen this question asked many times without answers.<>

Here a guy in the comments shows his emedded startup code,
 He says"The bit about the default web.xml is to get the standard behaviors you'd expect from
Tomcat, like processing JSPs. "  Why did he need to resort to this to get his jsps to work?

Thanks in advance for any help!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message