persistence@glassfish.java.net

Re: IllegalArgumentException not a known entity type

From: Mitesh Meswani <Mitesh.Meswani_at_Sun.COM>
Date: Wed, 07 Feb 2007 11:46:47 -0800

Gareth Llewellyn wrote:
> This is similar to a previous post re toplink-essentials.jar being packaged
> in a war rather than in the Tomcat shared lib directory HOWEVER I am
> encountering the following "not a known Entity type" issue when running a
> deployed EAR containing an application client jar, en ejb jar and an entity
> jar - this is my version of the ex1-ee.ear sample application from the
> Glassfish persistence pages.
>
> Caused by: java.lang.IllegalArgumentException: Object:
> com.shoelessjos.legend.entity.spacial.Galaxy_at_1f6b4df is not a known entity
> type.
> at
> oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:3178)
> at
> oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.persist(EntityManagerImpl.java:170)
> at
> com.sun.enterprise.util.EntityManagerWrapper.persist(EntityManagerWrapper.java:433)
> at com.shoelessjos.legend.ejb.SpacialBean.insert(SpacialBean.java:28)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
> at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
> at
> com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
> at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
> at
> com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:190)
> ... 17 more
>
> The point is that I've duplicated ex1-ee.ear and its components in my own
> project using my own build script and am running the application client jar
> against the deployed SpacialBean EJB. Why is it not "seeing" the entities I
> have packaged in my entities.jar inside the ear (as per ex1-ee.ear - which
> works perfectly by the way)? Have I packaged up my application client jar,
> ejb jar, entities jar or ear incorrectly?
>
Where is your persistence.xml placed? It should be under META-INF dir of
entities.jar

Regards,
Mitesh
> I'll attach the ear here so anyone else can asadmin deploy and retrieve the
> application client jar then run it with appclient. I've been desperately
> searching my project and experimenting with packaging and config to try and
> figure out how I can screw up a simple modification to the very simple
> ex1-ee.ear example, but I just can't figure it.
>
> Someone out there please lend a hand and save my sanity!
> (I'm using Sun App Server PE9 update 2 and JSE6 by the way - basically the
> latest Sun releases at time of writing)
>
> http://www.nabble.com/file/6290/legend.ear legend.ear
>