• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Getting exception trying to run AdviceClient.java

Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am going through the HF EJB book and was trying to run the AdviceClient.java program. Got this exception trying to run it. Could you suggest some reason why this exception is occurring.

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.mapSystemExceptio
at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
at AdviceClient.go(AdviceClient.java:30)
at AdviceClient.main(AdviceClient.java:18)
Caused by: org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed:
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemExc
at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(
at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOACli
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
... 2 more
Posts: 2968
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

We have discovered something that -- while not being an errata -- is a bug in the J2EE software that is showing up in our main opening tutorial exercise.
Here it is... for the chapter 1 Advice Guy application (not tied to a specific page)
If you receive a CORBA.BAD_OPERATION error when you run the client, you may be experiencing a bug that exists in some versions of the J2EE Reference Implementation.

The R.I. bug is:

  • You can't have a method name that has the same characters as the interface name. Remember, this is a bug in the RI, and NOT a rule from the EJB spec.
  • In the Advice application, the interface currently looks like this:

  • The problem is that getAdvice() contains the characters "Advice" that match the interface name, and this *can* in some systems, cause the bug. We can't specify exactly which combination of versions and OS produces the problem, except to say that the Linux distribution of J2EE 1.3.1 on Max OSX 10.2 and 10.3 does not have a problem.

    The FIX is:
    1) Change the business method name to something else in the interface:

    public interface Advice extends EJBObject {
    public String getTheMessage() throws RemoteException;
    2) Change the business method implementation in the bean class to match.
    3) Change the client code that calls the method, to reflect the new method name.
    4) Undeploy the current version and cleanup the server using;
    * run "cleanup" (without the quotes) at the command-line (this will undeploy your application and
    take the server back to the state it was in when installed.)
    * Delete your existing .ear file (and any .temp files, if you see them in your projects or Advice directory)
    5) Restart the server and restart deploytool
    6) Recreate the application and the bean (using New --> Enterprise bean) and start over.
    7) Be sure to wear your 'lucky t-shirt' while doing this. The R.I has been known to respond to some forms of superstition. Or maybe it's just an urban legend...
    8) Run the client again and voila! Success! Finally!

    [ October 31, 2005: Message edited by: Peer Reynders ]
    Conan King
    Posts: 23
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Things can really be strange.. Well I have done as you had said and it is working absolutely fine.

    Thanks a lot mate.
    Mo-om! You're embarassing me! Can you just read a tiny ad like a normal person?
    a bit of art, as a gift, that will fit in a stocking
      Bookmark Topic Watch Topic
    • New Topic