disabling JDO in objectdb embedded mode

#1

Hi,

i am using objectdb (version 2.6.8) in embedded mode.

I deployed an .ear project in glassfish. When I attempt to call the database I get several exceptions. As an example consider the following short example:

[#|2016-06-02T14:19:38.393+0200|WARNING|glassfish3.1.2|javax.enterprise.system.core.classloading.com.sun.enterprise.loader|_ThreadID=192;_ThreadName=Thread-2;|LDR5204: Error : Request made to load class or resource [metamodel/PrimitiveValue.jdo] on an ASURLClassLoader instance that has already been shutdown. [ASURLClassLoader.done() called ON EarLibClassLoader :
urlSet = [URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/commons-beanutils-1.8.3.jar, URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/commons-logging-1.2.jar, URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/guava-18.0.jar, URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/shiro-ehcache-1.2.4.jar, URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/slf4j-api-1.6.4.jar, URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/objectdb-2.6.8.jar, URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/metamodel-domain-1.0-SNAPSHOT.jar, URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/postgresql-8.4-702.jdbc4.jar, URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/ehcache-core-2.5.0.jar, URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/shiro-core-1.2.3.jar, URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/commons-lang-2.2.jar, URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/jamon-2.7.4.jar, URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/javaee-api-6.0.jar, URLEntry : file:/usr/local/glassfish/glassfish/domains/dex/applications/metamodel-ear-1.0-SNAPSHOT/lib/metamodel-ejb-1.0-SNAPSHOT.jar]
doneCalled = false
Parent -> org.glassfish.internal.api.DelegatingClassLoader@43de6a4f

AT Thu Jun 02 14:19:14 CEST 2016
BY :java.lang.Throwable: printStackTraceToString
        at com.sun.enterprise.util.Print.printStackTraceToString(Print.java:639)
        at com.sun.enterprise.loader.ASURLClassLoader.done(ASURLClassLoader.java:211)
        at com.sun.enterprise.loader.ASURLClassLoader.preDestroy(ASURLClassLoader.java:179)
        at org.glassfish.javaee.full.deployment.EarClassLoader.preDestroy(EarClassLoader.java:114)
        at org.glassfish.deployment.common.DeploymentContextImpl.getClassLoader(DeploymentContextImpl.java:236)
        at org.glassfish.deployment.common.DeploymentContextImpl.getClassLoader(DeploymentContextImpl.java:186)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:450)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)

 

It seems that objectdb is trying to load a .jdo file ("metamodel/PrimitiveValue.jdo"). I don't have such file on my classpath.

So my question is: how can I prevent objectdb to attempt to load such files ?

Many thanks

#2

PrimitiveValue.jdo is not part of ObjectDB and the stack trace does not mention ObjectDB at all.

Please check if you have conflicting jars, maybe of another JDO implementation in your web application or class path.

ObjectDB Support
#3

Hi,

On my classpath I have  the entry PrimitiveValue.class.

For many entity classes, I get an exception that mentions X.jdo where X is the name of an entity class.

I will check whether I have conflicting jars.

We don't use JDO at all. We only use ObjectDB (JPA)

 

#4

ObjectDB searches for JDO metadata files (as well as for JPA metadata files) for entity classes. Currently there is no way to disable it but it has never caused problems till now.

Could you please post the relevant exception stack trace. The stack trace on #1 above doesn't seem to be related.

ObjectDB Support
#5

Hi

thank you for your reply.

The stack trace is very huge, as the content of the classpath is dumped for each single exception.

I even don't see a trace that is related to ObjectDB. The trace in #1 is the best I can show to explain the problem.

(I can also add a log file if you like. But it is too large and unreadable)

It seems to me that a "component" orders glassfish to load from my .ear file a resource X.jdo where X is the name of an entity class.

Can you please tell me why these .jdo metadata are needed ?

Should I add additional maven dependencies to fix the problem ? (currently I only have objectdb.jar version 2.6.8)

Thanks in advance

 

 

 

 

#6

In JOO (and in JPA) persistable classes can be defined and configured in external XML files in addition to annotations. Therefore, ObjectDB must check if such XML files exist.

Checking if the file exist should not throw an exception. To understand why it does throw exception in your case, at the minimum we will need the relevant stack trace.

ObjectDB Support

Reply