| Author |
A small EJB problem in the NamingContextFactory
|
Narendran Nair
Ranch Hand
Joined: Sep 25, 2003
Posts: 35
|
|
Hello Every one I started to use JBoss from last week onwards and i was successful enough to deploy my first Session Bean in the JBoss4 Server with out any errors. But when i tried to write the client application, i was not successful as the deployment. the file compiles correctly withone any warnings and errors but when i try to run the application it gives a small error. First let me tell abt the bean i wrote . it is a small bean that returns a string value and it is similar to the normal HelloWorld applications. The deployed jar has got the 3 needed class files and the ejb-jar.xml file. The client program compiles fine and here it is .... -------------------------------------------------------------- import javax.naming.Context; import javax.naming.InitialContext; import java.util.Hashtable; public class HelloWorldClient { public static void main(String args[]){ Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); env.put(Context.PROVIDER_URL,"localhost:1099"); //env.put("java.naming.factory.url.pkgs","org.jboss.naming rg.jnp.interfaces"); env.put("java.naming.factory.url.pkgs","org.jboss.naming"); try{ Context ctx = new InitialContext(env); Object obj = ctx.lookup("HelloWorld"); HelloWorldHome home = (HelloWorldHome) javax.rmi.PortableRemoteObject.narrow(obj,HelloWorldHome.class); HelloWorld helloWorld = home.create(); System.out.println(helloWorld.hello()); helloWorld.remove(); }catch(Exception ex){ System.out.println(ex.getMessage()); } } } ------------------------------------------------------------------- when i tried to run the above program it gives this message and exits Cannot instantiate class: org.jnp.interfaces.NamingContextFactory Can any one help me in this ... i am using Jboss4 and J2SE1.4 thanking you in advance.. Regards Narendran
|
Narendran J S<br />SCJP 1.4<br /><a href="http://narendranj.blogspot.com" target="_blank" rel="nofollow">http://narendranj.blogspot.com</a><br /><a href="http://narendranj.blogspot.com" target="_blank" rel="nofollow">http://techboom.blogspot.com</a><br /><a href="http://bookmarks-share.blogspot.com" target="_blank" rel="nofollow">http://bookmarks-share.blogspot.com</a>
|
 |
 |
|
|
subject: A small EJB problem in the NamingContextFactory
|
|
|