Re: Configure tomcat in my development environment, and save session across restart
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ashish, On 2/17/2010 5:07 PM, Ashish Kulkarni wrote: There is no SESSIONS.ser created under, but there is tldCache.ser These files are unrelated to each other. C:\App\apache-tomcat-5.5.25\work\Catalina\localhost\[webapp] I have created a myapp.xml file under C:\App\apache-tomcat-5.5.25\conf\Catalina\localhost folder, and this xml file looks like below ?xml version=1.0 encoding=UTF-8? Context docBase=C:/akulkarni/code/workspace_3.5/myapp/WebContent/ path=/myapp reloadable=true /Context Remove the path attribute: it is illegal, here. Tomcat takes the path from the name of the XML file (myapp.xml - /myapp). None of what you did will change the capability of your webapp to persist sessions across a webapp reload. If SESSIONS.ser doesn't exist, Tomcat either can't create it (permissions issue), never found a session that was serializable (not serializable issue in your code), or you have disabled the standard manager's persistence mechanism. You can post your server.xml file if you want, but I'll bet it's the default and that the problem is with your session objects, not something in your configuration. Have you checked log files for anything at all? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt9rSAACgkQ9CaO5/Lv0PBqcQCeJqOXs6MNEyXeEU0cEk11/kOt EVoAn1zIvwYp9doCqr0srpl5ZF2Xs4vs =HLhG -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Configure tomcat in my development environment, and save session across restart
Hi Is it possible to find from log files or some where, what is preventing from tomcat not able to persist sessions, all the classes saved in tomcat are serialized, they implement implements Serializable. where does tomcat save this serialized data file on PC, i want to see if this is created I have switched from tomcat plugin and using tomcat directly and still have this error, i created a JSP which simply dumps all the objects in session on webpage, before saving any class i have 2 objects in session, as soon as i save the class and tomcat restarts and i refresh this jsp page, there are no objects in session class. Ashish On Tue, Feb 16, 2010 at 4:44 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ashish, On 2/16/2010 4:35 PM, Ashish Kulkarni wrote: I use tomcat 5.5.28 for my development in eclipse, when ever i change any class it restarts my tomcat and i loose my session, so i have to go through login process to get the session. Is it possible to save this session across restarts, it would be great and save me a lot of time in development The problem isn't that your session isn't being persisted across restarts: it's that your session contents are incompatible after the restart. What happens is this: 1. Your webapp creates an object of a class, say, MyBean v1, and stuffs it into the session. 2. You modify MyBean.java, recompile, and redeploy 3. Tomcat detects the updated class, saves the sessions to the disk, re-deploys your webapp, and re-loads the sessions from the disk 4. During re-loading, the object from MyBean v1 tries to load into an environment where only MyBean v2 is available, and an exception occurs, so the session is not recovered Possible solutions are to (a) set the serialVersionId of your class or (b) write your own serialization methods (see Java serialization howtos for that) The other possibility is that you've got non-serializable objects in the session, which will prevent your session from persisting in the first place. Session is persistence is enabled by default, and should work. It's very possible that your webapp is interfering with the process. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt7EaMACgkQ9CaO5/Lv0PALtQCgkfJuYvzGSFK35H1mpG8du0ph dlMAoIWeRf32GgPOFteRgEQMm6WhzUoi =5ciA -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Ashish www.ayurwellness.com www.mysoftwareneeds.com
Re: Configure tomcat in my development environment, and save session across restart
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ashish, On 2/17/2010 3:32 PM, Ashish Kulkarni wrote: Is it possible to find from log files or some where, what is preventing from tomcat not able to persist sessions I would check logs/catalina.out, logs/localhost_*.log, and anything else in the logs/ directory. all the classes saved in tomcat are serialized, they implement implements Serializable. Don't forget that, in order to be serializable, a class must do more than merely implement the Serializable interface. All fields must be Serializable or transient, or you have to implement the serialization methods yourself. Finally, the seralVersionID of the class comes into play if you change the structure of the class (members, methods, or class name). where does tomcat save this serialized data file on PC, i want to see if this is created CATALINA_BASE/work/[service]/[host]/[webapp]/SESSIONS.ser I have switched from tomcat plugin and using tomcat directly and still have this error, i created a JSP which simply dumps all the objects in session on webpage, before saving any class i have 2 objects in session, as soon as i save the class and tomcat restarts and i refresh this jsp page, there are no objects in session class. If you're looking for a more fully-features session snooping JSP, you could try mine: http://www.christopherschultz.net/projects/java/ - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt8WbEACgkQ9CaO5/Lv0PB2xACfY8S19BEjct9bwyln5WbY/Mlq aPkAoIUw2Odj2GwaqdxSAzIn9jfRu+2H =QRhB -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Configure tomcat in my development environment, and save session across restart
Hi There is no SESSIONS.ser created under, but there is tldCache.ser C:\App\apache-tomcat-5.5.25\work\Catalina\localhost\[webapp] I have created a myapp.xml file under C:\App\apache-tomcat-5.5.25\conf\Catalina\localhost folder, and this xml file looks like below ?xml version=1.0 encoding=UTF-8? Context docBase=C:/akulkarni/code/workspace_3.5/myapp/WebContent/ path=/myapp reloadable=true /Context On Wed, Feb 17, 2010 at 4:03 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ashish, On 2/17/2010 3:32 PM, Ashish Kulkarni wrote: Is it possible to find from log files or some where, what is preventing from tomcat not able to persist sessions I would check logs/catalina.out, logs/localhost_*.log, and anything else in the logs/ directory. all the classes saved in tomcat are serialized, they implement implements Serializable. Don't forget that, in order to be serializable, a class must do more than merely implement the Serializable interface. All fields must be Serializable or transient, or you have to implement the serialization methods yourself. Finally, the seralVersionID of the class comes into play if you change the structure of the class (members, methods, or class name). where does tomcat save this serialized data file on PC, i want to see if this is created CATALINA_BASE/work/[service]/[host]/[webapp]/SESSIONS.ser I have switched from tomcat plugin and using tomcat directly and still have this error, i created a JSP which simply dumps all the objects in session on webpage, before saving any class i have 2 objects in session, as soon as i save the class and tomcat restarts and i refresh this jsp page, there are no objects in session class. If you're looking for a more fully-features session snooping JSP, you could try mine: http://www.christopherschultz.net/projects/java/ - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt8WbEACgkQ9CaO5/Lv0PB2xACfY8S19BEjct9bwyln5WbY/Mlq aPkAoIUw2Odj2GwaqdxSAzIn9jfRu+2H =QRhB -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Ashish www.ayurwellness.com www.mysoftwareneeds.com
Configure tomcat in my development environment, and save session across restart
Hi I use tomcat 5.5.28 for my development in eclipse, when ever i change any class it restarts my tomcat and i loose my session, so i have to go through login process to get the session. Is it possible to save this session across restarts, it would be great and save me a lot of time in development I was reading about manager in tomcat, but did not figure out how to do it, is there any document or example of configuring this manager, http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html http://tomcat.apache.org/tomcat-5.5-doc/config/manager.htmlI have configure tomcat so i can start and stop from eclipse -- Ashish www.ayurwellness.com www.mysoftwareneeds.com
Re: Configure tomcat in my development environment, and save session across restart
On 16/02/2010 21:35, Ashish Kulkarni wrote: Hi I use tomcat 5.5.28 for my development in eclipse, when ever i change any class it restarts my tomcat and i loose my session, so i have to go through login process to get the session. Is it possible to save this session across restarts, it would be great and save me a lot of time in development Tomcat does this by default. I was reading about manager in tomcat, but did not figure out how to do it, is there any document or example of configuring this manager, http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html That is the documentation. I have configure tomcat so i can start and stop from eclipse You need to figure out where Eclipse has disabled session persistence and change it back. That would be a question for the Eclipse forums. Things like this and never being quite sure which configuration files Eclipse is using is why I always use an external Tomcat instance rather than one provided by Eclipse. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Configure tomcat in my development environment, and save session across restart
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ashish, On 2/16/2010 4:35 PM, Ashish Kulkarni wrote: I use tomcat 5.5.28 for my development in eclipse, when ever i change any class it restarts my tomcat and i loose my session, so i have to go through login process to get the session. Is it possible to save this session across restarts, it would be great and save me a lot of time in development The problem isn't that your session isn't being persisted across restarts: it's that your session contents are incompatible after the restart. What happens is this: 1. Your webapp creates an object of a class, say, MyBean v1, and stuffs it into the session. 2. You modify MyBean.java, recompile, and redeploy 3. Tomcat detects the updated class, saves the sessions to the disk, re-deploys your webapp, and re-loads the sessions from the disk 4. During re-loading, the object from MyBean v1 tries to load into an environment where only MyBean v2 is available, and an exception occurs, so the session is not recovered Possible solutions are to (a) set the serialVersionId of your class or (b) write your own serialization methods (see Java serialization howtos for that) The other possibility is that you've got non-serializable objects in the session, which will prevent your session from persisting in the first place. Session is persistence is enabled by default, and should work. It's very possible that your webapp is interfering with the process. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt7EaMACgkQ9CaO5/Lv0PALtQCgkfJuYvzGSFK35H1mpG8du0ph dlMAoIWeRf32GgPOFteRgEQMm6WhzUoi =5ciA -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org