621 words

Cannot initialize db after inserting a java.util.List

#1
2010-12-24 03:05

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)

 

gorilla77
gorilla77's picture
Joined on 2010-12-24
User Post #1
#2
2010-12-24 08:13

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
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #93
#3
2010-12-24 08:29

That fixed it!  Thank you so much.

gorilla77
gorilla77's picture
Joined on 2010-12-24
User Post #2
#4
2010-12-24 08:52

Good. Thank you for this report.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #94

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel