Cannot initialize db after inserting a java.util.List

#1

Hi,

I've spent some time trying to figure this out without success, so I'm asking for much appreciated help.

I have an entity class like this:

class Test {
    private List<String> list = new ArrayList<String>();
}

I can persist and retrieve the obj just fine using standalone program, but whenever I access the db through a servlet container I get this error:

objectdb.java.util.ArrayList cannot be cast to com.objectdb.spi.TrackableSysType

This happens during EntityManagerFactory initialization.

I've also verified the data using ObjectDB Explorer.

Here's the whole stacktrace:

com.objectdb.o.InternalException: Unexpected internal exception
at com.objectdb.o.TYM.au(TYM.java:976)
at com.objectdb.o.MUT.
   
    (MUT.java:101)
at com.objectdb.o.CLT.
    
     (CLT.java:38) at com.objectdb.o.MUT.w(MUT.java:311) at com.objectdb.o.TYS.m(TYS.java:202) at com.objectdb.o.TYS.l(TYS.java:136) at com.objectdb.o.TYM.aa(TYM.java:469) at com.objectdb.o.TYM.
     
      (TYM.java:229) at com.objectdb.o.OMF.aj(OMF.java:699) at com.objectdb.o.OMF.ai(OMF.java:654) at com.objectdb.o.OMF.ai(OMF.java:633) at com.objectdb.jpa.EMF.createEntityManager(EMF.java:90) at com.socratestutor.conf.startup.DataStartup.run(DataStartup.java:24) at com.socratestutor.conf.startup.StartupContextListener.contextInitialized(StartupContextListener.java:19) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:543) at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:447) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:222) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:542) at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:431) at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1053) at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:795) at com.google.gwt.dev.DevMode.main(DevMode.java:282) Caused by: java.lang.ClassCastException: objectdb.java.util.ArrayList cannot be cast to com.objectdb.spi.TrackableSysType at com.objectdb.o.TYM.au(TYM.java:973) at com.objectdb.o.MUT.
      
       (MUT.java:101) at com.objectdb.o.CLT.
       
        (CLT.java:38) at com.objectdb.o.MUT.w(MUT.java:311) at com.objectdb.o.TYS.m(TYS.java:202) at com.objectdb.o.TYS.l(TYS.java:136) at com.objectdb.o.TYM.aa(TYM.java:469) at com.objectdb.o.TYM.
        
         (TYM.java:229) at com.objectdb.o.OMF.aj(OMF.java:699) at com.objectdb.o.OMF.ai(OMF.java:654) at com.objectdb.o.OMF.ai(OMF.java:633) at com.objectdb.jpa.EMF.createEntityManager(EMF.java:90) at com.socratestutor.conf.startup.DataStartup.run(DataStartup.java:24) at com.socratestutor.conf.startup.StartupContextListener.contextInitialized(StartupContextListener.java:19) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:543) at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:447) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:222) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:542) at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:431) at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1053) at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:795) at com.google.gwt.dev.DevMode.main(DevMode.java:282)

 

#2

It seems that there is a class loader conflict issue when using ObjectDB with GWT in hosted mode. It might be related to the embedded Jetty web server since a previous report indicated that the exception doesn't happen when running GWT externally on Tomcat.

Please try ObjectDB 2.0.3 build 02 that might fix this issue.

If it still happens - could you please upload a simple GWT project that demonstrates the problem?

ObjectDB Support
#3

That fixed it!  Thank you so much.

#4

Good. Thank you for this report.

ObjectDB Support

Reply