Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-65860

JCRStore is not properly closing its resources when refreshing the bundle

    Details

      Description

      Steps to reproduce:

      • configure portal to use JCR Store
        • Add dl.store.impl=com.liferay.portal.store.jcr.JCRStore to portal-ext.properties
      • Start portal
      • Add a valid configuration for JCR Store: Control Panel > Configuration > System Settings > Foundation
      • Add a document, verifying it is properly saved
      • Open a terminal, and launch gogo shell (telnet localhost PORT)
      • type lb | grep JCR to identify JCR Store bundle's ID
      • type refresh ID
      • Add a document again

      Expected behaviour: the document is saved
      Actual behaviour: the document is not saved, portlet is not available, and stacktrace is present on console:

      10:10:31,025 ERROR [Refresh Thread: Equinox Container: a0164f69-ef18-0016-10f4-9787922bca1a][com_liferay_portal_store_jcr:97] [com.liferay.portal.store.jcr.JCRStore(2474)] The deactivate method has thrown an exception
      javax.jcr.RepositoryException: The repository home /Users/manuel/liferay-workspace/trunk/bundles/tomcat-8.0.32/home appears to be in use since the file named .lock is already locked by the current process.
      	at org.apache.jackrabbit.core.util.RepositoryLock.tryLock(RepositoryLock.java:159)
      	at org.apache.jackrabbit.core.util.RepositoryLock.acquire(RepositoryLock.java:138)
      	at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:275)
      	at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:602)
      	at org.apache.jackrabbit.core.TransientRepository$2.getRepository(TransientRepository.java:231)
      	at org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:279)
      	at org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:375)
      	at com.liferay.portal.store.jcr.jackrabbit.JCRFactoryImpl.createSession(JCRFactoryImpl.java:87)
      	at com.liferay.portal.store.jcr.JCRFactoryWrapper.createSession(JCRFactoryWrapper.java:77)
      	at com.liferay.portal.store.jcr.JCRFactoryWrapper.createSession(JCRFactoryWrapper.java:51)
      	at com.liferay.portal.store.jcr.JCRStore.deactivate(JCRStore.java:875)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:222)
      	at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:37)
      	at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:615)
      	at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:499)
      	at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:295)
      	at org.apache.felix.scr.impl.manager.SingleComponentManager.disposeImplementationObject(SingleComponentManager.java:342)
      	at org.apache.felix.scr.impl.manager.SingleComponentManager.deleteComponent(SingleComponentManager.java:157)
      	at org.apache.felix.scr.impl.manager.AbstractComponentManager.doDeactivate(AbstractComponentManager.java:783)
      	at org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:757)
      	at org.apache.felix.scr.impl.manager.AbstractComponentManager.dispose(AbstractComponentManager.java:550)
      	at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.disposeComponents(ConfigurableComponentHolder.java:725)
      	at org.apache.felix.scr.impl.BundleComponentActivator.dispose(BundleComponentActivator.java:530)
      	at org.apache.felix.scr.impl.Activator.disposeComponents(Activator.java:414)
      	at org.apache.felix.scr.impl.Activator.access$300(Activator.java:53)
      	at org.apache.felix.scr.impl.Activator$ScrExtension.destroy(Activator.java:273)
      	at org.apache.felix.utils.extender.AbstractExtender$2.run(AbstractExtender.java:290)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at org.apache.felix.utils.extender.AbstractExtender.destroyExtension(AbstractExtender.java:312)
      	at org.apache.felix.utils.extender.AbstractExtender.bundleChanged(AbstractExtender.java:186)
      	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:905)
      	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
      	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
      	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)
      	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)
      	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)
      	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)
      	at org.eclipse.osgi.container.Module.publishEvent(Module.java:461)
      	at org.eclipse.osgi.container.Module.doStop(Module.java:619)
      	at org.eclipse.osgi.container.Module.stop(Module.java:483)
      	at org.eclipse.osgi.container.ModuleContainer.unresolve0(ModuleContainer.java:841)
      	at org.eclipse.osgi.container.ModuleContainer.unresolve(ModuleContainer.java:755)
      	at org.eclipse.osgi.container.ModuleContainer.refresh(ModuleContainer.java:953)
      	at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1336)
      	at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1)
      	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
      	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
      

        Attachments

        1. fix4.png
          52 kB
          Ian Song
        2. reproduce4.png
          81 kB
          Ian Song

          Activity

            People

            Assignee:
            ian.song Ian Song (Inactive)
            Reporter:
            manuel.delapenya Manuel de la Peña (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              5 years, 23 weeks ago

                Packages

                Version Package
                7.0.1 CE GA2