• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Junilu Lacar
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst
  • Peter Rooke
  • Mikalai Zaikin
Bartenders:
  • Himai Minh

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

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot ya.. i too was facing the same problem.. and got working right now..
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic