• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

HeadFirst: AdviceBean ...interesting problem

 
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I was working on Advice Bean from the Head First EJB book, this is the
first Stateless Session Bean in the book from chapter 1(intro to EJB)
The bean defines an the following business method
public String getAdvice()

I wrote the program exactly as specified in the book and I am also using
the correct version of J2EE RI and J2SDK as specified in the book.
The Bean was deployed sucessfully but on running the client I would get the
following exception
Exception in thread "main" java.rmi.RemoteException: CORBA BAD_OPERATION 0 No; nested exception is:
org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed: No
at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:137)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
at AdviceClient.main(AdviceClient.java:27) Caused by: org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed:No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemException(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(GenericPOAClientSC.java:132)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
... 1 more
After racking my brains and trying out a hell lot of stuff I could not figure out the problem.
So I decided to write another bean (the famous hello world bean) and this bean had business method called
public String sayHello()
and this time I didnt get any exception at all....now this was really wired, so I compared the code and both were identical except that it had
a diffrent bean name and different business method.
After spending couple of hours checking the code again, I happend to look at security tab on the J2EE RI deployment tool for 'Advice Bean' and I
noticed
that the security tab contains the list of methods so that we can set the method permissions and in this list
the business method 'getAdvice' was next to the EJBObject method 'getHandle' etc......that is when it hit me that the problem could probally be
because of the
business method name starting with 'get', I changed the name of the business method to 'sayAdvice' and everything worked fine. I also could re- create
the problem by changing the business method of Hello World Bean to 'getHello' and I faced the same problem again.
Has this problem been stated in the book Errata ? If it has then you can ignore this post ?
Vivek
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vivek,
I too got the same problem and it worked when I changed the method name to something else.
This issue is also discussed somewhere in this forum.
 
Vivek Viswanathan
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Could you please give me the URL for that discussion ...
Got it
https://coderanch.com/t/158262/java-EJB-SCBCD/certification/CORBA-bad-operation-error-RI

v
[ January 20, 2004: Message edited by: Vivek Viswanathan ]
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
There's a succient answer to be found here:-
http://www.oreilly.com/catalog/hfjejb/errata/hfjejb.confirmed
-=david=-
 
Vivek Viswanathan
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cheers
I just realized something,
In my solution I replaced getAdvice() with sayAdvice() and it worked with out a problem.
How is this solution working since my business method still has the word Advice in it which matches the Interface name
Any Ideas ?
Vivek
reply
    Bookmark Topic Watch Topic
  • New Topic