log4j2.properties file locked in Tomcat 8.0

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

log4j2.properties file locked in Tomcat 8.0

Bogdan
Hello,

When undeploying my webapp in tomcat i get the following error:

FAIL - Unable to delete [web-app-name]. The continued presence of this
file may cause problems.

As far as I understand is because the file remains lock and it will be
unlocked after the JVM closes.

I used on the destroy method of my servlet LogManager.shutdown() but
it seems that the file still remains locked.

The log4j version is 2.6.2.

The libraries I used are:

log4j-1.2-api-2.6.2.jar
log4j-api-2.6.2.jar
log4j-core-2.6.2.jar

The solution using antiResourceLocking=true in context.xml of tomcat
is not desired because the deployed webapps will be copied to the temp
folder and removed after shutdown which is not an option.

Is there some method to use antiResourceLocking on specific files? Or
is there any other workaround for this issue?


Thanks,

Bogdan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: log4j2.properties file locked in Tomcat 8.0

Gary Gregory-4
Can you update to 2.8.2 so we can compare to the current codebase?

Gary

On Aug 10, 2017 09:37, "Bogdan" <[hidden email]> wrote:

> Hello,
>
> When undeploying my webapp in tomcat i get the following error:
>
> FAIL - Unable to delete [web-app-name]. The continued presence of this
> file may cause problems.
>
> As far as I understand is because the file remains lock and it will be
> unlocked after the JVM closes.
>
> I used on the destroy method of my servlet LogManager.shutdown() but
> it seems that the file still remains locked.
>
> The log4j version is 2.6.2.
>
> The libraries I used are:
>
> log4j-1.2-api-2.6.2.jar
> log4j-api-2.6.2.jar
> log4j-core-2.6.2.jar
>
> The solution using antiResourceLocking=true in context.xml of tomcat
> is not desired because the deployed webapps will be copied to the temp
> folder and removed after shutdown which is not an option.
>
> Is there some method to use antiResourceLocking on specific files? Or
> is there any other workaround for this issue?
>
>
> Thanks,
>
> Bogdan
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: log4j2.properties file locked in Tomcat 8.0

Bogdan
I will do this tomorrow. Thanks!

> On 10 Aug 2017, at 19:28, Gary Gregory <[hidden email]> wrote:
>
> Can you update to 2.8.2 so we can compare to the current codebase?
>
> Gary
>
>> On Aug 10, 2017 09:37, "Bogdan" <[hidden email]> wrote:
>>
>> Hello,
>>
>> When undeploying my webapp in tomcat i get the following error:
>>
>> FAIL - Unable to delete [web-app-name]. The continued presence of this
>> file may cause problems.
>>
>> As far as I understand is because the file remains lock and it will be
>> unlocked after the JVM closes.
>>
>> I used on the destroy method of my servlet LogManager.shutdown() but
>> it seems that the file still remains locked.
>>
>> The log4j version is 2.6.2.
>>
>> The libraries I used are:
>>
>> log4j-1.2-api-2.6.2.jar
>> log4j-api-2.6.2.jar
>> log4j-core-2.6.2.jar
>>
>> The solution using antiResourceLocking=true in context.xml of tomcat
>> is not desired because the deployed webapps will be copied to the temp
>> folder and removed after shutdown which is not an option.
>>
>> Is there some method to use antiResourceLocking on specific files? Or
>> is there any other workaround for this issue?
>>
>>
>> Thanks,
>>
>> Bogdan
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: log4j2.properties file locked in Tomcat 8.0

Bogdan
Hello again,

I have tested with the latest version of log4j2, 2.8.2 and it seems that
this is still happening.

Any ideea on how could i work around this? We have a release today and
apparently this bug is forcing us to revert to log4j1.

Thank you!
Bogdan

On Thu, Aug 10, 2017 at 8:42 PM, Bogdan <[hidden email]> wrote:

> I will do this tomorrow. Thanks!
>
> > On 10 Aug 2017, at 19:28, Gary Gregory <[hidden email]> wrote:
> >
> > Can you update to 2.8.2 so we can compare to the current codebase?
> >
> > Gary
> >
> >> On Aug 10, 2017 09:37, "Bogdan" <[hidden email]> wrote:
> >>
> >> Hello,
> >>
> >> When undeploying my webapp in tomcat i get the following error:
> >>
> >> FAIL - Unable to delete [web-app-name]. The continued presence of this
> >> file may cause problems.
> >>
> >> As far as I understand is because the file remains lock and it will be
> >> unlocked after the JVM closes.
> >>
> >> I used on the destroy method of my servlet LogManager.shutdown() but
> >> it seems that the file still remains locked.
> >>
> >> The log4j version is 2.6.2.
> >>
> >> The libraries I used are:
> >>
> >> log4j-1.2-api-2.6.2.jar
> >> log4j-api-2.6.2.jar
> >> log4j-core-2.6.2.jar
> >>
> >> The solution using antiResourceLocking=true in context.xml of tomcat
> >> is not desired because the deployed webapps will be copied to the temp
> >> folder and removed after shutdown which is not an option.
> >>
> >> Is there some method to use antiResourceLocking on specific files? Or
> >> is there any other workaround for this issue?
> >>
> >>
> >> Thanks,
> >>
> >> Bogdan
> >>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: log4j2.properties file locked in Tomcat 8.0

