geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbolk <db...@hotmail.com>
Subject JNDI lookup in GEronimo 2
Date Fri, 13 Jul 2007 20:18:28 GMT

Hi all, 
I am very new to the EJB 3 world, and trying to make my way with one of the
example. I successfully created number of EJB 3 Session beans. I was able to
use those session beans from WEB(Local Interface)  application deployed in
the same EAR together with my session beans. 
Now I am trying to go one step forward and trying to access my session beans
from plain Java class that have not been deployed into Geronimo. 
I tried to run following code:
 
javax.naming.Context ic;
	    Properties properties = new Properties();
	    properties.put("java.naming.factory.initial",
"org.openejb.client.RemoteInitialContextFactory");
	    properties.put("java.naming.provider.url", "127.0.0.1:4201");
	    properties.put("java.naming.security.principal", "myuser");
	    properties.put("java.naming.security.credentials", "mypass");

	    
	    ic = new InitialContext(properties);
	    Object session = ic.lookup("/DAOSession");

at this point I am getting 
javax.naming.AuthenticationException: This principle is not authorized.

If I am removing principal and credentials properties -  I am getting Object
can not be found Exception. 

class name of my session bean is DAOSession. 

PLease let me know, what I am doing wrong. 

THank you.


-- 
View this message in context: http://www.nabble.com/JNDI-lookup-in-GEronimo-2-tf4076692s134.html#a11586830
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message