This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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

Jakub Korab

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();
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
} catch (Exception ex) {
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 org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
at AdviceClient.go(
at AdviceClient.main(
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,
Jayant Kulkarni
Ranch Hand

Joined: Dec 02, 2003
Posts: 56
This is known bug in RI implementation.
Please refer
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.
Jakub Korab

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.
girija nadarajan

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

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

Have you checked out Aspose?
subject: HeadFirst EJB question. java.rmi.RemoteException: CORBA BAD_OPERATION
It's not a secret anymore!