Ben Kirby [
http://community.jboss.org/people/benkirby] created the discussion
"Re: client lookup EJB method in JBoss AS 7.0,but return **$$$view1"
To view the discussion, visit:
http://community.jboss.org/message/624071#624071
--------------------------------------------------------------
I've also got this problem. Did either of you guys discover what was wrong, or find a
workaround?
I have an EJB Singleton packaged in a JAR, within an EAR. When it deploys, it says the EJB
is bound to:
"java:app/store-core-2011.1.2-SNAPSHOT/StoreFront"
"java:app/store-core-2011.1.2-SNAPSHOT/StoreFront!uk.co.magus.jam.store.core.Store"
"java:module/StoreFront"
"java:module/StoreFront!uk.co.magus.jam.store.core.Store"
"java:global/store-ear-2011.1.2-SNAPSHOT/store-core-2011.1.2-SNAPSHOT/StoreFront!uk.co.magus.jam.store.core.Store"
"java:global/store-ear-2011.1.2-SNAPSHOT/store-core-2011.1.2-SNAPSHOT/StoreFront"
I try to look it up via JNDI from code within a JAR within another deployed EAR. Only the
last entry
({{"java:global/store-ear-2011.1.2-SNAPSHOT/store-core-2011.1.2-SNAPSHOT/StoreFront"}})
can actually be found, and when I try to cast the resulting object to the actual class, I
get the following exception:
Caused by: java.lang.ClassCastException: uk.co.magus.jam.store.core.StoreFront$$$view1
cannot be cast to uk.co.magus.jam.store.core.Store
at uk.co.magus.jam.core.link.LinkListener.getStore(LinkListener.java:101)
[core-jar-2011.1.2-SNAPSHOT.jar:]
at uk.co.magus.jam.core.link.LinkListener.postLoad(LinkListener.java:29)
[core-jar-2011.1.2-SNAPSHOT.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_07]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[:1.6.0_07]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[:1.6.0_07]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_07]
at org.hibernate.ejb.event.ListenerCallback.invoke(ListenerCallback.java:48)
at
org.hibernate.ejb.event.EntityCallbackHandler.callback(EntityCallbackHandler.java:96)
at
org.hibernate.ejb.event.EntityCallbackHandler.postLoad(EntityCallbackHandler.java:89)
at
org.hibernate.ejb.event.EJB3PostLoadEventListener.onPostLoad(EJB3PostLoadEventListener.java:49)
at
org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:264)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1012)
at org.hibernate.loader.Loader.doQuery(Loader.java:889)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
at org.hibernate.loader.Loader.loadEntity(Loader.java:2058)
at
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:81)
at
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71)
at
org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3686)
at
org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:446)
at
org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:427)
at
org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:204)
at
org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:251)
at
org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:148)
at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:947)
at org.hibernate.internal.SessionImpl.get(SessionImpl.java:863)
at org.hibernate.internal.SessionImpl.get(SessionImpl.java:856)
at
org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:787)
... 29 more
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/624071#624071]
Start a new discussion in JNDI and Naming at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]