I tried to put only the org.jnp.interfaces.NamingContextFactory but then other jars were required. At the bottom line, I put in the path all the %JBOSS_HOME%/lib and %JBOSS_HOME%/server/default/lib jars and it worked. Thank you all for your help
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Rod Macpherson Sent: Monday, January 20, 2003 1:47 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Using a Bean outside from the Jboss JVM Right, you at least need the org.jnp.interfaces package from JBoss client classes: /jboss/client. ----- Original Message ----- From: "Marco Tedone" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, January 19, 2003 4:07 PM Subject: RE: [JBoss-user] Using a Bean outside from the Jboss JVM Thank your for the code. I still get an error while doing what you suggested: NamingException = javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory] This is because I haven't got the Jboss libraries in the execution path. Should I have these libraries in the path? Is there a cleaner way? -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Rod Macpherson Sent: Sunday, January 19, 2003 11:40 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Using a Bean outside from the Jboss JVM 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 ------------------------------------------------------- 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 ------------------------------------------------------- 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