wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Need Help with AdviceClient Error 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 "Need Help with AdviceClient Error" Watch "Need Help with AdviceClient Error" New topic
Author

Need Help with AdviceClient Error

Nehul NN
Ranch Hand

Joined: Nov 05, 2003
Posts: 45
My configuration
Windows 2000 professional edition
J2SDKEE1.3_01, build 1.3_01-b01
J2SDK 1.3.1_09-b03
Error message when I run >> java AdviceClient

----------------Error Message-----------------------------
Lookup DONE!!!
Narrowing DONE!!!
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:26)
at AdviceClient.main(AdviceClient.java:13)
------------------------End of Error message---------------------------
Nehul NN
Ranch Hand

Joined: Nov 05, 2003
Posts: 45
Kathy Should take note of this.

Q1: What should I do if I encounter the following exception: java.rmi.AccessException: CORBA NO_PERMISSION 0 No?
With 1.3.1 final release, the J2EE SDK became strict about checking adherence to the security policies of J2EE components.
How can you make your application run under the Final Release?
1. If you don't want security checks, do the following:
Use the deploytool to build a deployment descriptor that does not require a strict security policy:
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. Now from Deplotool click on "Update & redeploy"
3. Run your AdviceClient again.
You are all set.
It worked for me on following platforms
J2SDKEE1.3 or J2SDKEE1.4
J2SDK1.3 or J2SDK 1.4
All on Win2k
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Thank-you! I was under the impression that this was not for the *final* release of 1.3.1, but I could be wrong about the Windows version. On the Linux and Solaris versions, they indeed tightened the security just as you mentioned, (and your solution was exactly the fix -- "Support client choice"), in EARLIER releases, but then they UN-tightened it again in the final releases because we all complained.
But I definitely want to get to the bottom of this...
Is anyone else getting this problem?
(and please let me know if you are, and which versions).
Is there anyone who has recently downloaded the final release of 1.3.1 who is NOT getting this problem? Because Nehul, this is the first I've heard of this in a long time, and I thought they had changed that quite a long time ago. My Linux distribution is final 1.3.1 and it does not have this problem.
I definitely want to post something about this if others have this problem, though...
cheers,
Kathy
Joe McIntyre
Ranch Hand

Joined: Nov 20, 2003
Posts: 121
Hi all:
Having the same problem:
jdk version 1.3.1_01
jdk build 1.3.1_01
j2sdkee version 1.3_01
j2sdkee build 1.3_01-b01
P.S. Just got Head First EJB - FANTASTIC!!! Thanks. I've been waiting for years for something like this!
Nehul NN
Ranch Hand

Joined: Nov 05, 2003
Posts: 45
Wally,
I had same problem with environment mention your post. Please follow the step describe above & your EJB client should run without any error.
--Nehul
Joe McIntyre
Ranch Hand

Joined: Nov 20, 2003
Posts: 121
Nehul:
I followed your procedure, and it worked. Thanks! (I was confused because I also had a problem with malfunctioning Norton Internet Security's Personal Firewall, which is installed on my development machine. What a pain!)
Steve Morrow
Ranch Hand

Joined: May 22, 2003
Posts: 657

Unfortunately, several tries with Nehul's solution didn't eliminate the error for me.
I'm using the following:
Windows XP
j2sdk 1.3.1
j2sdkee 1.3.1
Any other ideas?
Steve Morrow
Ranch Hand

Joined: May 22, 2003
Posts: 657

Well, I found the very helpful "errata" on O'Reilly's. I'll post what worked for me here, with Kathy's grace...
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!

Thanks, Kathy, and I love the book so far...
[ November 22, 2003: Message edited by: Steve Morrow ]
Nehul NN
Ranch Hand

Joined: Nov 05, 2003
Posts: 45
Steve,
Kathy suggested for different problem. Here is the link http://www.coderanch.com/t/158262/java-EJB-SCBCD/certification/CORBA-bad-operation-error-RI
My problem was permission related (explain reason too). Kathy's solution was related to org.omg.CORBA.BAD_OPERATION: minor code: 0 completed: No.
--Nehul
Steve Morrow
Ranch Hand

Joined: May 22, 2003
Posts: 657

Thanks for the link - I didn't see that one when I was trying to track down a solution. I appreciate the help!
Bipin Kumar
Greenhorn

Joined: May 07, 2004
Posts: 4
It worked for me by
1. Undeploying the bean
2. Changing the name of the method
3. and Redeploying
But why does it happen? pl. answer
Anindya Saha
Greenhorn

Joined: Mar 12, 2006
Posts: 6
thanks very much nehul. I am preparing for SCBCD. This saved a hell lot of time. I scratched for 1 hour to find the problem but in vain.

your steps proved useful.
Rahul Snh
Greenhorn

Joined: Dec 28, 2007
Posts: 1
Is "Kathy Sierra Cowgirl and Author Member # 37766" really the "Kathy" who wrote the book HF EJB. If yes then lady please update: http://www.oreilly.com/catalog/hfjejb/errata/hfjejb.confirmed

with this issue, since you recognize the issue. I faced it and it dazed me a bit - had I not googled it could have been a potential show-stopper.

Nonetheless H F EJB is an amazing book - hugely appreciate your effort behind it.

- Rahul
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need Help with AdviceClient Error