glassfish
  1. glassfish
  2. GLASSFISH-18297

security module prevents the domain to start when javax.ejb is not in module directory

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1.2_b20, 4.0_b22
    • Fix Version/s: future release
    • Component/s: security
    • Labels:
      None
    • Environment:

      glassfish 3.1.2

      Description

      As part of minnow distribution, we need to be able get rid of ejb related jars. I removed javax.ejb.jar and ejb-internal-api.jar from modules directory and then tried to start the domain. I did all the following experiments on a 3.1.2-minnow branch local workspace. The current goal is to be able to start the domain and deploy a simple war file without javax.ejb.jar and ejb-internal-api.jar present in the modules directory.

      1) An other issue is happening before this one first, you need to apply the following workaround to see the issue:

      • update dol.jar's manifest file with the following entry in Import-Package section:
        javax.interceptor;resolution:=optional;version="3.1"
        

      2) Then you also need to update security.jar's manifest with the following entries in Import-Package section:

      javax.ejb;resolution:=optional;version="3.1"
      org.glassfish.ejb.api;resolution:=optional;version="3.1"
      

      3) start the domain, the following trace appears in the server.log:

      [#|2012-02-01T19:33:44.424+0100|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=10;_ThreadName=Thread-2;|Unable to start v3. Closing all ports
      org.jvnet.hk2.component.ComponentException: injection failed on com.sun.enterprise.v3.admin.AdminAdapter.authenticator with interface org.glassfish.internal.api.AdminAccessController
      	at org.jvnet.hk2.component.InjectionManager.error_injectionException(InjectionManager.java:284)
      	at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:161)
      	at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:93)
      	at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:126)
      	at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
      	at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
      	at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
      	at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
      	at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)
      	at org.jvnet.hk2.component.Habitat$5.get(Habitat.java:703)
      	at java.util.AbstractList$Itr.next(AbstractList.java:345)
      	at com.sun.enterprise.v3.services.impl.GrizzlyService.registerNetworkProxy(GrizzlyService.java:492)
      	at com.sun.enterprise.v3.services.impl.GrizzlyService.postConstruct(GrizzlyService.java:407)
      	at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
      	at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
      	at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
      	at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
      	at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
      	at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)
      	at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:253)
      	at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:145)
      	at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:136)
      	at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
      	at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
      	at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
      	at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
      	at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
      Caused by: org.jvnet.hk2.component.ComponentException: injection failed on com.sun.enterprise.container.common.GenericAdminAuthenticator.snif with class com.sun.enterprise.security.SecuritySniffer
      	at org.jvnet.hk2.component.InjectionManager.error_injectionException(InjectionManager.java:284)
      	at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:161)
      	at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:93)
      	at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:126)
      	at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
      	at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
      	at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
      	at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
      	at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)
      	at org.jvnet.hk2.component.Habitat.getComponent(Habitat.java:798)
      	at com.sun.hk2.component.InjectInjectionResolver.getServiceInjectValue(InjectInjectionResolver.java:147)
      	at com.sun.hk2.component.InjectInjectionResolver.getValue(InjectInjectionResolver.java:88)
      	at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:143)
      	... 30 more
      Caused by: org.jvnet.hk2.component.ComponentException: Failed to create class com.sun.enterprise.security.SecuritySniffer
      	at com.sun.hk2.component.ConstructorCreator.create(ConstructorCreator.java:71)
      	at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:80)
      	at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
      	at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
      	at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)
      	at org.jvnet.hk2.component.Habitat.getBy(Habitat.java:1056)
      	at org.jvnet.hk2.component.Habitat.getByType(Habitat.java:1037)
      	at com.sun.hk2.component.InjectInjectionResolver.getComponentInjectValue(InjectInjectionResolver.java:159)
      	at com.sun.hk2.component.InjectInjectionResolver.getValue(InjectInjectionResolver.java:90)
      	at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:143)
      	... 41 more
      Caused by: java.lang.NoClassDefFoundError: javax/ejb/Stateless
      	at com.sun.enterprise.security.SecuritySniffer.<clinit>(SecuritySniffer.java:70)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      	at java.lang.Class.newInstance0(Class.java:355)
      	at java.lang.Class.newInstance(Class.java:308)
      	at com.sun.hk2.component.ConstructorCreator.create(ConstructorCreator.java:65)
      	... 50 more
      Caused by: java.lang.ClassNotFoundException: javax.ejb.Stateless not found by org.glassfish.main.security [16]
      	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)
      	at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      	... 58 more
      |#]
      

      I tracked the usage of javax.ejb package in the following class:

      • security/core/src/main/java/com/sun/enterprise/security/SecuritySniffer.java

      I also tracked the usage of org.glassfish.ejb.api package in the following class:

      • security/core/src/main/java/com/sun/enterprise/security/authorize/EJBPolicyContextDelegate.java

        Activity

        Hide
        Joe Di Pol added a comment -

        Excluding from 3.1.2 release since this is not a stopper for 3.1.2

        Show
        Joe Di Pol added a comment - Excluding from 3.1.2 release since this is not a stopper for 3.1.2

          People

          • Assignee:
            JeffTancill
            Reporter:
            Romain Grécourt
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: