# Tomcat 5.5 Zugriffsproblem unter Linux



## st*ex (13. Nov 2007)

Hallo.

Ich habe den Tomcat unter Linux aufgesetzt und eine Web-Anwendung eingebunden.
Jetzt habe ich folgendes Problem, wenn ich meine Web-Anwendung im Browser aufrufen
will bringt er mir einnen ERROR-500 und in der LOG-Datei steht folgender Fehler:


```
12.11.2007 11:02:46 org.apache.catalina.core.ApplicationContext log
SCHWERWIEGEND: StandardWrapper.Throwable
java.security.AccessControlException: access denied (java.io.FilePermission /logs/webanwendung.log write)
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
	at java.security.AccessController.checkPermission(AccessController.java:546)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
	at java.lang.SecurityManager.checkWrite(SecurityManager.java:962)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:169)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
	at org.apache.log4j.FileAppender.setFile(FileAppender.java:272)
	at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:151)
	at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:123)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:87)
	at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:645)
	at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:603)
	at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:500)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:406)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:432)
	at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:327)
	at com.sportwetten.mcbet.util.LogUtils.configure(Unknown Source)
	at com.sportwetten.mcbet.Sportline.init(Unknown Source)
	at javax.servlet.GenericServlet.init(GenericServlet.java:211)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
	at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
	at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:114)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
	at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:757)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:641)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
	at org.apache.catalina.core.ApplicationDispatcher.access$0(ApplicationDispatcher.java:305)
	at org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(ApplicationDispatcher.java:81)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:293)
	at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:688)
	at org.apache.jasper.runtime.PageContextImpl.access$10(PageContextImpl.java:662)
	at org.apache.jasper.runtime.PageContextImpl$11.run(PageContextImpl.java:645)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:643)
	at org.apache.jsp.index_jsp._jspService(index_jsp.java:52)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
	at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
	at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:177)
	at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
	at java.lang.Thread.run(Thread.java:619)
```


Ich habe schon bei google und in anderen Foren nach einer Lösung zu diesem Problem gesucht, aber alles
was ich gefunden habe das ich die Zugriffsrechte setzten soll. Das habe ich für das webapps, log und das HOME-Verzeichnis des Tomcats gemacht (Zugriffsrecht: rwx für alle). Der Fehler kommt aber trotzdem noch kann
mir jemand weiterhelfen wäre sehr nett.


----------



## st*ex (21. Nov 2007)

ich habe den tomcat jetzt noch gelöscht und neuinstalliert
diesmal habe ich aber die tomcat version von tomcat.apache.org/
und nicht den befehl


```
apt-get install tomcat5.5
```

danach habe ich ihn ganz normal eingerichtet und jetzt funktionert er fehlerfrei


----------



## maki (21. Nov 2007)

apt-get ist die bevorzugte Installationsmethode.

Dein Problem war folgendes: Der SecurityManager

Dazu einfach in der Datei /etc/init.d/tomcat5.5 folgendes ändern:
TOMCAT5_SECURITY=yes

Sollte auch no gestellt werden, ausser du hast Lust die Konfiguration des SM zu machen.

Aber warum einfach...


----------

