geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <djen...@gluecode.com>
Subject Re: Help! Geronimo+JNDI
Date Thu, 14 Oct 2004 18:11:29 GMT
I'd agree about the app client except that it can only run on the same 
machine as the server at the moment.  If this is sufficient, app client 
is a much better solution.

david jencks

On Oct 14, 2004, at 10:49 AM, David Blevins wrote:

> To lookup EJBs, he needs to use the properties described here 
> http://openejb.org/remote-server.html
>
> Those are:
>
>   Properties p = new Properties();
>   p.put("java.naming.factory.initial", 
> "org.openejb.client.RemoteInitialContextFactory");
>   p.put("java.naming.provider.url", "yourhost.com:4201");
>   p.put("java.naming.security.principal", "myuser");
>   p.put("java.naming.security.credentials", "mypass");
>   InitialContext ctx = new InitialContext(p);
>
> He's also better off using an app client, in which case he doesn't
> need to setup any JNDI information.
>
>
> -David
>
> On Thu, Oct 14, 2004 at 01:33:30PM -0400, Davanum Srinivas wrote:
>> Can someone help Rohit?
>>
>> thanks,
>> dims
>>
>>
>> On Thu, 14 Oct 2004 21:32:59 +0530, Varicatt, Rohit (Cognizant)
>> <vrohit@blr.cognizant.com> wrote:
>>>
>>>
>>> Hi Davanum,
>>>
>>> This is probably inappropriate, but having been on the Geronimo 
>>> mailing
>>> list,I decided to try Geronimo out and am up against a roadblock. I
>>> wrote a simple HelloWorldBean and successfully deployed it. But my
>>> client repeatedly gives me a NameNotFoundException. Am I doing 
>>> something
>>> wrong? I would be very grateful if you could help me.
>>>
>>> The client code :
>>> import java.util.Hashtable;
>>> import javax.naming.InitialContext;
>>> import javax.naming.NamingException;
>>> public class FirstClient {
>>>         public static void main(String[] args) {
>>>                 try {
>>>                         Hashtable env = new Hashtable();
>>>                         env.put(
>>>                                 "java.naming.factory.initial",
>>>
>>> "com.sun.jndi.rmi.registry.RegistryContextFactory");
>>>                         env.put("java.naming.factory.url.pkgs",
>>> "org.apache.geronimo.naming");
>>>                         env.put("java.naming.provider.url",
>>> "rmi://localhost:1099");
>>>                         InitialContext ctx = new InitialContext(env);
>>>                         Object lookupResult =
>>> ctx.lookup("HelloWorldHome");
>>>                 }
>>>                 catch (NamingException e) {
>>>                         e.printStackTrace();
>>>                 }
>>>         }
>>> }
>>>
>>> The jndi-name I have declared in openejb-jar for my bean is
>>> "HelloWorldHome".
>>>
>>> Thank you,
>>> Rohit
>>>
>>> This e-mail and any files transmitted with it are for the sole use 
>>> of the intended recipient(s) and may contain confidential and 
>>> privileged information.
>>> If you are not the intended recipient, please contact the sender by 
>>> reply e-mail and destroy all copies of the original message.
>>> Any unauthorised review, use, disclosure, dissemination, forwarding, 
>>> printing or copying of this email or any action taken in reliance on 
>>> this e-mail is strictly
>>> prohibited and may be unlawful.
>>>
>>
>>
>> -- 
>> Davanum Srinivas - http://webservices.apache.org/~dims/
>


Mime
View raw message