----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Java Apache Users
I am using the following:
Apache JServ version: Apache_JServ-1.0b3
Apache version: 1.3.6
OS: SunOS, Solaris 2.7
I am running an RMI Servlet client using using JDK 1.2.1 .
To protect the RMI servlet from a malicious RMI servlet stub, I want to
set a Security Manager , similar to the one
that is set in the RMI client example shown on page 413 of Jason
Hunter's Java Servlet Programming book.
When my RMI servlet was still a Java application that was invoked via
CGI, I also set a Security Manager and it worked then.
But when I include the lines to set the security manager in the RMI
Servlet, the foll. 2 things happen:
1. Netscape Communicator 4.7 displays a pop-up window saying:
Netscape: Error
The document contained no data. Try again later, or contact the
server's administrator.
2. The applet that invokes the servlet refuses to accept another query,
even if I clear Netscape via Shift and Reload.
Neither mod_jserv.log file nor apache_jserv.log, nor any of the
other log files show an Error or Emergeny entry.
Does anyone know what is wrong here or where I should search ? If I
comment the security manager lines out,
everything works fine, but I want to include them for security purposes.
I set the security manager as follows:
public void doGet (HttpServletRequest req, HttpServletResponse res){
try{
// Throws an exception:
// if (System.getSecurityManager() == null){
// log("================= Setting the security
manager");
// System.setSecurityManager(new RMISecurityManager());
// }
PrintWriter out;
StringBuffer buf = new StringBuffer();
String title = "RMI Servlet Client output";
res.setContentType("text/html");
out = res.getWriter();
String url = "< url to my rmi server > ";
try{
rmi_obj=(RMIServer)Naming.lookup(url);
if (rmi_obj == null){
System.err.println("Error: Naming.lookup returned
null");
}
}
catch (Exception ex){
throw new ServletException("Error looking up host:
"+url);
}
--- end of code snippet ---
Thank you for your help.
Annette
--
Annette Strupp-Adams
Senior Systems Analyst
[EMAIL PROTECTED]
National Library of Medicine
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]