You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Fabien Sanglard <fs...@timeplay.com> on 2013/04/17 22:28:37 UTC

Issue with Tomcat auto-redeploy on Windows.

It seems there is an issue with log4j 2 not closing the core JAR handle 
on Windows.
It prevents Tomcat from auto redeploying an app.

Upon updating an hypothetical DiscoveryService.war in the 'webapps' 
folder, the redeploy will fail:

SEVERE: [C:\Program 
Files\apache-tomcat-7.0.39\webapps\DiscoveryService\WEB-INF\lib] could 
not be completely deleted. The presence of the remaining files may cause 
problems

Upon inspection it looks like:

C:\Program 
Files\apache-tomcat-7.0.39\webapps\DiscoveryService\WEB-INF\lib\log4j-core-2.0-beta4.jar

Cannot be deleted :/ ! Is there anything special to do so log4j 2 close 
the JAR handle ?

Fab

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Issue with Tomcat auto-redeploy on Windows.

Posted by Fabien Sanglard <fs...@timeplay.com>.
Is anybody able to reproduce this on Windows?

Fabien

On 4/17/2013 1:36 PM, Ralph Goers wrote:
> Not that I am aware of.  If the web app is using the log4j 2 web module to initialize and destroy its context I would expect this to work.
>
> Ralph
>
> On Apr 17, 2013, at 1:28 PM, Fabien Sanglard wrote:
>
>> It seems there is an issue with log4j 2 not closing the core JAR handle on Windows.
>> It prevents Tomcat from auto redeploying an app.
>>
>> Upon updating an hypothetical DiscoveryService.war in the 'webapps' folder, the redeploy will fail:
>>
>> SEVERE: [C:\Program Files\apache-tomcat-7.0.39\webapps\DiscoveryService\WEB-INF\lib] could not be completely deleted. The presence of the remaining files may cause problems
>>
>> Upon inspection it looks like:
>>
>> C:\Program Files\apache-tomcat-7.0.39\webapps\DiscoveryService\WEB-INF\lib\log4j-core-2.0-beta4.jar
>>
>> Cannot be deleted :/ ! Is there anything special to do so log4j 2 close the JAR handle ?
>>
>> Fab
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Issue with Tomcat auto-redeploy on Windows.

Posted by Remko Popma <re...@yahoo.com>.
Tushar Kapila <tgkprog <at> gmail.com> writes:

> 
> * why would a lib log4j or any other read its own jar? unless its to get 
> to a xml for config in it and is not closing it?


One thing I can think of is PluginManager. 
This class tries to read all Log4j2Plugins.dat files in the classpath
(incl the one in the core jar).

If an exception occurs during plugin initialization, 
this file is not closed: 
the call to inputstream.close is not in a finally block.

o.a.l.l.c.c.p.PluginManager#decode(ClassLoader) line 234

-Remko



> 
> * i would never install to program files as there are permission issues 
> on those folders especially with windows 7 try install on c:\apps\ (make 
> apps as a new folder)
> 
> On 4/18/2013 2:06 AM, Ralph Goers wrote:
> > Not that I am aware of.  If the web app is using the log4j 2 web module

to initialize and destroy its context I
> would expect this to work.
> >
> > Ralph
> >
> > On Apr 17, 2013, at 1:28 PM, Fabien Sanglard wrote:
> >
> >> It seems there is an issue with log4j 2 not closing the core JAR handle

on Windows.
> >> It prevents Tomcat from auto redeploying an app.
> >>
> >> Upon updating an hypothetical DiscoveryService.war in the 'webapps'

folder, the redeploy will fail:
> >>
> >> SEVERE: [C:\Program

Files\apache-tomcat-7.0.39\webapps\DiscoveryService\WEB-INF\lib] could
> not be completely deleted. The presence of the remaining files may cause

problems
> >>
> >> Upon inspection it looks like:
> >>
> >> C:\Program

Files\apache-tomcat-7.0.39\webapps\DiscoveryService\WEB-INF\lib\log4j-
core-2.0-beta4.jar
> >>
> >> Cannot be deleted :/ ! Is there anything special to do so log4j 2 close

the JAR handle ?
> >>
> >> Fab
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org
> >> For additional commands, e-mail: log4j-user-help <at> 
logging.apache.org
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org
> > For additional commands, e-mail: log4j-user-help <at> logging.apache.org
> >
> >
> 





---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Issue with Tomcat auto-redeploy on Windows.

Posted by Tushar Kapila <tg...@gmail.com>.
* why would a lib log4j or any other read its own jar? unless its to get 
to a xml for config in it and is not closing it?

* i would never install to program files as there are permission issues 
on those folders especially with windows 7 try install on c:\apps\ (make 
apps as a new folder)

On 4/18/2013 2:06 AM, Ralph Goers wrote:
> Not that I am aware of.  If the web app is using the log4j 2 web module to initialize and destroy its context I would expect this to work.
>
> Ralph
>
> On Apr 17, 2013, at 1:28 PM, Fabien Sanglard wrote:
>
>> It seems there is an issue with log4j 2 not closing the core JAR handle on Windows.
>> It prevents Tomcat from auto redeploying an app.
>>
>> Upon updating an hypothetical DiscoveryService.war in the 'webapps' folder, the redeploy will fail:
>>
>> SEVERE: [C:\Program Files\apache-tomcat-7.0.39\webapps\DiscoveryService\WEB-INF\lib] could not be completely deleted. The presence of the remaining files may cause problems
>>
>> Upon inspection it looks like:
>>
>> C:\Program Files\apache-tomcat-7.0.39\webapps\DiscoveryService\WEB-INF\lib\log4j-core-2.0-beta4.jar
>>
>> Cannot be deleted :/ ! Is there anything special to do so log4j 2 close the JAR handle ?
>>
>> Fab
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Issue with Tomcat auto-redeploy on Windows.

Posted by Ralph Goers <ra...@dslextreme.com>.
Not that I am aware of.  If the web app is using the log4j 2 web module to initialize and destroy its context I would expect this to work.

Ralph

On Apr 17, 2013, at 1:28 PM, Fabien Sanglard wrote:

> It seems there is an issue with log4j 2 not closing the core JAR handle on Windows.
> It prevents Tomcat from auto redeploying an app.
> 
> Upon updating an hypothetical DiscoveryService.war in the 'webapps' folder, the redeploy will fail:
> 
> SEVERE: [C:\Program Files\apache-tomcat-7.0.39\webapps\DiscoveryService\WEB-INF\lib] could not be completely deleted. The presence of the remaining files may cause problems
> 
> Upon inspection it looks like:
> 
> C:\Program Files\apache-tomcat-7.0.39\webapps\DiscoveryService\WEB-INF\lib\log4j-core-2.0-beta4.jar
> 
> Cannot be deleted :/ ! Is there anything special to do so log4j 2 close the JAR handle ?
> 
> Fab
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org