9 Replies Latest reply on Dec 1, 2011 5:07 AM by guinotphil

    Sealed packages & modules.

    guinotphil Apprentice

      Hi,

       

      I'm currently having an issue with a lib that use sealed packages that I want to use as a JBoss Modules.

       

      The library is OpenOffice, and I created the module org.openoffice.

       

      Here is my module.xml:

      <?xml version="1.0" encoding="UTF-8"?>

      <module xmlns="urn:jboss:module:1.0" name="org.openoffice">

        <resources>

          <resource-root path="juh-3.2.1.jar"/>

          <resource-root path="jurt-3.2.1.jar"/>

          <resource-root path="ridl-3.2.1.jar"/>

          <resource-root path="unoil-3.2.1.jar"/>

        </resources>

       

        <dependencies>

        </dependencies>

      </module>

       

       

      And here is the manifest.xml of each library:

       

      juh-3.2.1.jar:

      Manifest-Version: 1.0

      Class-Path: ridl.jar jurt.jar ../../lib/ ../bin/

      Solar-Version: 320m14(Build:9489)

      Sealed: true

      RegistrationClassName: com.sun.star.comp.JavaUNOHelperServices

      UNO-Type-Path:

       

      jurt-3.2.1.jar:

      Manifest-Version: 1.0

      Class-Path: ridl.jar unoloader.jar ../../lib/ ../bin/

      Solar-Version: 320m14(Build:9489)

      Sealed: true

       

      Name: com/sun/star/lib/util/

      Sealed: false

       

       

      Name: com/sun/star/uno/

      Sealed: false

       

      ridl-3.2.1.jar:

      Manifest-Version: 1.0

      Solar-Version: 320m14(Build:9489)

       

      unoil-3.2.1.jar:

      Manifest-Version: 1.0

      Solar-Version: 320m14(Build:9489)

       

      As you can see, only a couple of JAR use the sealing facilities.

       

      My problem comes with the com.sun.star.uno package.

      2 jars define classes in this package:

      • ridl-3.2.1.jar, which has no sealing restriction.
      • jurt-3.2.1.jar, which has restriction, but NOT for this package

       

      When starting the server, I got the following Exception:

       

      17:14:51,826 WARN  [org.jboss.modules] (MSC service thread 1-8) Failed to define class com.sun.star.lang.DisposedException in Module "org.openoffice:main" from local module loader @b92a848 (roots: C:\DEV\jboss-as-7.1.0.Alpha2-SNAPSHOT\modules): java.lang.SecurityException: sealing violation: package com.sun.star.uno is sealed

                at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:354) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:261) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:76) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.Module.loadModuleClass(Module.java:590) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:183) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103) [jboss-modules.jar:1.0.2.GA]

                at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_27]

                at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [:1.6.0_27]

                at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [:1.6.0_27]

                at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [:1.6.0_27]

                at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:397) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:261) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:76) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.Module.loadModuleClass(Module.java:590) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:183) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310) [jboss-modules.jar:1.0.2.GA]

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103) [jboss-modules.jar:1.0.2.GA]

                at java.lang.Class.getDeclaredFields0(Native Method) [:1.6.0_27]

                at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [:1.6.0_27]

                at java.lang.Class.getDeclaredFields(Class.java:1743) [:1.6.0_27]

                at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57)

                at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)

                at org.jboss.as.ee.component.EEModuleClassDescription$DefaultConfigurator.configure(EEModuleClassDescription.java:176)

                at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:147)

                at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:122)

                at org.jboss.as.ee.component.LazyValue.get(LazyValue.java:40)

                at org.jboss.as.ee.component.EEApplicationDescription.getClassConfiguration(EEApplicationDescription.java:183)

                at org.jboss.as.ee.component.ComponentDescription.createConfiguration(ComponentDescription.java:153)

                at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:70)

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_27]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_27]

                at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]

       

       

      Looks like the "Sealed: false" option in MANIFEST.MF does not 'unseal' the package.

       

      And too bad, after removing the sealed options in the jurt jar, I still get the same error. Had to remove the options in the juh jar to fix the issue. But the juh jar has ONLY the following packages:

      • com.sun.star.comp
      • com.sun.star.comp.helper
      • com.sun.star.comp.juhtest
      • com.sun.star.lib.uno.adapter
      • com.sun.star.lib.uno.helper

       

      Thank you for your help