You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jspwiki.apache.org by Brian Burch <br...@pingtoo.com> on 2014/01/11 14:06:30 UTC

Upgrade from 2.8.4 to 2.10

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

Re: Upgrade from 2.8.4 to 2.10

Posted by Brian Burch <br...@pingtoo.com>.
On 11/01/14 20:01, Brian Burch wrote:
> On 11/01/14 18:25, Juan Pablo Santos Rodríguez wrote:
>> Hi Brian,
>>
>> jspwiki.properties is loaded from classpath, inside the war, it should be
>> under
>> JSPWiki.war/WEB-INF/lib/jspwiki-war-2.10.0-SNAPSHOT.jar/ini/jspwiki.properties
>>
>> If, for whatever reason, the file isn't present, an Exception should be
>> risen.
>
> Well, I found it, but that is a VERY counter-intuitive location...
> inside a jar inside a war!
>
> I have just updated..
>
> https://jspwiki-wiki.apache.org/Wiki.jsp?page=Configuration
>
> .. to explain where it can be found. Please tidy up my wording if you
> don't like the way I said it!
>
>> As for the original page of your plugin, could it be this one?:
>> http://www.ecyrd.com/JSPWiki/wiki/PhotoCollectionPlugin
>
> Sorry, I knew it went read-only a long time ago. I assumed it had
> disappeared and so didn't look recently. That is exactly the right page
> and I have now scraped the wiki source to work on offline.
>
> Watch this space!

Added https://jspwiki-wiki.apache.org/Wiki.jsp?page=PhotoCollectionPlugin

today to
https://jspwiki-wiki.apache.org/Wiki.jsp?page=ContributedPlugins

