hi,

I have a problem with creating instances from my Servlet (I'm using
stand-alone tomcat 3.2.1) after setting SecurityManager.
here is a demonstration Servlet that issues the problem:


I've created the attached Servlet and placed it under
"jakarta-tomcat-3.2.1\webapps\examples\WEB-INF\classes". then when I use
internet Explorer to generate the GET request with the following URL:
"http://localhost:8080/examples/servlet/Test" I get the Exception (at the
end of this message).
when I delete either line #1 or #2, there is no problem.
any ideas?
help would be greatly appreciated.
        ofer

note: in the original problem I had to set a RMISecurityManager in order to
use rmi.
////////////////////////////////////////////////////////////////////////////
/////////////////
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class Test extends HttpServlet {
    public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
        throws IOException, ServletException
    {
        //line #1
        System.setSecurityManager(new SecurityManager());
        
        //line #2
        new Test();
                
        PrintWriter out = response.getWriter();
        out.write("test passed");
        out.close();
    }    
}
////////////////////////////////////////////////////////////////////////////
/////////////////

exception:
2001-01-17 12:31:02 - PoolTcpEndpoint: Endpoint
ServerSocket[addr=0.0.0.0/0.0.0.
    0,port=0,localport=8080] ignored security exception:
java.security.AccessControlException: access denied 
    (java.net.SocketPermission 127.0.0.1:1493 accept,resolve) -
java.security.AccessControlException: access denied 
    (java.net.SocketPermission 127.0.0.1:1493 accept,resolve)
        at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
:272)
        at
java.security.AccessController.checkPermission(AccessController.java:399)
        at
java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
        at java.lang.SecurityManager.checkAccept(SecurityManager.java:1162)
        at java.net.ServerSocket.implAccept(ServerSocket.java:245)
        at java.net.ServerSocket.accept(ServerSocket.java:222)
        at
org.apache.tomcat.service.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:
286)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:402)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
        at java.lang.Thread.run(Thread.java:484)


Thanks in advance, Alon.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to