This should work if your session bean is deployed on JBoss:

         Context context = new InitialContext( getProperties() );
         Object node = context.lookup("ClientRemote");
         ClientHome home = (ClientHome)PortableRemoteObject.narrow(node,
ClientHome.class);
         ClientRemote bean = home.create();
         bean.doSomething();

Here's the all-important property getter you supply:

    Properties getProperties()
    {
         Properties properties = new Properties();
         properties.put("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
         properties.put("java.naming.provider.url", "localhost:1099");
         properties.put("java.naming.factory.url.pkgs", "org.jboss.naming");
         return properties;
    }

----- Original Message -----
From: "Marco Tedone" <[EMAIL PROTECTED]>
To: "JBoss-user-list" <[EMAIL PROTECTED]>
Sent: Sunday, January 19, 2003 3:15 PM
Subject: [JBoss-user] Using a Bean outside from the Jboss JVM


Hi, I deployed succesfully a simple session bean under the /default
directory. I can't use this bean from a client not deployed with the same
bean.jar. I know that when creating the InitialContext some properties shall
be present. Could someone send me some code on how to use a Session bean
deployed under Jboss from an external class?


-------------------------------------------------------
This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your  SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your  SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to