Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session gets lost via apache web server / mod_jk / modrewrite

 
Robert Jaeger
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic