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
Co-Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0596007124/ref=jranch-20" target="_blank" rel="nofollow">"Head First Design Patterns"</a><br /> <br />Just a Jini girl living in a J2EE world.
Chidu Chidambaram
Greenhorn
Joined: Sep 18, 2003
Posts: 7
posted
0
I followed all of the above mentioned steps and changing the method name acutally makes the client work. Thanks Kathy for the help. I am sure this thread is going to save a lot of people quite some time. Chidu
Kathy Sierra
Cowgirl and Author
Ranch Hand
Joined: Oct 10, 2002
Posts: 1572
posted
0
Thanks again Chidu for actually testing it and verifying that this workaround does fix the problem! OK, now I have a question for others who experience this CORBA.BAD_OPERATION problem... can you please tell me which versions of everything you are using? We are trying to post a more detailed bug report than the one currently at Sun, and so far I do have Chidu's and I have my current configuration (which doesn't produce the bug, obviously... and unfortunately!) * Windows 2000, J2SE 1.3.1, J2EE 1.3.1 // produces the bug * Linux distribution J2EE 1.3.1 / J2SE 1.3.1 running on OSX version 10.2 and 10.3 // does NOT produce the bug. So, if you could please tell me your configuration, then we'll have a better idea for people who might be having the same bug. cheers and thanks, Kathy
Michael Rosenthal
Greenhorn
Joined: Nov 17, 2003
Posts: 27
posted
0
Wow my very first post. This is pretty exciting. I was also receiving the CORBA.BAD_OPERATION exception and by changing the name my EJB runs successfully! Thank you for the help Kathy. I was really stumped as to why it was not working. I am running on Windows XP, J2EE 1.3.1 J2SE 1.3.1 //produces the bug
Sun Certified Java2 Programmer - 1.4 - SCJP<br />Sun Certified Web Component Developer for J2EE Platform - SCWCD
Calvin Kong
Ranch Hand
Joined: Jul 02, 2003
Posts: 37
posted
0
Yes, the bug fixed!! Thanks, Kathy and Chidu!! I'm running on Windows 2000(Advanced Server), J2SE (build 1.3.1_09-b03), J2EE (build 1.3.1-b17)// produces the bug Cal
Cal<br />SCJP,SCWCD,SCBCD
Kathy Sierra
Cowgirl and Author
Ranch Hand
Joined: Oct 10, 2002
Posts: 1572
posted
0
Oh, Chidu, Michael, and Calvin, you have really made my night by telling me it works now!! Let's hope it all gets easier after this... Thank you so much for hanging in there and working through the workaround! Cheers, Kathy
Sara Watson
Greenhorn
Joined: Nov 18, 2003
Posts: 10
posted
0
Kathy, Thank you! You've made my day! I was just about to burn the book! I'm just kidding....I think. I appreciate you taking the time to investigate and resolve this issue. Now I can move onward and upward! Thanks again! Sara
Kathy Sierra
Cowgirl and Author
Ranch Hand
Joined: Oct 10, 2002
Posts: 1572
posted
0
Originally posted by Sara Watson: Kathy, Thank you! You've made my day! I was just about to burn the book! I'm just kidding....I think.
I can top that! I was just about to put it through the wood chipper... OK, onward and upward it is. But, oh yeah, I'm still hoping that some of you will tell me what your configuration was (version of J2EE, J2SE, and OS) because that might help the poor souls that come after you... until we get a chance to change it in the book. Thanks again, y'all! cheers, Kathy
Sara Watson
Greenhorn
Joined: Nov 18, 2003
Posts: 10
posted
0
Oh yeah, here you go. This is my configuration: J2EE Version: 1.3.1 FCS J2SE Version: 1.4.1 OS: MS Windows 2000 Server
Munish Dabra
Greenhorn
Joined: Nov 18, 2003
Posts: 19
posted
0
Hi ! May i Know which configuration is properly working with windows 2000 server.
Munish Dabra<br />SCJP , SCWD
Nehul NN
Ranch Hand
Joined: Nov 05, 2003
Posts: 45
posted
0
I had problem with following configuration Windows 2000 professional edition J2SE 1.4.0 J2EE 1.4 (beta 2)
But after rolling back to following configuration & following Kathy's note things are working as mention in book Windows 2000 professional edition J2SE 1.4.0 J2EE 1.3 Thanks
Brian Smith
Ranch Hand
Joined: Oct 26, 2002
Posts: 232
posted
0
Here is my configuration where the example is running fine now after Kathy's suggestions: J2SDK1.4.2_01 J2SDKEE1.3.1 Windows XP Professonal
Nehul NN
Ranch Hand
Joined: Nov 05, 2003
Posts: 45
posted
0
I am having problem running AdviceClient. My configuration Windows 2000 professional edition J2SDKEE1.3_01, build 1.3_01-b01 J2SDK 1.3.1_09-b03
------------------------------------------------------------- java.rmi.AccessException: CORBA NO_PERMISSION 0 No; nested exception is: org.omg.CORBA.NO_PERMISSION: minor code: 0 completed: No org.omg.CORBA.NO_PERMISSION: minor code: 0 completed: No at java.lang.Class.newInstance0(Native Method) at java.lang.Class.newInstance(Unknown Source) 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.j ava:108) at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOAClientSC.java:136) at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source) at headfirst._AdviceHome_Stub.create(Unknown Source) at AdviceClient.go(AdviceClient.java:23) at AdviceClient.main(AdviceClient.java:13) ------------------------------------------------------------- Also followed Kathy's step mention above. But I still get above error. I had mention before things are working with different JVM version. Any common mistake from my end.. I am new to EJB.. so any help will be great. Thank you
Kathy, I too had this problem on WinXP with J2SE 1.3.1 and J2EE 1.3.1. Your solution worked great. Thanks for the help!
JT Toro
Greenhorn
Joined: Mar 08, 2001
Posts: 4
posted
0
Originally posted by Nehul NN: [QB]I am having problem running AdviceClient. My configuration Windows 2000 professional edition J2SDKEE1.3_01, build 1.3_01-b01 J2SDK 1.3.1_09-b03
Try upgrading to J2SDKEE 1.3.1 - I also had problems with 1.3_01-b01 [ November 23, 2003: Message edited by: JT Toro ]
JT Toro
Greenhorn
Joined: Mar 08, 2001
Posts: 4
posted
0
On WinXP: For me didn't work using: J2EE version 1.3_01, build 1.3_01-b01 with either: J2SE (build 1.3.1-b24) or (build 1.4.2_02-b03) But DOES work using: J2EE build 1.3.1-b17 with both J2SEs mentioned above.
John Olmstead
Greenhorn
Joined: Nov 25, 2003
Posts: 6
posted
0
Originally posted by Kathy Sierra: 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
John Olmstead<br />jolmstead2k@yahoo.com
Vishwa Kumba
Ranch Hand
Joined: Aug 27, 2003
Posts: 1064
posted
0
Even I had a terrible time getting my sample helloworld stateless session bean up and running without using the runclient tool with the Sun's RI. Interface/Method names were different but I was not using them in a package. Still I had this CORBA_NO_PERMISSION Exception in the env: Windows 2000 Prof, service pack:3 J2SE - build 1.3.1_04-b02 J2EE - J2SDKEE1.3_01, build 1.3_01-b01 So I made the foll. changes : -Downloaded the latest JDK/J2EE from Sun's site : J2SE - build 1.3.1_09-b03 J2EE - J2SDKEE1.3_01, build 1.3_01-b01 ALSO I PLACED MY CLASSES IN A PACKAGE AND ALSO THE CLIENT CLASS. It works now!
Dan Young
Greenhorn
Joined: Dec 01, 2003
Posts: 1
posted
0
Just a small addendum: Tried all KS's suggested remedy steps. Got the following: java.rmi.AccessException: CORBA NO_PERMISSION Poked around on Google and found this: With 1.3.1 final release, the J2EE SDK became strict about checking adherence to the security policies of J2EE components. Fix: Under the Security screen of the EJB wizard or the Security tab of the EJB inspector in deploytool, click "Deployment Settings..". Under the box "Client Authentication", make sure "Support Client Choice" is checked instead of "Certificate" or "Password". 2. Using Deploytool click "Update & Redeploytool" 3. Run you standalone client again Cheers, DY
Mr. Dan Young, You nailed it on the head! I got AdviceClient working today! WOW! My first EJB... Yeah, Kathy, I think you need to add this to your errata because I was getting the CORBA NO_PERMISSION error as well on Linux (Red Hat 9.0). The steps that Mr. Dan Young, suggested, completed alleviated my problem and I got this: [untz@localhost Advice]$ java -cp $CLASSPATH:AdviceAppClient.jar AdviceClient Read a book, once a year whether you need to or not. Here are the versions that I am using: Java 2 Enterprise Edition version 1.3_01, build 1.3_01-b01 java version "1.4.2_02" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_02-b03) Java HotSpot(TM) Client VM (build 1.4.2_02-b03, mixed mode) I can't believe that I ran my first EJB, thanks Mr. Young & Kathy!
Barry Gaunt
Ranch Hand
Joined: Aug 03, 2002
Posts: 7729
posted
0
Just to mention that I changed the getAdvice() method to getAdviceOfTheDay() and rebuilt and redeployed and it all worked. XP SP1/j2sdk1.4.2/j2sdkee1.3.1
I had the same problem, and the method name change worked. XP SP1/J2SE 1.4.2/J2EE 1.3.1 Thanks for the help Kathy.
Amit Punjwani
Ranch Hand
Joined: Jul 10, 2000
Posts: 50
posted
0
ok! Even I got the same problem i'm using Java 2 Enterprise Edition version 1.3.1, build 1.3.1-b17 and J2SE 1.4 on WIN-XP Pro. I took kathy's suggestion of changing the method name and it works just fine! Thanks Kathy for clearing it out.... least I'll have a good nite sleep now!
badari gururaj
Ranch Hand
Joined: Feb 25, 2002
Posts: 63
posted
0
Same Exception... using java version "1.3.1_09" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_09-b03) Java HotSpot(TM) Client VM (build 1.3.1_09-b03, mixed mode) Java 2 Enterprise Edition version 1.3.1, build 1.3.1-b17 On Win NT 4.0 build 1381 Workaround suggested by Kathy worked...
Same problem as everybody else above but fixed it with Kathy's fix I am running: Windows XP J2SE: 1.4.1, build 1.4.1_04-b01 J2EE: 1.3.1, build 1.3.1-b17 Cheers Dave
SCJP, SCWCD, SCBCD
Andy Nauli
Greenhorn
Joined: Dec 04, 2003
Posts: 5
posted
0
fixed per kathy suggestion windows xp home j2se 1.4.2 j2ee 1.3.1
SC LS
Greenhorn
Joined: Dec 11, 2003
Posts: 1
posted
0
I got the same problem and fixed it according to Kathy's suggestion. I am using j2se version: 1.4.1_01 j2ee version: 1.3.1, build 1.3.1-b17 on WindowsXP. Thanks Kathy. -SC-
Ken Krebs
Ranch Hand
Joined: Nov 27, 2002
Posts: 451
posted
0
I too had the problem; fixed per Kathy's method. OS: Windows 2000 SP3 J2SE: 1.4.2_02, build 1.4.2_02-b03 J2EE: 1.3.1, build 1.3.1-b17
kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg
Chris Lewold
Greenhorn
Joined: Dec 16, 2003
Posts: 25
posted
0
OK .... now I am a "Half Believer" .... Exactly the same symptom and environment here as many others .... WinXP SP1 JDK 1.4.2 or JDK 1.3.1 02 J2EE 1.3.1 I had the same problem, and the solution with the "name-change" workaround also worked for me ..... BUT WHY ???
Kathy Sierra
Cowgirl and Author
Ranch Hand
Joined: Oct 10, 2002
Posts: 1572
posted
0
Originally posted by Chris Lewold: OK .... now I am a "Half Believer" .... I had the same problem, and the solution with the "name-change" workaround also worked for me ..... BUT WHY ???
It's all very confusing actually, and I think it's all part of the Heisenberg Uncertainty Reference Implementation Principle. It's simply a name-mangling bug related to IIOP. Then again, if you could all just get MACS we'd be in great shape I am SOOOOO grateful to all those who have posted their system specs here, and also just for letting me know that you got it working correctly. I think we've solved the problem now, and in the next printing of the book (to happen in January), we'll change the method name. Barry, I think it's really interesting (and funny in a weird RI I'm-not-surprised kind of way) that by making the name longer, even though it still included the characters that match the interface name, you got it to work. So it's more like having a PROPERTY (in the old Javabeans sense of the word) that matches the interface name is really the problem. Because according to Sun, isAdvice() would not work. We know that on some systems getAdvice() does not work. But now you discover that getAdviceWhatever() WILL work. The funny thing too is that according to Javabeans specs, the property name related to getAdvice/isAdvice is "advice" (lower case "a") and not Advice (upper case "A"). Oh well. Again, my apologies to those who've suffered through this. I'm sure you weren't thrilled about becoming still MORE intimate with the RI Cheers, Kathy
Chris Lewold
Greenhorn
Joined: Dec 16, 2003
Posts: 25
posted
0
Ok, I just wanted to test the obvious. I copied the "Advice" classes to "AnotherTest". I renamed the business method from getAdvice to getAnotherTest I got the same error. I just wanted to figure out, whether this bug was just specific to given class names (maybe bad hashing algorithm or whatever)...... BUT this is not the case (as I hoped). General outcome seems to be: If you build an EJB, and name the remote coponent interface >>AnyRemoteComponentInterfaceClassName<<, then you are not allowed to add a method >>getAnyRemoteComponentInterfaceClassName<< In order to do some more "testing the obvious" I changed the remote component interface class name of my new test. (Means I changed AnotherTest.java to AnotherTestRCI.java). I did not change the method however (still getAnotherTest). >>>> as expected that worked, too. Thanks again for the hint ..... great community! great book! great java! great fun! All great (Damn Windows though )
Chris Lewold
Greenhorn
Joined: Dec 16, 2003
Posts: 25
posted
0
BTW .... this applies to every system. Even if you don't have the problem when developing the bean on an e.g. Mac - you never know where it is deployed. That's a rather dangerous problem btw. - and even if this is not part of the exam it would be great if that is mentioned in a new version of the book.
Arash A
Greenhorn
Joined: Dec 20, 2003
Posts: 5
posted
0
Thanks to all who saved my time. I had the same problem. I changed everything in the program. Used three different computers and ...... really mad after 3 days. So now I can go forward.
Vivek Viswanathan
Ranch Hand
Joined: Mar 03, 2001
Posts: 350
posted
0
Hi Kathy In the AdviceBean 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
I don't know if this combination is already mentioned. But I also had the same problem and fixed it by renaming the method giveAdvice. Looks like a problem the server thinks it's some kind of property (getAdvice is the getter method for himself?). Just for the records: setAdvice works fine. This is my configuration: J2EE: build 1.3.1-b17 J2SE: 1.3.1_01 OS: Windows XP Pro, Version 2002, Service Pack 1 Thanx Kathy Now back to study... Mario (SCJP 1.4, SCWCD)
James Cary
Greenhorn
Joined: Apr 10, 2004
Posts: 1
posted
0
Had the same error on WinXP. Don't know if this is significant or not, but here's the goods on system info: J2SE: 1.4.2_03 J2EE: 1.3.1 Now, here's the info I haven't seen before, may or may not be relevant. I'm using eclipse 3 (Milestone 6). Anyone else having this problem using an IDE? Also, I had J2EE 1.4 installed, but uninstalled it to put 1.3.1 on. Again, didn't see that anyone had "downgraded" their level of J2EE
The significant problems we face cannot be solved by the same level <br />of thinking that created them - Albert Einstein
seemapanth Joshi
Ranch Hand
Joined: Nov 28, 2004
Posts: 47
posted
0
This site is great and I feel almost guilty by asking if someone could please-please post a link to this discussion on top of the scbcd forum.
I got the same problem and googled all the way here...... Not that I did not learn a thing or two but it would be such a great 1 millionth favor!
My configuration Windows XP, J2EE 1.3.1, j2sdk1.4.1_07