0

I deployed my GWT app, that uses SpringSecurity, and have a problem.

After feeding the credentials it logs out immediately. If I put in the wrong credentials, it says 'wrong credentials', but when I give correct ones it just goes back to the login screen. (So mysql connection works)

My set up is like this: Apache 2 fronting Tomcat6 on Ubuntu 10.04.2 LTS. I use mod_jk in between.

I've never used this mod_jk thing before, normally I have a standalone Tomcat, but requirements oblige me to use this now.

Q: Can it be that the Tomcat Session doesn't remember that a user is logged in, due to some mod_jk config stuff that I am missing? The requests are forwarded, so mod_jk seems to work fine.

Please provide me some hints where to look! Or should it be working already? Just wanting to know if there are standard procedures to take to make SpringSecurity work in a setup like this.

I followed the following tutorial to install mod_jk, and have the configuration exactly as discussed in that tutorial: http://www.howtoforge.com/how-to-install-tomcat6-with-sun-java-and-apache2-integration-on-ubuntu-10.04-lucid-lynx-with-virtual-hosts

6
  • If you enable HTTP in Tomcat and hit Tomcat directly does the problem persist? If so, this is likely a coding problem and belongs on Stack Overflow.
    – Kyle Smith
    Jun 14, 2011 at 10:59
  • You mean hitting it from the normal connector on port 8080, as configured in server.xml? (ie. <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" URIEncoding="UTF-8" redirectPort="8443" />) Jun 14, 2011 at 12:40
  • That also gives the error, so you reckon it is a code problem...? Because it does run on stand-alone tomcat5.5... Jun 14, 2011 at 12:41
  • (which is a different server of mine). So it could also be a Tomcat6 problem? Or something has changed on T6 vs T5.5? Jun 14, 2011 at 13:01
  • Cancel that! Hitting the url directly using port 8080, it does work! Jun 14, 2011 at 13:09

1 Answer 1

0

I dealt with this same issue for a bit myself in the past. Had some configurations work in 1 browser and not another. However, I found the fix to be that you should not be using http and port 8080 in your apache httpd configuration. You should be using ajp and port 8009 (which tomcat has on by default). The required parts of the configuration I have outlined below:

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_module modules/mod_proxy.so

...

## App Configuration
ProxyPass    /app1                           ajp://localhost:8009/app1
ProxyPass    /app1/j_spring_security_check   ajp://localhost:8009/app1/j_spring_security_check
ProxyPass    /app1/j_spring_security_logout  ajp://localhost:8009/app1/j_spring_security_logout

Note: I didn't include obviously the references to virtual host and what not because that will really be specific to your configuration. Also as long as you haven't modified your tomcat servers AJP connector port you shouldn't have to do anything to your tomcat instance.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .