Details

      Description

      This patch touches 2 files for 2 different reasons.

      1) the change to org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl.java is only for debugging friendly purpose. When accessing an unregistered ServiceReference, the framework only complain it with a static message, without saying what was the the ServiceReference for. So the error stack is not usable at all. This change includes the captured meta info of the original ServiceReference in the exception message, so at least we can know what was the ServiceReference for.

      2) the change to org/eclipse/osgi/internal/framework/EquinoxContainerAdaptor.java fixes a bug. When having security manager, and removal pending bundles on startup and a bundle state folder with no "bundleFile" (due to a dirty shutdown from previous run). The framework will fail on initialization with the following exception:

      30-Apr-2018 22:52:56.866 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class com.liferay.portal.spring.context.PortalContextLoaderListener
       java.lang.RuntimeException: java.lang.RuntimeException: Could not create bundle file.
       at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:262)
       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
       at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
       at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
       at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:131)
       at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:153)
       at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:143)
       at java.security.AccessController.doPrivileged(Native Method)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:727)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
       at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:587)
       at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1798)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
       at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.RuntimeException: Could not create bundle file.
       at org.eclipse.osgi.storage.Storage.createBundleFile(Storage.java:915)
       at org.eclipse.osgi.storage.BundleInfo$Generation.getBundleFile(BundleInfo.java:77)
       at org.eclipse.osgi.storage.BundleInfo$Generation.getEntry(BundleInfo.java:322)
       at org.eclipse.osgi.internal.framework.EquinoxBundle.getEntry(EquinoxBundle.java:663)
       at org.eclipse.osgi.internal.permadmin.SecurityAdmin.createProtectionDomain(SecurityAdmin.java:350)
       at org.eclipse.osgi.internal.permadmin.SecurityAdmin.createProtectionDomain(SecurityAdmin.java:343)
       at org.eclipse.osgi.storage.BundleInfo$Generation.getDomain(BundleInfo.java:244)
       at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.invalidateWiring(EquinoxContainerAdaptor.java:159)
       at org.eclipse.osgi.container.ModuleWiring.invalidate0(ModuleWiring.java:360)
       at org.eclipse.osgi.container.ModuleWiring.invalidate(ModuleWiring.java:353)
       at org.eclipse.osgi.container.ModuleDatabase.cleanupRemovalPending(ModuleDatabase.java:396)
       at org.eclipse.osgi.container.ModuleDatabase.uninstall(ModuleDatabase.java:295)
       at org.eclipse.osgi.container.ModuleContainer.uninstall(ModuleContainer.java:389)
       at org.eclipse.osgi.storage.Storage.discardBundlesOnLoad(Storage.java:214)
       at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:90)
       at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:67)
       at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31)
       at org.eclipse.osgi.launch.EquinoxFactory.newFramework(EquinoxFactory.java:24)
       at com.liferay.portal.bootstrap.ModuleFrameworkImpl.initFramework(ModuleFrameworkImpl.java:285)
       at com.liferay.portal.module.framework.ModuleFrameworkUtilAdapter.initFramework(ModuleFrameworkUtilAdapter.java:63)
       at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:245)
       ... 17 more
      Caused by: java.io.IOException: The file "/opt/liferay/osgi/state/org.eclipse.osgi/907/0/bundleFile" does not exist
       at org.eclipse.osgi.storage.bundlefile.ZipBundleFile.<init>(ZipBundleFile.java:52)
       at org.eclipse.osgi.storage.Storage.createBundleFile(Storage.java:912)
       ... 37 more
      

        Attachments

          Activity

            People

            • Assignee:
              brian.chan Brian Chan
              Reporter:
              andrea.digiorgi Andrea Di Giorgi (Inactive)
              Participants of an Issue:
              Recent user:
              Michael Saechang
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 27 weeks, 6 days ago

                Packages

                Version Package
                7.1.0 Beta 1
                7.1.X
                Master