Hi all,
I'm back. I think something is wrong somewhere. Let me explain what I'm
trying to achieve.
Reading thru Writing Enterprise Application with J2EE(Monica Pawlan, Sept
27th 2000 ) I build the very first example with CalcBean. After I run in
locally(localhost) using j2ee server from Sun I tried to deploy the bean to
a different machine.
I renamed the JNDI name for the one was locally deployed. I've redeployed
the application made from a web tier( on single Servlet and one single html
file) and the unused session stateless bean on my machine.
I've created a second application made only from the bean described above
and I deployed on the second machine. The JNDI name for second one is
"calcs".
When I'm trying to run it the lookup fails - the name "calcs" given to the
second bean is not visible.
(javax.naming.NameNotFoundException: calcs not found)
Here is the init method where it fails.

public void init(ServletConfig config) throws ServletException{

//Look up home interface
   try
   {
     //InitialContext ctx = new InitialContext();
    //new code
    Properties p = new Properties();
    p.put(Context.PROVIDER_URL, "iiop://ddd.ddd.ddd.ddd:1050");
    InitialContext ctx = new InitialContext(p);

    Object objref = ctx.lookup("calcs");
     homecalc = (CalcHome)PortableRemoteObject.narrow(objref,
CalcHome.class);
   }
   catch (Exception NamingException)
  {
     NamingException.printStackTrace();
    throw new ServletException( NamingException );
   }
  }

An additional test I've replace ddd.ddd.ddd.ddd with my IP address and
rename calcs with the name of the "local" EJB and it worked just fine.
 I have now some doubts about some security issues(policies) that I have to
take care of.
If anyone had ever a similar problem, please give me a hint to move on.
Thanks.

Regards,
Mircea

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to