[
https://issues.apache.org/jira/browse/OFBIZ-5625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Leon updated OFBIZ-5625:
------------------------
Attachment: OFBIZ-5625.patch
judge whether it's null or not before remove the lock file
> NPE while try to release a service semaphore which does not acquire any lock
> ----------------------------------------------------------------------------
>
> Key: OFBIZ-5625
> URL: https://issues.apache.org/jira/browse/OFBIZ-5625
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Reporter: Leon
> Fix For: SVN trunk
>
> Attachments: OFBIZ-5625.patch
>
>
> Set a service attribution "semaphore" to "fail" and try to run it twice in
> short delay. Since the first one obtains the lock, the second will "fail" and
> throws out the "SemaphoreFailException" exception which will be catch in
> ServiceDispatcher.runSync method and triggers the semophore.release within
> that the NPE occurred because of null lock value.
> {quote}
> 2014-04-28 12:50:35,560 (OFBiz-JobQueue-1) [
> GenericServiceJob.java:118:ERROR]
> ---- runtime exception report
> --------------------------------------------------
> Async-Service failed.
> Exception: java.lang.NullPointerException
> Message: null
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.NullPointerException
> org.ofbiz.service.semaphore.ServiceSemaphore.dbWrite(ServiceSemaphore.java:155)
> org.ofbiz.service.semaphore.ServiceSemaphore.release(ServiceSemaphore.java:75)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:557)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:218)
> org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:83)
> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:69)
> org.ofbiz.service.job.AbstractJob.run(AbstractJob.java:87)
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> java.lang.Thread.run(Thread.java:619)
> --------------------------------------------------------------------------------
> {quote}
--
This message was sent by Atlassian JIRA
(v6.2#6252)