-
Access to JNDI service of Sun J2EE Reference Implementation server
Hi, I'm using Sun J2EE Reference Implementation server. The following
program results
javax.naming.NameNotFoundException although the ejb/greeter component
is accessible from JSP environment.
import java.util.*;
import javax.naming.*;
public class jndi_test {
public static void main(String args[]) {
Hashtable env = new Hashtable();
env.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory")
;
env.put("java.naming.provider.url","iiop://localhost:1050");
try{
InitialContext initContext = new InitialContext(env);
Object objref = initContext.lookup("java:comp/env/ejb/greeter");
}
catch(Exception ex)
{ System.out.println( ex); }
}
}
What do I wrong? Thanks for any help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks