Hey,
Shin!! I am sorry to say but I did not see the face of success after coding the
servlet the way you told me. Here is my servlet code snippet: (below that is the exception trace)
==============================
System.out.println("Servlet Entered");
response.setContentType("text/html");
System.out.println("HTML Content Type Set");
out=response.getWriter();
System.out.println("PrintWriter Object Created");
Properties p=new Properties();
p.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
System.out.println("p.put(1) Created");
p.put("java.naming.provider.url", "iiop://localhost:1050");
System.out.println("p.put(2) Created");
InitialContext initial=new InitialContext(p);
System.out.println("Context Object Created");
Object objref=initial.lookup("DisplayWEBJNDI");
System.out.println("Lookup Done Successfully");
DisplayHome home=(DisplayHome)PortableRemoteObject.narrow(objref, DisplayHome.class);
System.out.println("Home Object Created");
Display ref=home.create();
System.out.println("Remote Object Created");
out.println("<html><title>The Results Page</title>");
out.println("<body<hr>");
out.println("<h1>The Client Side Response is: ");
out.println(ref.display());
out.println("</h1>");
out.println("<hr>");
out.println("</body></html>");
System.out.println("Responses Done");
out.flush();
System.out.println("Output Stream Flushed");
ref.remove();
System.out.println("Remote Object Removed");
================================
Exception here:
================================
Servlet Entered
HTML Content Type Set
PrintWriter Object Created
p.put(1) Created
p.put(2) Created
Context Object Created
Lookup Done Successfully
Exception in Servlet Client Code: javax.naming.NameNotFoundException [Root excep
tion is org.omg.CosNaming.NamingContextPackage.NotFound]
javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.NamingC
ontextPackage.NotFound
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHe
lper.java:34)
at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub
.java:400)
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:368)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:417)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:395)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at DisplayServletClient.service(DisplayServletClient.java:34)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServl
et.java:428)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java
:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationF
ilterChain.java:197)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilt
erChain.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:172)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
====================
and a long trace of catalina exception trace.
What else could have gone wrong??
Still trying!!
Thanks,
Tualha Khan