VAADIN one time initialisation

Hi all,

i am using db4o with VAADIN and not sure where to do all the one time only resource initialisations. db4o embedded server needs to be opened and closed parallel to the servlet and at present i have no idea where to do this.

could anyone help me please?

Hi,

I’d create a
ServletContextListener
for this purpose -
here’s a very brief example
: Google is your friend if you need more examples.

Cheers,

Charles.

thx a million charles. will do that!

i have managed to implement the ServletContextListener and it works much better however when i left the web app open overnight and tried in the morning it gave me the usual vaadin “session timed out click here” message and when clicked bang! stack trace printed unfortunately did not copy the stack trace but will do it tomorrow morning.

but from the given symptoms could anyone suggest what might be happening please?

Edited

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: com.db4o.ext.DatabaseClosedException
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.handleServiceException(AbstractApplicationServlet.java:1010)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:548)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause

com.db4o.ext.DatabaseClosedException
com.db4o.internal.ObjectContainerBase.checkClosed(ObjectContainerBase.java:303)
com.db4o.internal.ObjectContainerBase.checkTransaction(ObjectContainerBase.java:331)
com.db4o.internal.ObjectContainerBase.queryByExample(ObjectContainerBase.java:812)
com.db4o.internal.ExternalObjectContainer.queryByExample(ExternalObjectContainer.java:59)
net.signtheta.databank.db.DataBank.qbe(DataBank.java:248)
net.signtheta.jejoop.JejoopUtil.getSkills(JejoopUtil.java:28)
net.signtheta.jejoop.ui.AssetsCustomComponent.doCustomInit(AssetsCustomComponent.java:92)
net.signtheta.jejoop.ui.AssetsCustomComponent.(AssetsCustomComponent.java:85)
net.signtheta.jejoop.ui.windows.AssetsWindow.doCustomInit(AssetsWindow.java:23)
net.signtheta.jejoop.ui.windows.AssetsWindow.(AssetsWindow.java:18)
net.signtheta.jejoop.ui.windows.JejoopMainWindow.doOneTimeInit(JejoopMainWindow.java:101)
net.signtheta.jejoop.ui.windows.JejoopMainWindow.customInit(JejoopMainWindow.java:49)
net.signtheta.jejoop.ui.windows.JejoopMainWindow.(JejoopMainWindow.java:44)
net.signtheta.jejoop.JejoopApplication.doOneTimeInit(JejoopApplication.java:46)
net.signtheta.jejoop.JejoopApplication.init(JejoopApplication.java:36)
com.vaadin.Application.start(Application.java:551)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.startApplication(AbstractApplicationServlet.java:1219)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:484)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.12 logs.