how to call an ejb using wsad and jsp and was 5.1 test environment


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: how to call an ejb using wsad and jsp and was 5.1 test environment

  1. #1
    Join Date
    Nov 2005
    Posts
    2

    how to call an ejb using wsad and jsp and was 5.1 test environment

    Hi,

    Iam using the following code to access the ejb from my jsp.And iam getting an error.My environment is

    wsad5.1,jsp,j2ee 1.3.

    Can any body help me.My jsp code is

    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.ibm.websphere.naming.WsInitialContextFactory");
    env.put(Context.PROVIDER_URL, "iiop://localhost:9081");
    Context context = new InitialContext(env);

    home = context.lookup("ejb/Hello");

    where ejb/Hello is the ejb name in ejb-jar.xml file


    E SRVE0026E: [Servlet Error]-[ejb/RatingEJB]: javax.naming.NameNotFoundException: ejb/RatingEJB. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound
    at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNaming Impl.java:964)


    thanks

  2. #2
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    255
    Use the JNDI name java:comp/env/ejb/Hello
    Happiness is good health and a bad memory.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center