Hi!

no change, even if I chmod 777 such file, change its owner to tomcat5, group
to nogroup (like the rest of logs) etc. That is why I am completely puzzled
with this problem.

thanks!

On 19/02/2008, Martyn Hiemstra <[EMAIL PROTECTED]> wrote:
>
> What happens when you exeecute the following command:
> touch /var/log/tomcat5/cosa.log
>
> Martyn
> > Hi!
> >
> > I'm trying to port a complex website from Tomcat4 to Tomcat5, and log4j
> is
> > the place where I've found most of the problems. In the specific
> sub-section
> > from JAVA_HOME/<subsection> I have a web.xml file with these log4j
> related
> > entries:
> >
> >     <context-param>
> >         <param-name>log4j-init</param-name>
> >
> >
> <param-value>/usr/share/tomcat5/webapps/ecumercado/WEB-INF/log4j.properties</param-value>
> >     </context-param>
> >
> >     <env-entry>
> >       <env-entry-name>ruta_log</env-entry-name>
> >
> >
> <env-entry-value>/var/lib/tomcat5/webapps/ecumercado/WEB-INF/log4j.properties</env-entry-value>
> >       <env-entry-type>java.lang.String</env-entry-type>
> >     </env-entry>
> >
> > Now in the same WEB-INF directory I have the log4j.properties file,
> which
> > I've got now as:
> >
> > log4j.rootLogger=INFO, LOGFILE
> > log4j.appender.LOGFILE=org.apache.log4j.DailyRollingFileAppender
> > log4j.appender.LOGFILE.file=/var/log/tomcat5/cosa.log
> > log4j.appender.LOGFILE.append=true
> > log4j.appender.LOGFILE.DatePattern='.'yyyy-MM-dd
> > log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
> > log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c - %m%n
> >
> > (I am not using now ${catalina.home} for LOGFILE.file since it didn't
> seem
> > to have any contents, which I neither understand. It gave me the same
> error
> > that I'm copying below, but with "FilePermission /logs/cosa.log write"
> when
> > for example file=${catalina.home}/logs/cosa.log )
> >
> >
> > I instantiate the Logger in the servlets code through a
> > Logger.getLoggercommand, such like:
> >
> > public class InportGalleryContent extends SecureHttpServlet {
> >     static Logger log =Logger.getLogger(InportGalleryContent.class);
> >
> > However, when I try to access any of my servlets, the result is a
> security
> > access error (?), as if I didn't have permissions to write the file:
> >
> > java.security.AccessControlException: access denied
> > (java.io.FilePermission /var/log/tomcat5/cosa.log write)
> >       java.security.AccessControlContext.checkPermission(
> AccessControlContext.java:269)
> >       java.security.AccessController.checkPermission(
> AccessController.java:401)
> >       java.lang.SecurityManager.checkPermission(SecurityManager.java
> :524)
> >       java.lang.SecurityManager.checkWrite(SecurityManager.java:954)
> >       java.io.FileOutputStream.<init>(FileOutputStream.java:169)
> >       java.io.FileOutputStream.<init>(FileOutputStream.java:102)
> >       org.apache.log4j.FileAppender.setFile(FileAppender.java:290)
> >       org.apache.log4j.FileAppender.activateOptions(FileAppender.java
> :164)
> >       org.apache.log4j.DailyRollingFileAppender.activateOptions(
> DailyRollingFileAppender.java:216)
> >       org.apache.log4j.config.PropertySetter.activate(
> PropertySetter.java:257)
> >       org.apache.log4j.config.PropertySetter.setProperties(
> PropertySetter.java:133)
> >       org.apache.log4j.config.PropertySetter.setProperties(
> PropertySetter.java:97)
> >       org.apache.log4j.PropertyConfigurator.parseAppender(
> PropertyConfigurator.java:689)
> >       org.apache.log4j.PropertyConfigurator.parseCategory(
> PropertyConfigurator.java:647)
> >       org.apache.log4j.PropertyConfigurator.configureRootCategory(
> PropertyConfigurator.java:544)
> >       org.apache.log4j.PropertyConfigurator.doConfigure(
> PropertyConfigurator.java:440)
> >       org.apache.log4j.PropertyConfigurator.doConfigure(
> PropertyConfigurator.java:334)
> >       org.apache.log4j.PropertyConfigurator.configure(
> PropertyConfigurator.java:342)
> >       com.ecuestre.ecumercado.web.ShowAdvertisment.doPost(
> ShowAdvertisment.java:588)
> >       com.ecuestre.ecumercado.web.ShowAdvertisment.doGet(
> ShowAdvertisment.java:578)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> >       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >       sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> >       sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> >       java.lang.reflect.Method.invoke(Method.java:324)
> >       org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java
> :243)
> >       java.security.AccessController.doPrivileged(Native Method)
> >       javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
> >       org.apache.catalina.security.SecurityUtil.execute(
> SecurityUtil.java:272)
> >       org.apache.catalina.security.SecurityUtil.doAsPrivilege(
> SecurityUtil.java:161)
> >
> >
> > The filesystem (Debian 4.0) permissions do not seem to matter, and other
> > routes such like "/tmp/cosa.log" do neither work. So I'm not really
> getting
> > what can I do. I tried to copy the log4j.properties file in the
> > WEB-INF/classes/ directory, but then things seem to get worse. It tells
> me
> > on an error instantiating the servlet class from the website, when
> trying to
> > initialize getLogger, so that Tomcat5 marks such servlet as
> not-available
> > and doesn't allow it to execute it again
> >
> > javax.servlet.ServletException: Error instanciando clase de servlet
> > com.ecuestre.ecumercado.web.ShowAdvertisment
> >       org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:118)
> >       org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java
> :160)
> >       org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java
> :300)
> >       org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java
> :374)
> >       org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
> >       org.apache.jk.common.ChannelSocket.processConnection(
> ChannelSocket.java:675)
> >       org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java
> :866)
> >       org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
> >       java.lang.Thread.run(Thread.java:534)
> >
> > *root cause*
> >
> > java.lang.ExceptionInInitializerError
> >       org.apache.log4j.Logger.getLogger(Logger.java:118)
> >       com.ecuestre.ecumercado.web.ShowAdvertisment.<clinit>(
> ShowAdvertisment.java:24)
> >       sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> >       sun.reflect.NativeConstructorAccessorImpl.newInstance(
> NativeConstructorAccessorImpl.java:39)
> >       sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> DelegatingConstructorAccessorImpl.java:27)
> >       java.lang.reflect.Constructor.newInstance(Constructor.java:274)
> >       java.lang.Class.newInstance0(Class.java:308)
> >       java.lang.Class.newInstance(Class.java:261)
> >       org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:118)
> >       org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java
> :160)
> >       org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java
> :300)
> >       org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java
> :374)
> >       org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
> >       org.apache.jk.common.ChannelSocket.processConnection(
> ChannelSocket.java:675)
> >       org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java
> :866)
> >       org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
> >       java.lang.Thread.run(Thread.java:534)
> >
> >
> >
> > Any help would be really appreciated, thanks a lot! ^^
> >
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

www.decondicionamiento.org

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

There is no becoming, no revolution, no struggle, no path; already you're
the monarch of your own skin--your inviolable freedom waits to be completed
only by the love of other monarchs: a politics of dream, urgent as the
blueness of sky.

Agents of chaos cast burning glances at anything or anyone capable of
bearing witness to their condition, their fever of lux et voluptas. I am
awake only in what I love & desire to the point of terror--everything else
is just shrouded furniture, quotidian anaesthesia, shit-for-brains,
sub-reptilian ennui of totalitarian regimes, banal censorship & useless
pain.

[ TAZ - Hakim Bey ]

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

Reply via email to