> Brian
>
>> HTH,
>> juan pablo
>>
>>
>> On Sat, Jan 11, 2014 at 7:11 PM, Brian Burch <br...@pingtoo.com> wrote:
>>
>>> On 11/01/14 14:27, Juan Pablo Santos Rodríguez wrote:
>>>
>>>> Hi Brian,
>>>>
>>>> That variable controls log initialization, and it's  set up by
>>>> jspwiki.use.external.logconfig value inside jspwiki.properties. You
>>>> should
>>>> override it on your jspwiki-custom.properties file [#1], which could be
>>>> anywhere on your classpath
>>>>
>>>
>>> Thanks very much for your suggestion. I thought I could get the
>>> webapp to
>>> start without changing the defaults, but obviously I was wrong!
>>>
>>>
>>>   Regarding the plugin, it could be used inside 2.10 just by
>>> implementing
>>>> the
>>>> same WikiPlugin interface as before, which is now living on the
>>>> org.apache.wiki.api.plugin package, and compiling/installing it as
>>>> usual.
>>>> And it would be real extra nice if you could list that new plugin
>>>> version
>>>> under [#2] O:-)
>>>>
>>>
>>> I hope it is that easy!
>>>
>>> I documented the plugin on the old wiki and wrote quite a long page
>>> about
>>> using and configuring it. Is that page still available somewhere - it
>>> will
>>> be much easier for me to clone-and-update the original text than to
>>> start
>>> from scratch.
>>>
>>> Once I have the current version working with 2.10, I have some
>>> enhancements in mind. However, I want to port the current stable code
>>> and
>>> re-contribute it first.
>>>
>>> Regards,
>>>
>>> Brian
>>>
>>>   br,
>>>> juan pablo
>>>>
>>>> [#1]
>>>> https://jspwiki-wiki.apache.org/Wiki.jsp?page=Documentation#section-
>>>> Documentation-ConfigurationAndAdministration
>>>> [#2] https://jspwiki-wiki.apache.org/Wiki.jsp?page=ContributedPlugins
>
> <snip/>


Re: Upgrade from 2.8.4 to 2.10

Posted by Brian Burch <br...@pingtoo.com>.
On 11/01/14 18:25, Juan Pablo Santos Rodríguez wrote:
> Hi Brian,
>
> jspwiki.properties is loaded from classpath, inside the war, it should be
> under
> JSPWiki.war/WEB-INF/lib/jspwiki-war-2.10.0-SNAPSHOT.jar/ini/jspwiki.properties
> If, for whatever reason, the file isn't present, an Exception should be
> risen.

Well, I found it, but that is a VERY counter-intuitive location... 
inside a jar inside a war!

I have just updated..

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

.. to explain where it can be found. Please tidy up my wording if you 
don't like the way I said it!

> As for the original page of your plugin, could it be this one?:
> http://www.ecyrd.com/JSPWiki/wiki/PhotoCollectionPlugin

Sorry, I knew it went read-only a long time ago. I assumed it had 
disappeared and so didn't look recently. That is exactly the right page 
and I have now scraped the wiki source to work on offline.

Watch this space!

Brian

> HTH,
> juan pablo
>
>
> On Sat, Jan 11, 2014 at 7:11 PM, Brian Burch <br...@pingtoo.com> wrote:
>
>> On 11/01/14 14:27, Juan Pablo Santos Rodríguez wrote:
>>
>>> Hi Brian,
>>>
>>> That variable controls log initialization, and it's  set up by
>>> jspwiki.use.external.logconfig value inside jspwiki.properties. You should
>>> override it on your jspwiki-custom.properties file [#1], which could be
>>> anywhere on your classpath
>>>
>>
>> Thanks very much for your suggestion. I thought I could get the webapp to
>> start without changing the defaults, but obviously I was wrong!
>>
>>
>>   Regarding the plugin, it could be used inside 2.10 just by implementing
>>> the
>>> same WikiPlugin interface as before, which is now living on the
>>> org.apache.wiki.api.plugin package, and compiling/installing it as usual.
>>> And it would be real extra nice if you could list that new plugin version
>>> under [#2] O:-)
>>>
>>
>> I hope it is that easy!
>>
>> I documented the plugin on the old wiki and wrote quite a long page about
>> using and configuring it. Is that page still available somewhere - it will
>> be much easier for me to clone-and-update the original text than to start
>> from scratch.
>>
>> Once I have the current version working with 2.10, I have some
>> enhancements in mind. However, I want to port the current stable code and
>> re-contribute it first.
>>
>> Regards,
>>
>> Brian
>>
>>   br,
>>> juan pablo
>>>
>>> [#1]
>>> https://jspwiki-wiki.apache.org/Wiki.jsp?page=Documentation#section-
>>> Documentation-ConfigurationAndAdministration
>>> [#2] https://jspwiki-wiki.apache.org/Wiki.jsp?page=ContributedPlugins

<snip/>


Re: Upgrade from 2.8.4 to 2.10

Posted by Juan Pablo Santos Rodríguez <ju...@gmail.com>.
Hi Brian,

jspwiki.properties is loaded from classpath, inside the war, it should be
under
JSPWiki.war/WEB-INF/lib/jspwiki-war-2.10.0-SNAPSHOT.jar/ini/jspwiki.properties
If, for whatever reason, the file isn't present, an Exception should be
risen.

As for the original page of your plugin, could it be this one?:
http://www.ecyrd.com/JSPWiki/wiki/PhotoCollectionPlugin


HTH,
juan pablo


On Sat, Jan 11, 2014 at 7:11 PM, Brian Burch <br...@pingtoo.com> wrote:

> On 11/01/14 14:27, Juan Pablo Santos Rodríguez wrote:
>
>> Hi Brian,
>>
>> That variable controls log initialization, and it's  set up by
>> jspwiki.use.external.logconfig value inside jspwiki.properties. You should
>> override it on your jspwiki-custom.properties file [#1], which could be
>> anywhere on your classpath
>>
>
> Thanks very much for your suggestion. I thought I could get the webapp to
> start without changing the defaults, but obviously I was wrong!
>
>
>  Regarding the plugin, it could be used inside 2.10 just by implementing
>> the
>> same WikiPlugin interface as before, which is now living on the
>> org.apache.wiki.api.plugin package, and compiling/installing it as usual.
>> And it would be real extra nice if you could list that new plugin version
>> under [#2] O:-)
>>
>
> I hope it is that easy!
>
> I documented the plugin on the old wiki and wrote quite a long page about
> using and configuring it. Is that page still available somewhere - it will
> be much easier for me to clone-and-update the original text than to start
> from scratch.
>
> Once I have the current version working with 2.10, I have some
> enhancements in mind. However, I want to port the current stable code and
> re-contribute it first.
>
> Regards,
>
> Brian
>
>  br,
>> juan pablo
>>
>> [#1]
>> https://jspwiki-wiki.apache.org/Wiki.jsp?page=Documentation#section-
>> Documentation-ConfigurationAndAdministration
>> [#2] https://jspwiki-wiki.apache.org/Wiki.jsp?page=ContributedPlugins
>>
>>
>> On Sat, Jan 11, 2014 at 2:06 PM, Brian Burch <br...@pingtoo.com> 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
>>>
>>>
>>
>

Re: Upgrade from 2.8.4 to 2.10

Posted by Brian Burch <br...@pingtoo.com>.
On 11/01/14 14:27, Juan Pablo Santos Rodríguez wrote:
> Hi Brian,
>
> That variable controls log initialization, and it's  set up by
> jspwiki.use.external.logconfig value inside jspwiki.properties. You should
> override it on your jspwiki-custom.properties file [#1], which could be
> anywhere on your classpath

Thanks very much for your suggestion. I thought I could get the webapp 
to start without changing the defaults, but obviously I was wrong!

> Regarding the plugin, it could be used inside 2.10 just by implementing the
> same WikiPlugin interface as before, which is now living on the
> org.apache.wiki.api.plugin package, and compiling/installing it as usual.
> And it would be real extra nice if you could list that new plugin version
> under [#2] O:-)

I hope it is that easy!

I documented the plugin on the old wiki and wrote quite a long page 
about using and configuring it. Is that page still available somewhere - 
it will be much easier for me to clone-and-update the original text than 
to start from scratch.

Once I have the current version working with 2.10, I have some 
enhancements in mind. However, I want to port the current stable code 
and re-contribute it first.

Regards,

Brian

> br,
> juan pablo
>
> [#1]
> https://jspwiki-wiki.apache.org/Wiki.jsp?page=Documentation#section-Documentation-ConfigurationAndAdministration
> [#2] https://jspwiki-wiki.apache.org/Wiki.jsp?page=ContributedPlugins
>
>
> On Sat, Jan 11, 2014 at 2:06 PM, Brian Burch <br...@pingtoo.com> 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
>>
>


Re: Upgrade from 2.8.4 to 2.10

Posted by Juan Pablo Santos Rodríguez <ju...@gmail.com>.
Hi Brian,

That variable controls log initialization, and it's  set up by
jspwiki.use.external.logconfig value inside jspwiki.properties. You should
override it on your jspwiki-custom.properties file [#1], which could be
anywhere on your classpath

Regarding the plugin, it could be used inside 2.10 just by implementing the
same WikiPlugin interface as before, which is now living on the
org.apache.wiki.api.plugin package, and compiling/installing it as usual.
And it would be real extra nice if you could list that new plugin version
under [#2] O:-)


br,
juan pablo

[#1]
https://jspwiki-wiki.apache.org/Wiki.jsp?page=Documentation#section-Documentation-ConfigurationAndAdministration
[#2] https://jspwiki-wiki.apache.org/Wiki.jsp?page=ContributedPlugins


On Sat, Jan 11, 2014 at 2:06 PM, Brian Burch <br...@pingtoo.com> 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
>

Re: Upgrade from 2.8.4 to 2.10

Posted by Brian Burch <br...@pingtoo.com>.
On 11/01/14 14:13, Harry Metske wrote:
> 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.

Thanks Harry (and also Juan Pablo). Your suggestion resolved my logging 
Exception.

The FIXME comment in the code (org.apache.wiki.WikiEngine lines 118-120 
on svn trunk r1557110) should be updated to be clearer. I'm not sure 
there is a simple way to detect which flavour of log4j has control, but 
that Exception is VERY confusing!

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

Yes, I saw that. Funny thing is that I can't find jspwiki.properties 
anywhere in the war, and when I check the unpacked war I get:

brian@shiraz:/var/lib/tomcat7/webapps/JSPWiki$ find . -name "*.properties"
./META-INF/maven/org.apache.jspwiki/jspwiki-war/pom.properties

... which doesn't contain anything interesting or relevant.

However, when I stepped my debugger through the code that was previously 
failing, I could see the properties have been loaded. Have you switched 
to a log4j.xml file, or are the values set programmatically these days? 
That wiki page ought to tell the truth!

Thanks again, Harry. I'm working on my next problem - adding more 
entries to my custom properties file. It would really help if could find 
the current default properties file to match against my 2.8.4 version...

Brian

> kind regards,
> Harry
>
>
>
> On 11 January 2014 14:06, Brian Burch <br...@pingtoo.com> 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
>>
>


Re: Upgrade from 2.8.4 to 2.10

Posted by Juan Pablo Santos Rodríguez <ju...@gmail.com>.
oh, see I've been bet by a few minutes :-)


rgrdrs,
juan pablo


On Sat, Jan 11, 2014 at 3:13 PM, Harry Metske <ha...@gmail.com>wrote:

> 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 <br...@pingtoo.com> 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
> >
>

Re: Upgrade from 2.8.4 to 2.10

Posted by Harry Metske <ha...@gmail.com>.
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 <br...@pingtoo.com> 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
>