Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

new to EJB, help needed.

 
Edy Yu
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am following the Converter example. But when I ren the COnverterClient, I got a error says
"Caught an unexpected exception!
java.lang.ClassCastException
at com.sun.corba.ee.internal.javax.rmi.PortableRemoteObject.narrow(Porta
bleRemoteObject.java:296)
at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at ConverterClient.main(ConverterClient.java:24)"
I checked ConverterAppClient.jar, it's there in the specified directory.
Could anyone explain why?
Thanks
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edy,
I got a similar exception yesterday while working with j2ee 1.3. Though i think this particular exception is unrelated with either of j2ee 1.3 or 1.2.1. I rebooted by system and worked with the j2ee 1.2.1 and things work fine. I do not have the patience now to try things all over again with j2ee 1.3. I thus do not know why but lets wait and see what people have to say.
------------------

Mahindrakar
IBM Application Server Forum Moderator
SCJP
 
Vivek Viswanathan
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have faced similar problem, on working with Weblogic 5.1 server , the error generally occurs when we have deployed an EJB that refereneces another java object, and there is a change in this referenced java object between the time we deployed the EJB and running the client.
The exact sequence of operations is something like this
1) compile all code, EJB code and the java object that is being refereneced frmo the EJB.
2) deploy the EJB in the server
3) Run the client to access in the EJB Object such that the Java Obect referenced by the EJB object is accessed, this ensures that the Java Object is loaded into memory by the J2EE server.
3) modify the Java Object such that there is a chage in the method declarations or the deletion of a method that existed in the Java Object when the EJB was deployed.
4) Rerun the Client code -- you will now get a ClassCastException since the class loaded by the J2EE server the first time, does not match the new new class.

I feel the problem that you face, has something todo with changing of the class and recompiling while the class is allready loaded by the server. If the J2EE server has something like dynamically loading of class files ( this feature is persent in Weblogic 6.0 -- i have not tested this til now) you may not face this problem.
If you have the time, could you possible test in these lines, and let me know I am really interested in the problem that you face.
Vivek Viswanathan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!