Please use the google group to ask questions - thanks.

by Paul 07 Jan 18:51
Entity Bean forgetting it's an entity bean when not running in eclipse.

I am trying to make a few changes in the demo application and I get this error when I try to do a find on app.data.User. However if I run the same test in Eclipse it works fine.

app.data.User is NOT an Entity Bean?
com.avaje.ebean.server.core.DefaultServer.createQuery(DefaultServer.java:818)
at com.avaje.ebean.server.core.DefaultServer.find(DefaultServer.java:891)
at com.avaje.ebean.server.core.DefaultServer.find(DefaultServer.java:879)
at org.avaje.ebean.spi.jpa.EbeanEntityManagerFactory$EbeanEntityManager.find(EbeanEntityManagerFactory.java:209)

08 Jan 05:34
by Rob

There was a bug in 1.0.0 (fixed in 1.0.1) where if the path contained spaces then you would get something like this error. (URL encoding had the spaces as %20 and so some classes where not found in the classpath.


Can you find and show me parts of the log...

7/01/2009 10:39:42 com.avaje.ebean.Ebean$ServerManager createServerFactory
INFO: Ebean Version[1.0.1-081216] Java Version[1.5.0_03]
7/01/2009 10:39:42 com.avaje.ebean.server.core.BootupClassPathSearch search
INFO: Classpath search hits in jars[] pkgs[com.avaje.ebean.meta, dbpost, com.avaje.ebean.server.bean] searchTime[106]

The "Classpath search hits in jars[] pkgs[]..." shows where Ebean found entity beans during it's search of the classpath. I'm guessing there is some difference in the classpath setup between running in Eclipse and outside of eclipse.

Thanks, Rob.

09 Jan 20:31
by Paul

Problem turned out to be that when running ebean under maven / surefire the wrong classloader was being passed to ebean.

The solution is to add the following to the section of the plugin

false
<

The theory of classloading is explained in

http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html

Create a New Topic

Title:
Body:
 
Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements
woResponse