aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes HeadFirst EJB question. java.rmi.RemoteException: CORBA BAD_OPERATION Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "HeadFirst EJB question. java.rmi.RemoteException: CORBA BAD_OPERATION" Watch "HeadFirst EJB question. java.rmi.RemoteException: CORBA BAD_OPERATION" New topic
Author

HeadFirst EJB question. java.rmi.RemoteException: CORBA BAD_OPERATION

Jakub Korab
Greenhorn

Joined: Feb 04, 2004
Posts: 7
Hoping someone can help out with this. I'm getting some really strange behaviour on the intro application.
My environment:
Win XP
J2SDKSE 1.3.1_10
J2SDKEE 1.3.1
For people without the book, Stateless Session bean.
remote interface - headfirst.Advice
ejb class - headfirst.AdviceBean
remote home interface - headfirst.AdviceHome
I have deployed the sample application (JNDI name - "Advisor") into the J2EE RI server, having verified it using the deployment tool. Deployment went through OK, j2ee is happy - no errors.
I have an test class (some println's removed, so ignore the line numbers on the exception that follows...):
-----
import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;
import headfirst.*;
import javax.ejb.*;
public class AdviceClient {
public static void main (String[] args) {
AdviceClient client = new AdviceClient();
client.go();
}
public void go() {
try {
// 1. get a reference to the JDNI InitialContext
Context context = new InitialContext();
// 2. use the context to do a lookup on the home interface of the bean
Object object = context.lookup("Advisor");
// 3. narrow and cast
AdviceHome home = (AdviceHome)
PortableRemoteObject.narrow(object, AdviceHome.class);
// 4. call create() on the home interface to get a reference to the
// component interface
Advice advisor = home.create();
// 5. use the component
System.out.println(advisor.getAdvice());
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
-----
At step 5, I get the following exception:
-----
java.rmi.RemoteException: CORBA BAD_OPERATION 0 No; nested exception is:
org.omg.CORBA.BAD_OPERATION: minor code: 0 completed: No
org.omg.CORBA.BAD_OPERATION: minor code: 0 completed: No
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemExc
eption(ReplyMessage_1_2.java:93)
at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(
ClientResponseImpl.java:108)
at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOACli
entSC.java:132)
at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
at AdviceClient.go(AdviceClient.java:39)
at AdviceClient.main(AdviceClient.java:10)
-----
I checked some of the newsgroups, and the closest thing I could find was that the CORBA exception is caused by calling a method on the interface that is not implemented on the stub (I think, can't recall exactly).
I double-checked the bean class against the remote interface, and it's all good. Even got them both to extend/implement the same interface just to be certain (although the verifier probably catches this...).
If anybody has any ideas, it would be greatly appreciated. Cheers,
Jake
Jayant Kulkarni
Ranch Hand

Joined: Dec 02, 2003
Posts: 56
Hi,
This is known bug in RI implementation.
Please refer
http://www.wickedlysmart.com/HeadFirst/HeadFirstEJB/HeadFirstEJBNotes.html
Or Please refer my earlier post on this, The topic is headed by -
head first ejb pg:57 client problem!!!please help urgent
Hope this helps.
Thanks,
Jayant
Jakub Korab
Greenhorn

Joined: Feb 04, 2004
Posts: 7
Thanks Jayant. Recompiled with a new method name, and it ran through beautifully. It's such a relief to finally see it working, nothing worse than not being able to get the first sample app to run.
Jake
girija nadarajan
Greenhorn

Joined: May 29, 2006
Posts: 1
Thanks a lot ya.. i too was facing the same problem.. and got working right now..
Chinna illa
Greenhorn

Joined: Jun 10, 2006
Posts: 1
Hi All

I'm Chinna, joined in this group today only. I want to let you all know that i'm preparing for the SCBCD and looking for your guidance.

I'm going through the Head First book, Can some one please let me know wat the other books to read, and where i'll find the mock up tests.

Thanks inadvance to everyone

Chinna
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HeadFirst EJB question. java.rmi.RemoteException: CORBA BAD_OPERATION