views:

1288

answers:

3

I have a spring web application which has been working fine on tomcat 5.5. I've attempted to deploy the same web app to a tomcat 6 container and come up against some issues.

The main two problems I've had are relating to configuring the container for jstl and getting the spring security login to work properly.

I believe I've solved the jstl configuration issue by including the jstl-1.2.jar lib from here in the $CATALINA_HOME/lib directory (although it really does appear to be strange that it is so difficult to find out how to get this working).

The main problem now is that when I attempt to log in using form based authentication, I get an HTTP 404 error when the login form is submitted to "j_spring_security_check".

I have set up the filter in the web.xml file as per the spring security documentation but it appears that tomcat isn't invoking this as expected.

I hope someone can share their experience here as I'm certainly missing something fundamental in my configuration.

Thanks.

Update: While trouble-shooting based on responses here, one of the things I ended up doing was downloading a fresh copy of tomcat 6.0.18 and ensured that I had the jstl-1.2.jar file in the WEB-INF/lib dir. Funnily enough, now the app seems to be working fine.

I'm a little stumped but I'll now try to track down the difference in the two tomcat installs that was causing the error and post a further update here.

Thanks for the responses to this guys.

+1  A: 

if you use maven, you need for jstl :

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
        <scope>runtime</scope>
    </dependency>
Michael Lange
+1  A: 

It's too hard to tell what's wrong, based on the information you provided.

Common shared libraries used to go in common/lib in Tomcat 5.x and earlier; now they belong in the /lib directory.

Personally, I prefer putting as much as I can in the WEB-INF/lib of my deployments, because I don't want to have to depend on having a server set up in a particular way. If the classloader can find all the JARs it needs in my WAR file, I'm happy.

Both Tomcat 5.x and 6.x use the JSTL version 1.2 JAR, so that's common. It's the location that's changed. I'd recommend building your WAR file with the JARs you need in WEB-INF/lib.

If you're using Spring Security, the module formerly known as ACEGI, make sure you have those JARs available, too.

An HTTP 404 - sure it's not just a deployment or URL issue?

Try turning Spring security off by commenting it out of the configuration file and restarting. Your app should just come right up if everything else is well. Then you'll know that you have to concentrate on. If not, you can continue to search for what else is awry.

duffymo
A: 

I agree w/ duffymo, not enough info. Try turning on verbose logging in your application and see if there's anything obvious in the logs.

Mick T