It's not a secret anymore!
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Getting exception trying to run 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 "Getting exception trying to run" Watch "Getting exception trying to run" New topic

Getting exception trying to run

Conan King

Joined: Aug 31, 2003
Posts: 23

I am going through the HF EJB book and was trying to run the 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 javax.rmi.CORBA.Util.mapSystemException(
at headfirst._Advice_Stub.getAdvice(Unknown Source)
at AdviceClient.go(
at AdviceClient.main(
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(
at java.lang.Class.newInstance0(
at java.lang.Class.newInstance(
at org.omg.CORBA.portable.ObjectImpl._invoke(
at headfirst._Advice_Stub.getAdvice(Unknown Source)
... 2 more

King<br /> <br />SCJP 1.4, SCWCD 1.4
Peer Reynders

Joined: Aug 19, 2005
Posts: 2933

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

    Joined: Aug 31, 2003
    Posts: 23
    Things can really be strange.. Well I have done as you had said and it is working absolutely fine.

    Thanks a lot mate.
    I agree. Here's the link:
    subject: Getting exception trying to run
    jQuery in Action, 3rd edition