Brian,

by default, JSPWiki activates it's own "built in" log4j configuration using
the log4j properties in jspwiki.properties (inside the jar).
If you use a global log4j config for the whole container, you probably
don't want that. Therefore you should use the (new) property
jspwiki.use.external.logconfig=true (default is false).
Put this property in the jspwiki-custom.properties in your tomcat's lib
directory.

See also https://jspwiki-wiki.apache.org/Wiki.jsp?page=Configuration

kind regards,
Harry



On 11 January 2014 14:06, Brian Burch <[email protected]> wrote:

> Hi, everyone,
>
> Thanks for all the good work moving the project to apache.
>
> I have just reached the time when I want to upgrade from my very stable
> and satisfactory jspwiki 2.8.4 system. The delay is because I rely very
> heavily on the PhotoCollectionPlugin that I wrote and contributed a few
> years ago. I need to convert my plugin to work with the org.apache.jspwiki
> packages, so I wanted to start with an up to date development base.
>
> I checked out the latest trunk and built it successfully.
>
> I deployed the new JSPWiki.war on my linux tomcat 7.0.42 server in
> parallel with the 2.8.4 version. Initially, I changed nothing in the new
> war and left it with its default name because the 2.8.4 runs under a
> different name.
>
>
> When tomcat started, it logged the following to catalina.out
>
> log4j:ERROR setFile(null,true) call failed.
> java.io.FileNotFoundException: jspwiki.log (Permission denied)
>         at java.io.FileOutputStream.open(Native Method)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:136)
>         at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
>         at org.apache.log4j.RollingFileAppender.setFile(
> RollingFileAppender.java:207)
>         at org.apache.log4j.FileAppender.activateOptions(FileAppender.
> java:165)
>         at org.apache.log4j.config.PropertySetter.activate(
> PropertySetter.java:307)
>         at org.apache.log4j.config.PropertySetter.setProperties(
> PropertySetter.java:172)
>         at org.apache.log4j.config.PropertySetter.setProperties(
> PropertySetter.java:104)
>         at org.apache.log4j.PropertyConfigurator.parseAppender(
> PropertyConfigurator.java:842)
>         at org.apache.log4j.PropertyConfigurator.parseCategory(
> PropertyConfigurator.java:768)
>         at org.apache.log4j.PropertyConfigurator.configureRootCategory(
> PropertyConfigurator.java:648)
>         at org.apache.log4j.PropertyConfigurator.doConfigure(
> PropertyConfigurator.java:514)
>         at org.apache.log4j.PropertyConfigurator.configure(
> PropertyConfigurator.java:440)
>         at org.apache.wiki.WikiEngine.initialize(WikiEngine.java:464)
>         at org.apache.wiki.WikiEngine.<init>(WikiEngine.java:430)
>         at org.apache.wiki.WikiEngine.getInstance(WikiEngine.java:370)
>         at org.apache.wiki.ui.WikiServletFilter.init(
> WikiServletFilter.java:82)
>         at org.apache.wiki.ui.WikiJSPFilter.init(WikiJSPFilter.java:88)
>         at org.apache.catalina.core.ApplicationFilterConfig.initFilter(
> ApplicationFilterConfig.java:281)
>         at org.apache.catalina.core.ApplicationFilterConfig.getFilter(
> ApplicationFilterConfig.java:262)
>         at org.apache.catalina.core.ApplicationFilterConfig.<init>
> (ApplicationFilterConfig.java:107)
>         at org.apache.catalina.core.StandardContext.filterStart(
> StandardContext.java:4775)
>         at org.apache.catalina.core.StandardContext.startInternal(
> StandardContext.java:5452)
>         at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:150)
>         at org.apache.catalina.core.ContainerBase.addChildInternal(
> ContainerBase.java:901)
>         at org.apache.catalina.core.ContainerBase.addChild(
> ContainerBase.java:877)
>         at org.apache.catalina.core.StandardHost.addChild(
> StandardHost.java:633)
>         at org.apache.catalina.startup.HostConfig.deployWAR(
> HostConfig.java:976)
>         at org.apache.catalina.startup.HostConfig$DeployWar.run(
> HostConfig.java:1653)
>         at java.util.concurrent.Executors$RunnableAdapter.
> call(Executors.java:471)
>         at java.util.concurrent.FutureTask$Sync.innerRun(
> FutureTask.java:334)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1145)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:615)
>         at java.lang.Thread.run(Thread.java:724)
>
> This failure was because my tomcat is configured to use global log4j, i.e.
> for all webapps and also for tomcat itself.
>
> see: http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Using_Log4j
>
> My ${CATALINA_BASE}/lib/log4j.properties did not define a suitable logger
> for org.apache.wiki. It was only set up to log com.ecyrd.jspwiki events.
>
> To get past this problem I defined a second logger pointing at a different
> log file for the new events.
>
> I also removed JSPWiki/WEB-INF/lib/log4j-1.2.17.jar. I was using
> log4j-1.2.12.jar globally, so replaced it with log4j-1.2.17.jar. This
> didn't seem to do any harm, and the new JSPWiki webapp writes its messages
> to the correct log4j file.
>
>
> I expected the error would disappear, but I was wrong! The exception seems
> to be associated with access to the log4j file in use by the jspwiki 2.8.4
> webapp, which is successfully capturing com.ecyrd.jspwiki events.
>
> Following the Exception callback trace leads me to the source code for
> org.apache.wiki.WikiEngine. It didn't take me long to find this code near
> the top of the class:
>
>     /** True, if log4j has been configured. */
>     // FIXME: If you run multiple applications, the first application
>     // to run defines where the log goes.  Not what we want.
>     private static boolean   c_configured = false;
>
> Is this the cause of my problem?
>
> Regards,
>
> Brian
>

Reply via email to