tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clay McCoy <cmc...@acteksoft.com>
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:
http://gist.github.com/259737

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:
http://stackoverflow.com/questions/640022/howto-embed-tomcat-6  (I'm using the same Maven
pom dependencies)
http://raibledesigns.com/rd/entry/jetty_6_x_versus_tomcat
And the apis:
http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/startup/Embedded.html#createConnector(java.lang.String,
int, boolean)

I've seen this question asked many times without answers.
http://mail-archives.apache.org/mod_mbox/tomcat-users/200606.mbox/<448F0710.6010408@networkcar.com>

Here a guy in the comments shows his emedded startup code, http://raibledesigns.com/rd/entry/jetty_6_x_versus_tomcat
 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!
Clay


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message