PDA

View Full Version : java.security.AccessControlException: access denied


lardbucket
10-09-2004, 01:40 PM
I have installed (apt-get install) the debian package tomcat4, and I put the Laszlo core (lps-2.2) module in the webapps directory. This seems to work fine (the main HTML page displays fine). Unfortunately, any Laszlo pages I try to load fail with the following error: (I tried /lps-2.2/examples/hello.lzx)


Error: java.security.AccessControlException: access denied (java.io.FilePermission /var/lib/tomcat4/webapps/lps-2.2/WEB-INF/lps/work/logs/lps.log write)
at java.security.AccessControlContext.checkPermission (AccessControlContext.java:269)
at java.security.AccessController.checkPermission(Acc essController.java:401)
at java.lang.SecurityManager.checkPermission(Security Manager.java:524)
at java.lang.SecurityManager.checkWrite(SecurityManag er.java:954)
at java.io.File.createNewFile(File.java:827)
at com.laszlosystems.servlets.responders.ResponderLOG CONFIG.configure(ResponderLOGCONFIG.java:244)
at com.laszlosystems.servlets.responders.ResponderLOG CONFIG.configureWithLPSConfig(ResponderLOGCONFIG.j ava:149)
at com.laszlosystems.servlets.responders.ResponderLOG CONFIG.configure(ResponderLOGCONFIG.java:119)
at com.laszlosystems.servlets.LZServlet.initLPS(LZSer vlet.java:105)
at com.laszlosystems.servlets.LZServlet.doGet(LZServl et.java:232)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.ac cess$000(ApplicationFilterChain.java:98)
at org.apache.catalina.core.ApplicationFilterChain$1. run(ApplicationFilterChain.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:172)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2422)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:163)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(Co yoteAdapter.java:199)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:828)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:700)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:584)
at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)


Any ideas why this would happen? (as a sidebar, I am running this on a below-spec computer with 450 mhz and 32 MB ram, but that doesn't seem to be the problem here)

bloch
10-09-2004, 01:43 PM
Looks like a permissions problem -- the stack trace indicates this.

Likely, for some reason, the java process doesn't have write permissions in the WEB-INF/lps/work/logs directory.


-Eric

lardbucket
10-09-2004, 01:47 PM
Yeah, I kinda guessed at that. the whole directory structure is chmodded 0777, so that's not the problem. I even touched the file to make sure that wasn't the problem. Any idea how I might give permission to java to use those files?

bloch
10-09-2004, 02:11 PM
AccessControlException might mean that you have tomcat4 configured to disallow writes or something like that. I'd look up the javadoc on that.

I know nothing about the debian tomcat4 package.


-Eric

lardbucket
10-09-2004, 02:20 PM
Ok, thanks for the help. I'll take a look.

lardbucket
10-09-2004, 02:48 PM
Sorry to bump the thread, but what directory are the JARs in that need file access?

EDIT:
Never mind. Sorry. I should have had this figured out much quicker. In /etc/init.d/tomcat4, there are the lines:

# Use the Java security manager? (yes/no)
TOMCAT4_SECURITY=yes


Change the yes to a no and it works fine. (There's probably a better, more secure way to do this, but it works for me right now)