aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Getting exception trying to run AdviceClient.java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Getting exception trying to run AdviceClient.java" Watch "Getting exception trying to run AdviceClient.java" New topic
Author

Getting exception trying to run AdviceClient.java

Conan King
Greenhorn

Joined: Aug 31, 2003
Posts: 23
Hi,

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
n(ShutdownUtilDelegate.java:137)
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:
No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
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
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(ObjectImpl.java:457)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
... 2 more
******************************************


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

Joined: Aug 19, 2005
Posts: 2922
    
    5
See
errata


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
    Greenhorn

    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: http://aspose.com/file-tools
     
    subject: Getting exception trying to run AdviceClient.java