Application Server 3  4  5 and 6
  1. Application Server 3 4 5 and 6
  2. JBAS-6362

Beans with security domains cannot be hot deployed or redeployed

    Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: JBossAS-5.0.0.GA
    • Fix Version/s: 6.0.0.M1
    • Component/s: Security
    • Security Level: Public (Everyone can see)
    • Labels:
      None
    • Environment:
      Vanilla JBoss 5.0.0.GA with the "default" profile, OSX 10.5, JDK 1.6.0_07
    • Similar Issues:
      Show 10 results 

      Description

      Deploying a trivial service bean fails with "java.lang.IllegalStateException: Security Context has not been set" when a security domain is defined for the bean, either using jboss-app.xml or @SecurityDomain.

      The problem is reproduced with an ear containing a single ejb-jar with a single @Service bean:

      @Service(objectName="test:service=Simple")
      @SecurityDomain("foo")
      public class SimpleBean implements SimpleManagement
      {
      private static Log log = LogFactory.getLog(SimpleBean.class);
      public void start() throws Exception

      { log.info("Simple service initialized!"); }

      }

      This works only if the EAR is present in the appserver at startup (ie, cold start). If the EAR is redeployed, or if the EAR is copied to a running but clean server, it produces this exception:

      00:22:56,981 ERROR [ServiceContainer] Encountered an error in start of SimpleBean
      java.lang.RuntimeException: Problem registering @Management interface for @Service class test.SimpleBean
      at org.jboss.ejb3.service.ServiceContainer.registerManagementInterface(ServiceContainer.java:727)
      at org.jboss.ejb3.service.ServiceContainer.lockedStart(ServiceContainer.java:299)
      at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:879)
      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 org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
      at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
      at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
      at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
      at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
      at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
      at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
      at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
      at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
      at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
      at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
      at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
      at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
      at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
      at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
      at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      at java.lang.Thread.run(Thread.java:637)
      Caused by: java.lang.RuntimeException: javax.management.MBeanException
      at org.jboss.ejb3.deployers.JBossASKernel.installMBean(JBossASKernel.java:181)
      at org.jboss.ejb3.service.ServiceContainer.registerManagementInterface(ServiceContainer.java:699)
      ... 56 more
      Caused by: javax.management.MBeanException
      at org.jboss.ejb3.service.ServiceMBeanDelegate.invoke(ServiceMBeanDelegate.java:219)
      at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.jboss.ejb3.deployers.JBossASKernel.invokeOptionalMethod(JBossASKernel.java:287)
      at org.jboss.ejb3.deployers.JBossASKernel.installMBean(JBossASKernel.java:177)
      ... 57 more
      Caused by: java.lang.IllegalStateException: Security Context has not been set
      at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:151)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:65)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.service.ServiceContainer.localInvoke(ServiceContainer.java:469)
      at org.jboss.ejb3.service.ServiceContainer.localInvoke(ServiceContainer.java:432)
      at org.jboss.ejb3.service.ServiceMBeanDelegate.invoke(ServiceMBeanDelegate.java:215)
      ... 61 more

        Issue Links

          Activity

          Hide
          Andrew Rubinger
          added a comment -

          No, I think there's more to the story here when we factor in redeployment and a possibly null security context. I've asked the user on the forum for a new JIRA and failing use case. This won't make ejb3-as-int:1.0.0-GA. So we'll see what can be done to schedule it in for the next release (2 weeks later as we're going for timeboxing now).

          Show
          Andrew Rubinger
          added a comment - No, I think there's more to the story here when we factor in redeployment and a possibly null security context. I've asked the user on the forum for a new JIRA and failing use case. This won't make ejb3-as-int:1.0.0-GA. So we'll see what can be done to schedule it in for the next release (2 weeks later as we're going for timeboxing now).
          Hide
          Dimitris Andreadis
          added a comment -

          OK, then I'll remove 5.0.1.GA as one of the fix version and re-eval the issue in 5.1.

          Show
          Dimitris Andreadis
          added a comment - OK, then I'll remove 5.0.1.GA as one of the fix version and re-eval the issue in 5.1.
          Hide
          Andrew Rubinger
          added a comment -

          To be rescheduled to a release when more context is available

          Show
          Andrew Rubinger
          added a comment - To be rescheduled to a release when more context is available
          Hide
          Andrew Rubinger
          added a comment -

          Adding test case to EJBTHREE-1738

          Show
          Andrew Rubinger
          added a comment - Adding test case to EJBTHREE-1738
          Hide
          Andrew Rubinger
          added a comment -

          Issue not observed as of EJB3 1.1.11. Probably resolved alongside other fixes in EJBTHREE-1738. Added a testcase to show that redeployment of the deployable results in no errors, and the bean may subsequently be invoked.

          Show
          Andrew Rubinger
          added a comment - Issue not observed as of EJB3 1.1.11. Probably resolved alongside other fixes in EJBTHREE-1738 . Added a testcase to show that redeployment of the deployable results in no errors, and the bean may subsequently be invoked.

            People

            • Assignee:
              Andrew Rubinger
              Reporter:
              Jeff Schnitzer
            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: