RE: Do JBoss and Tomcat share same VM - other thread is hose
rockinryan Sep 17, 2002 4:18 PMThanks Adrian for your reply,
I confirmed that I was using a clean InitialContext, so long as this is the same then we are on the same page:
jndiContext = new javax.naming.InitialContext();
I did try the unwrapping technique per your advice but wasn't sure how to get through several layers. I feel like the stack trace is offering enough info already so I didn't fight to unwrap repeatedly. The reason for my original post and it's lack of code or stack trace is that I don't understand why rmi is involved when using local interfaces.
A heavily trimmed stack looks like this:
[BEGIN STACK]
javax.ejb.EJBException: Undeclared throwable after one unwrap:
Embedded Exception: null
Embedded Exception
$Proxy72; nested exception is:
javax.ejb.EJBException: null
Embedded Exception: $Proxy72
at com.rydel.fys.UserSessionBean.isUseridAvailable(UserSessionBean.java:441)
[HUGE SNIP]
java.rmi.ServerException: null
Embedded Exception
$Proxy72; nested exception is:
javax.ejb.EJBException: null
Embedded Exception
$Proxy72
javax.ejb.EJBException: null
Embedded Exception
$Proxy72
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1148)
[HUGE SNIP]
java.lang.ClassCastException: $Proxy72
at com.rydel.fys.UserBean$Proxy.ejbSelectTempUserByUserid()
[END STACK]
I just debugged deeper into my beans to find that I am unable to load a CMP2.0 entity bean. (My test client can create them no problem.) The code all executes fine if there is no matching data, but when I lookup an existing PK blam! As the stack indicates, the root of the problem appears to be a bad type cast, but I don't understand two things:
1- Why am I getting any error in my stack via java.rmi.* when all my beans are local (and don't even have remote interfaces)?
2- I'm using the Object type and not accessing any methods on the object (which is an existing entity bean) so I don't see why there'd be any casting issues.
The cast that is failing is here:
Object tempU = (Object)ejbSelectTempUserByUserid(userid);
Declaration for my select method and it's EJB QL:
public abstract UserBean ejbSelectTempUserByUserid(String userid) throws FinderException ;
EJB QL: SELECT OBJECT(u) FROM User as u WHERE u.userid = ?1
I will continue searching and repost if I get a handle on this. Thanks for your time, it is greatly appreciated.
Ryan