This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Tomcat and the fly likes session gets lost via apache web server / mod_jk / modrewrite Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "session gets lost via apache web server / mod_jk / modrewrite" Watch "session gets lost via apache web server / mod_jk / modrewrite" New topic
Author

session gets lost via apache web server / mod_jk / modrewrite

Robert Jaeger
Ranch Hand

Joined: Apr 29, 2002
Posts: 62
Hi!

After investigating myself in a problem I am giving up and so I ask clever people in this forum

I have successfully installed and configured apache web server 2.x, tomcat 5.x and mod_jk (by usting xampp) to enable communication between both servers.

Everything works fine, the requests are redirected from the web server to tomcat.

Unfortunately the session object that is filled with attributes in my JSPs gets lost after each request (object = null). I think I still have a problem with my configuration - seems that apache doesn't receive or redirect the session to tomcat Or it fails because my requests are targeted to an apache/htdocs-directory where a htaccess-file waits to redirect the request to my webapplication. I need htaccess/modrewrite for proper urls for search engines.

I do this:
localhost/mywebapp/my.jsp -> adds attribute to session object -> link on jsp references to localhost/apachedir/ -> htaccess references to localhost/mywebapp/my.jsp -> added session attribute is gone

Maybe someone has a good advice - would be great, I could not solve the problem on my own

Thanks and regards from Bogota, Colombia,
Robert.
Mav Ricky
Ranch Hand

Joined: May 19, 2004
Posts: 76
Hi robert

now problem relating to same occurs to me.

i have done the application migration from windows to UNIX.
earlier application was on JDK 1.3 APACHE 1.3 and Tomcat 3.2
now it has been migrated to JDK 1.4 Apache 2.0 and Tomcat 4.1
same application works in windows but not in UNIX.
coz server is on UNIX .it is working on Localhost

--------------------------------------------------------------------

public SqlManager(HttpServletRequest request)
throws SQLException,IOException,SeptoUserException{
currentRequest = request;
System.out.println(request);
currentRequest = request;
System.out.println(currentRequest);
currentSession = currentRequest.getSession();
System.out.println(currentSession);
setConnection();
SeptoUser user = getSeptoUser();
}

after this line in BOLD
currentSession = currentRequest.getSession()
----------------------------------------------------------------

the execution stops in UNIX and in windows whole application is perfectly
running

no exceptions were looged in UNIX console when i tried to debug.
i tried to print request object it is getting created perfectly on UNIX Tomcat console but after that session object nothing is printed and execution stops there .
i dont know why this is happenning ?
as Java is paltform independent why same code is working on WINDOWS and not on UNIX.


thanks for any help!
 
Consider Paul's rocket mass heater.
 
subject: session gets lost via apache web server / mod_jk / modrewrite