Hi CodeSurfer, I know your question is a little ages, anyway I'm facing exactly the same problem. Were you able to solve it? How?
Thanks. On Friday, June 22, 2007 7:49:29 PM UTC+2, CodeSurfer wrote: > > Hi mP, > > I disagree with your statement that I am doing too much for the > embedded Tomcat. My server code is very simple: all I am having > problems with is instantiating the database object at the right point > in time. What is so difficult about that? Since I am - in my opinion - > not doing too much, the simple question remains why the > HttpSessionListener methods are never called. If this is a result of > hosted mode than I am forced to use an external server but maybe it is > a bug in which case it would be nice it it is solved so I can continue > to debug both client and server mode (for me as a GWT beginner that > would be a great boon). If it is something I am doing wrong, it would > be nice to know how to correct it, for the same reasons. > > Hennie. > > On Jun 19, 11:15 pm, mP <[email protected]> wrote: > > Just a quick comment. I think your trying to do too much using the > > hosted mode tomcat. I personally would just create a Servlet that does > > the bare minimum and returns dummy data without external dependencies > > like databases etc. The best thing to do is probably to run your > > hosted mode session without the embedded tomcat (-noserver option) and > > connect to a real web server. > > > > On Jun 19, 4:54 am, CodeSurfer <[email protected]> wrote: > > > > > > > > > Hi All, > > > > > My application defines a class implementing ServletContextListener and > > > a class implementingHttpSessionListener. I am using hosted mode (i.e. > > > the embedded Tomcat). I have defined the listeners in the web.xml of > > > the embedded Tomcat. The methods of the class implementing > > > ServlectContextListener are called but not the methods in the class > > > implementingHttpSessionListener. > > > > > I think Tomcat is really reading both classes: FileMonitor by > > > SysInternals shows both classes being loaded by Tomcat and when I > > > introduce a typo in either class name in the <lister-class> tag,Tomcat > > > complains that the application can not be loaded. > > > > > So apparently something else is causing myHttpSessionListenermethods > > > not to be called. Maybe the embedded Tomcat works differently than a > > > stand-alone Tomcat with regard to the HttpSessionListenere interface? > > > > > Thanks for any ideas or suggestions you can give me. > > > Hennie. > > > > > Here is the relevant excerpt from the web.xml: > > > > > <listener> > > > <description>Http session listener that opens a Db4o database</ > > > description> > > > <listener- > > > class>nl.wincornixdorf.faces.server.FacesHttpSessionListener</listener- > > > class> > > > </listener> > > > <listener> > > > <description>Servlet context listener that starts a Db4o server > > > (embedded)</description> > > > <listener- > > > class>nl.wincornixdorf.faces.server.FacesServletContextListener</ > > > listener-class> > > > </listener> > > > > > Here is the class implementing theHttpSessionListener: > > > > > package nl.wincornixdorf.faces.server; > > > > > import javax.servlet.ServletContext; > > > import javax.servlet.http.HttpSession; > > > import javax.servlet.http.HttpSessionEvent; > > > import javax.servlet.http.HttpSessionListener; > > > > > import com.db4o.ObjectContainer; > > > import com.db4o.servlet.Db4oServlet; > > > > > public class FacesHttpSessionListener implementsHttpSessionListener > > > { > > > private final String FACESDATABASEFILE = "c:\\EclipseWorkspace\ > > > \WNNL-Faces\\faces.yap"; > > > > > public void sessionCreated(HttpSessionEvent event) > > > { > > > HttpSession session = event.getSession(); > > > ServletContext context = session.getServletContext(); > > > > > ObjectContainer db = Db4oServlet.sessionTransaction(context, > > > session, > > > FACESDATABASEFILE); > > > } > > > > > public void sessionDestroyed(HttpSessionEvent event) > > > { > > > } > > > > > }- Hide quoted text - > > > > - Show quoted text - > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
