Help me out with this!
I try to connect a servlet with an application server using RMI.
Without the RMI code, the servlet runs perfectly.
The RMI code itself is also good, because I previously used that
same source code in a normal client Java application before, and
that worked correctly.
But when I use this RMI code in my servlet, the servletrunner produces
the following exception when trying to execute the servlet through
my web browser (IE 4):
SOURCE CODE
import java.rmi.Naming;
import java.rmi.RemoteException;
import RoutePlanner.*;
public class RouteRequest extends HttpServlet
{
MapInterface map = null;
public Map copymap = null;
public void doGet (HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out;
String title = "RoutePlanner RouteRequest Client";
response.setContentType("text/html");
out = response.getWriter();
out.println("<HTML><HEAD><TITLE>");
out.println(title);
out.println("</TITLE></HEAD><BODY>");
out.println("<H1>" + title + "</H1>");
out.println("Importing objects from server...");
try {
map = (MapInterface)Naming.lookup("MapServer"); <-- PROBLEM
LINE!!!!
copymap = new Map();
Link link = new Link();
for(int i = 0; i < map.getSize(); i++) {
link = map.getLinkAt(i);
copymap.addLink(link);
}
}//try
catch (Exception e) {
out.println("Import Error: " + e.getMessage());
}
out.println("Import completed.");
out.println("</BODY></HTML>");
out.close();
}//doGet
}//RouteRequest
EXCEPTION:
java.lang.NoSuchMethodError: sun.rmi.transport.ConnectionInputStream:
method readObject(Z)Ljava/lang/Object; not found at
java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:403).
Could it be that the servletrunner does not support RMI usage
in servlets, which obliges me to run it on a web server?
I use JDK 1.1.8 and JSDK 2.0 with its servletrunner.exe on a Windows NT
machine.
Respond a.s.a.p.
Michel
Origin IT Netherlands
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html