Remko Popma-2
Is this on Windows?
Have you tried to find what file exactly is being locked with a tool like Process Explorer from SysExternals (now Microsoft): https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer

(Shameless plug) Every java main() method deserves http://picocli.info

> On Aug 11, 2017, at 17:36, Bogdan <[hidden email]> wrote:
>
> Hello again,
>
> I have tested with the latest version of log4j2, 2.8.2 and it seems that
> this is still happening.
>
> Any ideea on how could i work around this? We have a release today and
> apparently this bug is forcing us to revert to log4j1.
>
> Thank you!
> Bogdan
>
>> On Thu, Aug 10, 2017 at 8:42 PM, Bogdan <[hidden email]> wrote:
>>
>> I will do this tomorrow. Thanks!
>>
>>> On 10 Aug 2017, at 19:28, Gary Gregory <[hidden email]> wrote:
>>>
>>> Can you update to 2.8.2 so we can compare to the current codebase?
>>>
>>> Gary
>>>
>>>> On Aug 10, 2017 09:37, "Bogdan" <[hidden email]> wrote:
>>>>
>>>> Hello,
>>>>
>>>> When undeploying my webapp in tomcat i get the following error:
>>>>
>>>> FAIL - Unable to delete [web-app-name]. The continued presence of this
>>>> file may cause problems.
>>>>
>>>> As far as I understand is because the file remains lock and it will be
>>>> unlocked after the JVM closes.
>>>>
>>>> I used on the destroy method of my servlet LogManager.shutdown() but
>>>> it seems that the file still remains locked.
>>>>
>>>> The log4j version is 2.6.2.
>>>>
>>>> The libraries I used are:
>>>>
>>>> log4j-1.2-api-2.6.2.jar
>>>> log4j-api-2.6.2.jar
>>>> log4j-core-2.6.2.jar
>>>>
>>>> The solution using antiResourceLocking=true in context.xml of tomcat
>>>> is not desired because the deployed webapps will be copied to the temp
>>>> folder and removed after shutdown which is not an option.
>>>>
>>>> Is there some method to use antiResourceLocking on specific files? Or
>>>> is there any other workaround for this issue?
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Bogdan
>>>>
>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: log4j2.properties file locked in Tomcat 8.0

Remko Popma-2
In reply to this post by Bogdan
Also, what is your Log4j2 configuration? Some file appender configurations result in file locking.

(Shameless plug) Every java main() method deserves http://picocli.info

> On Aug 11, 2017, at 17:36, Bogdan <[hidden email]> wrote:
>
> Hello again,
>
> I have tested with the latest version of log4j2, 2.8.2 and it seems that
> this is still happening.
>
> Any ideea on how could i work around this? We have a release today and
> apparently this bug is forcing us to revert to log4j1.
>
> Thank you!
> Bogdan
>
>> On Thu, Aug 10, 2017 at 8:42 PM, Bogdan <[hidden email]> wrote:
>>
>> I will do this tomorrow. Thanks!
>>
>>> On 10 Aug 2017, at 19:28, Gary Gregory <[hidden email]> wrote:
>>>
>>> Can you update to 2.8.2 so we can compare to the current codebase?
>>>
>>> Gary
>>>
>>>> On Aug 10, 2017 09:37, "Bogdan" <[hidden email]> wrote:
>>>>
>>>> Hello,
>>>>
>>>> When undeploying my webapp in tomcat i get the following error:
>>>>
>>>> FAIL - Unable to delete [web-app-name]. The continued presence of this
>>>> file may cause problems.
>>>>
>>>> As far as I understand is because the file remains lock and it will be
>>>> unlocked after the JVM closes.
>>>>
>>>> I used on the destroy method of my servlet LogManager.shutdown() but
>>>> it seems that the file still remains locked.
>>>>
>>>> The log4j version is 2.6.2.
>>>>
>>>> The libraries I used are:
>>>>
>>>> log4j-1.2-api-2.6.2.jar
>>>> log4j-api-2.6.2.jar
>>>> log4j-core-2.6.2.jar
>>>>
>>>> The solution using antiResourceLocking=true in context.xml of tomcat
>>>> is not desired because the deployed webapps will be copied to the temp
>>>> folder and removed after shutdown which is not an option.
>>>>
>>>> Is there some method to use antiResourceLocking on specific files? Or
>>>> is there any other workaround for this issue?
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Bogdan
>>>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...