"David J. Hanses" wrote:

> I am trying to get JServ 1.0b4 running on Apache 1.3.6 on
> NT 4.0 SR4.
> My servlet is dying with the following error message from the java.security
> package. Can anyone offer a suggestion on how
> to go about debugging this? This servlet has been running
> successfully on several other webserver configurations.
> The code that is failing is trying to locate a properties
> file in the classpath. Note that two properties files load
> just fine and the classpath is correctly parsed. In fact
> the same piece of code is executed 2 times successfully and
> then fails with this error on the third iteration. And yes my
> properties file is indeed in my classpath right next to
> one of the successfully loaded ones.
>
> I have already invested 3 days in getting Jserv to work.
> Please help!
>

The problems you are running into are *not* Apache JServ issues.  Instead, they
relate to the new security policies that were added with Java2.  If you have
not modified the default policies, this is not too surprising.  The policies
under which all Java2 applications run are defined in a "java.policy" file,
whose location depends on where you installed it.  If $JAVA_HOME is the
directoy in which you installed the JDK, look in the following (text) file:

    $JAVA_HOME/jre/lib/security/java.policy

This includes all the security policies that the JVM will enforce.  For more
information, see the information on Security in the Java2 documentation bundle,
or the "Security in Java 1.2" trail in the JavaSoft tutorial.

>
> My jserv.properties file is appended.
>
> ----------------------------------
> java.lang.ExceptionInInitializerError: java.security.AccessControlException:
> access denied (java.util.PropertyPermission java.class.path read)
>

This implies that you are trying to access the system property
"java.class.path", which is not allowed by default.  To enable it, add the
following line to your java.policy file:

    permission java.util.PropertyPermission "java.class.path","read";


>  at java.security.AccessControlContext.checkPermission(Compiled Code)
>  at java.security.AccessController.checkPermission(Compiled Code)
>  at java.lang.SecurityManager.checkPermission(Compiled Code)
>  at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1222)
>  at java.lang.System.getProperty(System.java:535)
>  at com.hksystems.base.util.Prop.getProperties(Compiled Code)
>  at
> com.hksystems.ui.PageControllerCreator.<clinit>(PageControllerCreator.java:2
> 74)
>  at com.hksystems.ui.OAJob.run(Compiled Code)
>  at OA.doGet(OA.java:65)
>  at OA.doPost(OA.java:56)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:521)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
>  at org.apache.jserv.JServConnection.run(JServConnection.java:359)
>  at java.lang.Thread.run(Thread.java:479)
> Apache JServ: An error occurred listening to the port:
> java.security.AccessControlException: access denied
> (java.net.SocketPermission 127.0.0.1:3664 accept,resolve)

And this one says you are trying to accept connections on port 3664 on the
local machine.  As stupid as it might seem, the default permissions let you
listen for incoming connections on local ports, but not accept connections on
them!  To fix this, change the line that says:

    permission java.net.SocketPermission "localhost:1024-","listen";

to say:

    permission java.net.SocketPermission "localhost:1024-","listen,accept";

(which implies "resolve" permission as well).  Because you are using an IP
address, you might also need to add a line:

    permission java.net.SocketPermission "127.0.0.1:1024-","listen,accept";

as well.  In either case, you also have the option to be more specific about
what port number (or range of port numbers) Java programs are allowed to accept
connections on.  Unless you change the default, Apache JServ will need to be
able to accept connections on port 8007.  See the API docs for
java.net.SocketPermission for the details.

Craig McClanahan




----------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to