This is the text of the post from the original one in Nov 2003
Howdy -- I thought I'd start a new topic on this rather than add to the old one.
Some people have been getting this incredibly helpful and enlightening CORBA.BAD_OPERATION error when they run the AdviceClient client on the
J2EE 1.3 RI, at the point where the business method (getAdvice()) is invoked:
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(Class.java:232)
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:454)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
at AdviceClient.go(AdviceClient.java:27)
at AdviceClient.main(AdviceClient.java:9)
========================
But not everyone gets it. Me, for example. But thanks to Chidu, I know for certain that this is some type of bug and not a programmer error, because Chidu sent me his entire project and I was able to run it perfectly on my machine. Yet, running the same application and class files (I even deployed his existing .ear file - I didn't recreate one using his classes) he DOES get the error. I have verified that he has done everything correctly, yet on his machine he still gets the error.
It cannot be a classpath problem, because if it were, it would fail at an earlier point.
I have a reason to suspect that this is related to a known bug in the RI, but since I am unable to reproduce the error (because it always works for me), I'm asking if someone who has this error could try the fix I'm going to give you in a moment.
Some of you HAVE been able to fix it with a terrible workaround (where you take the classes out of a package!) but we don't want you to have to do that! You could never get away with that in the real world, so we want you to keep the classes in packages.
Here's my suspicion that I would REALLY appreciate if someone could
test it. Either someone who is currently getting the error, or someone who did before, and who fixed it by removing the packages (in which case, you'd have to put everything BACK into a package...)
The RI has a known bug that *might* be the problem. It has to do with the name of a method in an component interface, when it is somehow related to the interface name itself.
I think you should change the name of the method, and rebuild and redeploy the bean. If this fixes it, we will post a note on our site and O'Reilly, letting people know that they *might* have that bug.
By the way, if you run "j2ee -version" at the command-line, you'll find out which one you're using. I'm using:
Java 2 Enterprise Edition version 1.3.1, build 1.3.1-b17
And I do not get this error, even when running an application that produces this error on a different machine. I am running the Linux distribution, under Mac OSX (works under Jaguar and the new Panther), with J2SE 1.3.
So, here's the fix I want someone to try, and if it works, you will certainly be the hero.
1) Undeploy your current AdviceApp by cleaning up the server
-- stop J2EE "j2ee -stop"
-- run "cleanup" at the command-line
2) Delete your application from your projects/Advice directory (in other words, delete the .ear file), and if there are any .temp files, delete those as well.
3) Change your component interface and name the method something that does NOT have "Advice" in the name... so, instead of getAdvice(), call it getSomething()...
4) Change your bean class business method to match the business method name in the interface
5) Recompile
-- restart the server and the deploytool
6) Rebuild the bean from scratch (first build a new application, then New --> Enterprise Bean
7) Deploy the bean
8) Modify the client code to call the new method (instead of the getAdvice() method)
9) Invoke the appropriate diety / spirit / good luck charm
10) Run the client (might help to hold your breath until it's done)
Post your wonderful success story here, so I can sleep again.
So, once again, somebody who had this error PLEASE help by trying this fix. There's a good chance this is the problem.
thanks,
Kathy