Using Sun's RI on NT4.0...
Session bean calling entity bean.
_dataHome = lookup(...)
ejbCreate in _dataHome gets called and after 15 seconds...
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: Exception creating EJBObject: ; nested exception is:
java.lang.RuntimeException: Unable to create reference java.lang.ClassCastException
Seems like after creating DB entry, it fails to instantiate and the EJBObject.
Could this be a classpath problem? I've made sure that the DOS window j2ee -verbose is running in contains the .ear file which contains the ejbObject class file.
What else am I missing?
What EJB version are you using? In 1.1, you need to call PortableRemoteObject.narrow(..) method, if you haven't done so.
A few checkpoints:
Check your pri-key-class in your ejb-jar.xml if it is a BMP.
Check if the object returned by your PortableRemoteObject.narrow method is being cast correctly. Check if you are importing the correct entity bean package in your session bean.
I use weblogic (NT) app server to deploy my stateful session and Entity beans all the time and these are some points that I keep check. I have had no problems.
Why do I get ClassCastException when I locate my home interface using the PortableRemoteObject.narrow()?
My sample programs used to work before but this particular bean code is throwing that exception. I can't seem to figure out why.