[ome-users] NullPointerException in FileMaker

Harri Jäälinoja harri.jaalinoja at helsinki.fi
Mon Aug 6 15:08:04 BST 2012


Hi,
I added some more logging to 
components/blitz/src/ome/services/blitz/repo/AbstractRepositoryI.java, 
in the helper GetOrGreateRepo:

             } catch (Exception e) {
                 log.error("Error in GetOrCreateRepo.doWork",e);
                 e.printStackTrace();
                 fileMaker.close(); // If anything goes awry, we release for
                 // others!
                 return e;
             }

This is what it prints:

2012-08-06 17:01:03,182 ERROR [.services.blitz.repo.AbstractRepositoryI] 
(2-thread-1) Error in GetOrCreateRepo.doWork
java.io.IOException: No locks available
	at sun.nio.ch.FileChannelImpl.lock0(Native Method)
	at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:832)
	at java.nio.channels.FileChannel.lock(FileChannel.java:860)
	at ome.services.blitz.repo.FileMaker.getLine(FileMaker.java:95)
	at 
ome.services.blitz.repo.AbstractRepositoryI$GetOrCreateRepo.doWork(AbstractRepositoryI.java:233)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


What does this mean, why are there no locks available?

Thanks,
Harri


On 06/08/12 12:33, Harri Jäälinoja wrote:
> Hi again,
>
> I forgot to mention that this error is repeated once a minute:
>
> [root at omerovm-1 ~]# grep ERROR /var/log/OMERO/Blitz-0.log |tail
> 2012-08-06 12:21:16,970 ERROR [.services.blitz.repo.AbstractRepositoryI]
> (2-thread-5) Unexpected error in called executor on takeover
> 2012-08-06 12:22:16,988 ERROR [.services.blitz.repo.AbstractRepositoryI]
> (2-thread-3) Unexpected error in called executor on takeover
> 2012-08-06 12:23:16,971 ERROR [.services.blitz.repo.AbstractRepositoryI]
> (2-thread-2) Unexpected error in called executor on takeover
> 2012-08-06 12:24:16,951 ERROR [.services.blitz.repo.AbstractRepositoryI]
> (2-thread-3) Unexpected error in called executor on takeover
> 2012-08-06 12:25:16,964 ERROR [.services.blitz.repo.AbstractRepositoryI]
> (2-thread-2) Unexpected error in called executor on takeover
>
> Regards,
> Harri
>
> On 03/08/12 14:37, harri.jaalinoja at helsinki.fi wrote:
>> Hello,
>>
>> looking at
>> https://github.com/openmicroscopy/openmicroscopy/blob/master/components/blitz/src/ome/services/blitz/repo/FileMaker.java,
>>
>>
>>
>> the NPE is thrown because there is no lock to release:
>>          try {
>>                  lock.release(); // line 132
>>              } catch (IOException e) {
>>                  log.warn("Failed to release lock");
>>              }
>>
>> It seems lock is only initialized if getLine() is called, otherwise it
>> is null:
>>
>>      public String getLine() throws Exception {
>>          synchronized (mutex) {
>>
>>              if (dbUuid == null) {
>>                  throw new InternalException("Not initialized");
>>              }
>>
>>              lock = dotLockRaf.getChannel().lock();
>>
>>
>> So somehow the getLine call was omitted now?
>>
>> Cheers,
>> Harri
>>
>>
>> Quoting harri.jaalinoja at helsinki.fi:
>>
>>> Hello All,
>>> I noticed an error in the OMERO 4.4.1 logs (on RedHat5.8). I just
>>> restarted OMERO server, so this in not initiated by user action
>>> (unless OMERO stores jobs over shutdown and continues them after
>>> restart: yesterday I left "combine images" script running).
>>>
>>> The stack trace is below. Any ideas what is wrong?
>>>
>>> Thanks,
>>> Harri
>>>
>>> ----
>>> 2012-08-03 13:28:16,981 WARN  [
>>> ome.services.util.ServiceHandler] (2-thread-4) Method interface
>>> ome.services.util.Executor$Work.doWork invocation took 6043
>>> 2012-08-03 13:28:16,981 ERROR
>>> [.services.blitz.repo.AbstractRepositoryI] (2-thread-4) Unexpected
>>> error in called executor on takeover
>>> ome.conditions.InternalException:  Wrapped Exception:
>>> (java.lang.NullPointerException):
>>> null
>>>     at ome.services.blitz.repo.FileMaker.close(FileMaker.java:132)
>>>     at
>>> ome.services.blitz.repo.AbstractRepositoryI$GetOrCreateRepo.doWork(AbstractRepositoryI.java:301)
>>>
>>>
>>>     at sun.reflect.GeneratedMethodAccessor225.invoke(Unknown Source)
>>>     at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>
>>>
>>>     at java.lang.reflect.Method.invoke(Method.java:597)
>>>     at
>>> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
>>>
>>>
>>>     at
>>> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>>
>>>
>>>     at
>>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>>>
>>>
>>>     at
>>> ome.services.util.Executor$Impl$Interceptor.invoke(Executor.java:508)
>>>     at
>>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>
>>>
>>>     at ome.security.basic.EventHandler.invoke(EventHandler.java:154)
>>>     at
>>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>
>>>
>>>     at
>>> org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:111)
>>>
>>>
>>>     at
>>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>
>>>
>>>     at
>>> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:108)
>>>
>>>
>>>     at
>>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>
>>>
>>>     at
>>> ome.tools.hibernate.ProxyCleanupFilter$Interceptor.invoke(ProxyCleanupFilter.java:241)
>>>
>>>
>>>     at
>>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>
>>>
>>>     at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:116)
>>>     at
>>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>>>
>>>
>>>     at
>>> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
>>>
>>>
>>>     at $Proxy65.doWork(Unknown Source)
>>>     at ome.services.util.Executor$Impl.execute(Executor.java:406)
>>>     at ome.services.util.Executor$Impl.execute(Executor.java:350)
>>>     at
>>> ome.services.blitz.repo.AbstractRepositoryI.takeover(AbstractRepositoryI.java:120)
>>>
>>>
>>>     at sun.reflect.GeneratedMethodAccessor240.invoke(Unknown Source)
>>>     at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>
>>>
>>>     at java.lang.reflect.Method.invoke(Method.java:597)
>>>     at
>>> org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
>>>     at
>>> org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:264)
>>>
>>>
>>>     at
>>> org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
>>>
>>>
>>>     at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
>>>     at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>
>>>
>>>     at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>
>>>
>>>     at java.lang.Thread.run(Thread.java:662)
>>>
>>> _______________________________________________
>>> ome-users mailing list
>>> ome-users at lists.openmicroscopy.org.uk
>>> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
>>>
>>
>>
>> _______________________________________________
>> ome-users mailing list
>> ome-users at lists.openmicroscopy.org.uk
>> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
>
>
> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users





More information about the ome-users mailing list