You should add the geronimo-security jar and openejb-core jar to the 
application classpath. The two jars are in geronimo repository folder.

Regards,
Radu Dumitrescu
  ----- Original Message ----- 
  From: [EMAIL PROTECTED] 
  To: [email protected] 
  Sent: Monday, February 05, 2007 7:37 PM
  Subject: Problem to acess protected EJB from a java client application


  Hi all

  I'm having a problem accessing protected EJB from a java client application. 
When trying to create remote object the application throws 
java.rmi.AccessException. It works fine if no application security is applied.

  The code and deployment files were downloaded from Geronimo EJB sample, but 
lots of changes have been made.

  Here's the code snippet

  Hashtable env = new Hashtable();
  
env.put("java.naming.factory.initial","org.openejb.client.RemoteInitialContextFactory");
  env.put("java.naming.provider.url","localhost:4201");
  env.put("java.naming.security.principal","system");
  env.put("java.naming.security.credentials","manager");

  javax.naming.InitialContext initialContext = new 
javax.naming.InitialContext(env);

  Object objRef = 
initialContext.lookup("org.apache.geronimo.samples.bank.ejb.BankManagerFacadeBean");
  BankManagerFacadeHome bankManagerHome = (BankManagerFacadeHome)objRef;

  //the next line throws java.rmi.AccessException
  bankManager = bankManagerHome.create(); 

  The URL's of the application's deployment descriptors are:
  http://212.176.60.113/jtest/application.xml
  http://212.176.60.113/jtest/geronimo-application.xml
  http://212.176.60.113/jtest/ejb-jar.xml
  http://212.176.60.113/jtest/openejb-jar.xml

  Could somebody suggest where is the problem ?

  Thenks in advance

  Vladimir




------------------------------------------------------------------------------



  -- 
  This message was scanned for spam and viruses by BitDefender.
  For more information please visit http://linux.bitdefender.com/
-- 
This message was scanned for spam and viruses by BitDefender.
For more information please visit http://linux.bitdefender.com/

Reply via email to