-
1. Re: IllegalStateException in Entity Beans under Jboss 3.
ne0fite May 22, 2003 6:12 PM (in response to josh_hu)We've seen similar problem in going from JBoss 3.0.7 to 3.2.1. The problem appears to be If you are getting remote interface by getEJBObject() through entity context. I think the exception is coming from here:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jboss/src/main/org/jboss/ejb/EntityEnterpriseContext.java.diff?r1=1.26&r2=1.27
A work around is to use EntityContext.getPrimarykey() method:
public Order getRemoteInterface() {
//return (Order) context.getEJBObject(); Throws IIllegalStateException
return OrderUtil.getOrderEjb((OrderPK) context.getPrimaryKey());
} -
2. Re: IllegalStateException in Entity Beans under Jboss 3.
chriss Jun 6, 2003 2:51 PM (in response to josh_hu)I think you're right. I'm having the same problem if I try to do something like this in a LocalBean:
public City remoteRef() {
return (City)PortableRemoteObject.narrow(this.ctx.getEJBObject(), City.class);
}
It used to run just fine in JB 3.0.6 and previous versions.
I tried to find a bug report in bug db, but haven't found anything at first sight. Has this problem been filed?
-chriss -
3. Re: IllegalStateException in Entity Beans under Jboss 3.
stefan.richter Aug 8, 2003 8:15 AM (in response to josh_hu)Switching from jboss 3.0.3 to jboss 3.2.1 we also found the IllegalStateException when we have an entity bean that has both, local and remote interface. If we have an instance of the local bean and try to get the remote interface (using the getEJBObject method) we get :
2003-08-08 13:59:38,265 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException, causedBy:
java.lang.IllegalStateException: No remote interface defined.
at org.jboss.ejb.EntityEnterpriseContext$EntityContextImpl.getEJBObject(EntityEnterpriseContext.java:174)
at com.lionbioscience.annotation.applications.entity.AttrMappingEJB.getRemote(AttrMappingEJB.java:63)
This to me looks somehow like a the former problem 577711 is alive again?
[JBoss-dev] [ jboss-Bugs-577711 ] getEJBObject needs ProxyFactorysourceforge.net07/05/2002 02:25:01 -
4. Re: IllegalStateException in Entity Beans under Jboss 3.
mlassau Aug 29, 2003 12:51 AM (in response to josh_hu)I was getting this error for Entity Beans when upgrading from v3.0.6 to v3.2.1
In my case it was because of changes to the jboss.xml structure.
Once I deleted my
<enforce-ejb-restrictions> and
<container-configurations> sections, my Entity Beans started working again.
see http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t= more information.