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

Axis library design doesn't seem to match quite well with OSGi classloader paradigm

    Details

      Description

      Classloader in AxisProperties are only assigned on initialization:

      private static synchronized ClassLoaders getClassLoaders() {
              if (loaders == null) {
                  loaders = ClassLoaders.getAppLoaders(AxisProperties.class, null, true);
              }
              return loaders;
       }
      

      This can cause several problems when:

      • Having several modules that import Liferay Axis Extender.
      • Updating modules that import Liferay Axis Extender withou stopping/starting server.

      Steps to Reproduce:

      1. Create a module that instantiates an org.apache.axis.client.Service
      2. Deploy the module and use it.
      3. Deploy a new version of the module and use it.

      Expected Results:
      Everything works fine.

      Actual Results:
      A similar exception to the following one, being 558 the module identifier, will be generated:

      java.io.IOException: Exception in opening zip file: /opt/liferay/osgi/state/org.eclipse.osgi/558/0/bundleFile
              at org.eclipse.osgi.framework.util.SecureAction.getZipFile(SecureAction.java:305)
              at org.eclipse.osgi.storage.bundlefile.ZipBundleFile.basicOpen(ZipBundleFile.java:85)
              at org.eclipse.osgi.storage.bundlefile.ZipBundleFile.getZipFile(ZipBundleFile.java:98)
              at org.eclipse.osgi.storage.bundlefile.ZipBundleFile.checkedOpen(ZipBundleFile.java:65)
              at org.eclipse.osgi.storage.bundlefile.ZipBundleFile.getEntry(ZipBundleFile.java:232)
              at org.eclipse.osgi.storage.bundlefile.BundleFile.getResourceURL(BundleFile.java:136)
              at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findResourceImpl(ClasspathManager.java:420)
              at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalResourceImpl(ClasspathManager.java:367)
              at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalResource(ClasspathManager.java:353)
              at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalResource(ModuleClassLoader.java:316)
              at org.eclipse.osgi.internal.loader.BundleLoader.findLocalResource(BundleLoader.java:804)
              at org.eclipse.osgi.internal.loader.BundleLoader.findResource(BundleLoader.java:588)
              at org.eclipse.osgi.internal.loader.ModuleClassLoader.getResource(ModuleClassLoader.java:201)
              at org.apache.commons.discovery.jdk.JDK12Hooks.getResources(JDK12Hooks.java:141)
              at org.apache.commons.discovery.resource.DiscoverResources$1.getNextResources(DiscoverResources.java:112)
              at org.apache.commons.discovery.resource.DiscoverResources$1.getNextResource(DiscoverResources.java:88)
              at org.apache.commons.discovery.resource.DiscoverResources$1.hasNext(DiscoverResources.java:75)
              at org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.getNextClassNames(DiscoverNamesInFile.java:198)
              at org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.getNextClassName(DiscoverNamesInFile.java:182)
              at org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.hasNext(DiscoverNamesInFile.java:169)
              at org.apache.commons.discovery.resource.names.NameDiscoverers$1.getNextIterator(NameDiscoverers.java:102)
              at org.apache.commons.discovery.resource.names.NameDiscoverers$1.hasNext(NameDiscoverers.java:85)
              at org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.getNextResource(ResourceClassDiscoverImpl.java:118)
              at org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.hasNext(ResourceClassDiscoverImpl.java:106)
              at org.apache.axis.configuration.EngineConfigurationFactoryFinder$1.run(EngineConfigurationFactoryFinder.java:120)
              at java.security.AccessController.doPrivileged(Native Method)
              at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:113)
              at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:160)
              at org.apache.axis.client.Service.getEngineConfiguration(Service.java:813)
              at org.apache.axis.client.Service.getAxisClient(Service.java:104)
              at org.apache.axis.client.Service.<init>(Service.java:113)
      

      because now the osgi state module path will be /opt/liferay/osgi/state/org.eclipse.osgi/558/1/bundleFile

        Attachments

          Activity

            People

            • Assignee:
              joyce.wang Joyce Wang
              Reporter:
              mariano.alvaro Mariano Álvaro
              Participants of an Issue:
              Recent user:
              Csaba Turcsan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 12 weeks, 1 day ago

                Packages

                Version Package
                7.0.0 DXP FP28
                7.0.X EE
                7.0.4 CE GA5
                7.1.X
                Master