1 Reply Latest reply on Jan 23, 2015 4:08 AM by valsaraj viswanathan

    NameNotFoundException due to policyRegistration -- service jboss.naming.context.java.policyRegistration shows in DEBUG log

    Chao Wang Newbie

      Hello,  I saw an "Exception caught: javax.naming.NameNotFoundException: policyRegistration -- service jboss.naming.context.java.policyRegistration" when I ran a quickstart Example ejb-security with TRACE level on "org.jboss.security" category against current WFLY master. (in fact, exception is in DEBUG level as below)

       

      It only happens  while I try to login on page: http://localhost:8080/wildfly-ejb-security/ with username and password. The result is successful, however, I notice following exception in server.log file:

       

      2014-10-15 21:50:16,436 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 9.0.0.Alpha2-SNAPSHOT (WildFly Core 1.0.0.Alpha9) started in 3332ms - Started 199 of 361 services (192 services are lazy, passive or on-demand)
      2014-10-15 21:50:28,213 INFO  [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0001: Content added at location /home/wangchao/work/jboss/wildfly/wildfly/build/target/wildfly-9.0.0.Alpha2-SNAPSHOT/standalone/data/content/0a/cbc747417c1693e4066360521072f0314125fa/content
      2014-10-15 21:50:28,235 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "wildfly-ejb-security.war" (runtime-name: "wildfly-ejb-security.war")
      2014-10-15 21:50:28,526 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) WFLYWELD0003: Processing weld deployment wildfly-ejb-security.war
      2014-10-15 21:50:28,570 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-4) HV000001: Hibernate Validator 5.1.2.Final
      2014-10-15 21:50:28,630 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named SecuredEJB in deployment unit deployment "wildfly-ejb-security.war" are as follows:
      
          java:global/wildfly-ejb-security/SecuredEJB!org.jboss.as.quickstarts.ejb_security.SecuredEJB
          java:app/wildfly-ejb-security/SecuredEJB!org.jboss.as.quickstarts.ejb_security.SecuredEJB
          java:module/SecuredEJB!org.jboss.as.quickstarts.ejb_security.SecuredEJB
          java:global/wildfly-ejb-security/SecuredEJB
          java:app/wildfly-ejb-security/SecuredEJB
          java:module/SecuredEJB
      
      2014-10-15 21:50:28,812 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0006: Starting Services for CDI deployment: wildfly-ejb-security.war
      2014-10-15 21:50:28,890 INFO  [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900: 2.2.5 (Final)
      2014-10-15 21:50:28,941 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) WFLYWELD0009: Starting weld service for deployment wildfly-ejb-security.war
      2014-10-15 21:50:29,051 TRACE [org.jboss.security] (MSC service thread 1-3) PBOX000337: nextState for action getPolicyConfiguration: open
      2014-10-15 21:50:29,051 DEBUG [org.jboss.security] (MSC service thread 1-3) PBOX000307: Constructing JBossPolicyConfiguration with contextID wildfly-ejb-security.war
      2014-10-15 21:50:29,052 TRACE [org.jboss.security] (MSC service thread 1-3) PBOX000337: nextState for action getPolicyConfiguration: open
      2014-10-15 21:50:29,053 TRACE [org.jboss.security] (MSC service thread 1-3) PBOX000310: addToRole, permission: ("javax.security.jacc.EJBMethodPermission" "SecuredEJB" "getSecurityInfo,Local,")[Local:getSecurityInfo()]
      2014-10-15 21:50:29,054 TRACE [org.jboss.security] (MSC service thread 1-3) PBOX000337: nextState for action addToRole: open
      2014-10-15 21:50:29,054 TRACE [org.jboss.security] (MSC service thread 1-3) PBOX000310: addToRole, permission: [SecuredEJB,role-ref=guest]
      2014-10-15 21:50:29,054 TRACE [org.jboss.security] (MSC service thread 1-3) PBOX000337: nextState for action addToRole: open
      2014-10-15 21:50:29,054 TRACE [org.jboss.security] (MSC service thread 1-3) PBOX000310: addToRole, permission: [SecuredEJB,role-ref=**]
      2014-10-15 21:50:29,054 TRACE [org.jboss.security] (MSC service thread 1-3) PBOX000337: nextState for action addToRole: open
      2014-10-15 21:50:29,055 TRACE [org.jboss.security] (MSC service thread 1-3) PBOX000314: commit, contextID: wildfly-ejb-security.war
      2014-10-15 21:50:29,055 TRACE [org.jboss.security] (MSC service thread 1-3) PBOX000337: nextState for action commit: inService
      2014-10-15 21:50:29,913 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000354: Setting security roles ThreadLocal: null
      2014-10-15 21:50:29,914 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000354: Setting security roles ThreadLocal: null
      2014-10-15 21:50:29,914 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0021: Registered web context: /wildfly-ejb-security
      2014-10-15 21:50:29,915 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000337: nextState for action getPolicyConfiguration: open
      2014-10-15 21:50:29,918 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000312: addToUncheckedPolicy, permission: ("javax.security.jacc.WebResourcePermission" "/")
      2014-10-15 21:50:29,918 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000337: nextState for action addToUncheckedPolicy: open
      2014-10-15 21:50:29,918 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000312: addToUncheckedPolicy, permission: ("javax.security.jacc.WebUserDataPermission" "/")
      2014-10-15 21:50:29,918 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000337: nextState for action addToUncheckedPolicy: open
      2014-10-15 21:50:29,918 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000312: addToUncheckedPolicy, permission: ("javax.security.jacc.WebUserDataPermission" "/")
      2014-10-15 21:50:29,918 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000337: nextState for action addToUncheckedPolicy: open
      2014-10-15 21:50:29,919 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000310: addToRole, permission: ("javax.security.jacc.WebRoleRefPermission" "org.jboss.as.quickstarts.ejb_security.SecuredEJBServlet" "**")
      2014-10-15 21:50:29,919 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000337: nextState for action addToRole: open
      2014-10-15 21:50:29,919 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000310: addToRole, permission: ("javax.security.jacc.WebRoleRefPermission" "" "**")
      2014-10-15 21:50:29,919 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000337: nextState for action addToRole: open
      2014-10-15 21:50:29,919 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000314: commit, contextID: wildfly-ejb-security.war
      2014-10-15 21:50:29,919 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000337: nextState for action commit: inService
      2014-10-15 21:50:30,044 INFO  [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0010: Deployed "wildfly-ejb-security.war" (runtime-name : "wildfly-ejb-security.war")
      2014-10-15 21:50:34,244 TRACE [org.jboss.security] (default task-1) PBOX000354: Setting security roles ThreadLocal: null
      2014-10-15 21:50:53,612 TRACE [org.jboss.security] (default task-2) PBOX000200: Begin isValid, principal: org.wildfly.extension.undertow.security.AccountImpl$AccountPrincipal@cde5800, cache entry: null
      2014-10-15 21:50:53,612 TRACE [org.jboss.security] (default task-2) PBOX000209: defaultLogin, principal: org.wildfly.extension.undertow.security.AccountImpl$AccountPrincipal@cde5800
      2014-10-15 21:50:53,614 TRACE [org.jboss.security] (default task-2) PBOX000221: Begin getAppConfigurationEntry(other), size: 3
      2014-10-15 21:50:53,619 TRACE [org.jboss.security] (default task-2) PBOX000224: End getAppConfigurationEntry(other), AuthInfo: AppConfigurationEntry[]:
      [0]
      LoginModule Class: org.jboss.as.security.remoting.RemotingLoginModule
      ControlFlag: LoginModuleControlFlag: optional
      Options:
      name=password-stacking, value=useFirstPass
      [1]
      LoginModule Class: org.jboss.as.security.RealmDirectLoginModule
      ControlFlag: LoginModuleControlFlag: required
      Options:
      name=password-stacking, value=useFirstPass
      
      2014-10-15 21:50:53,623 TRACE [org.jboss.security] (default task-2) PBOX000236: Begin initialize method
      2014-10-15 21:50:53,623 TRACE [org.jboss.security] (default task-2) PBOX000240: Begin login method
      2014-10-15 21:50:53,625 TRACE [org.jboss.security] (default task-2) PBOX000236: Begin initialize method
      2014-10-15 21:50:53,626 TRACE [org.jboss.security] (default task-2) PBOX000240: Begin login method
      2014-10-15 21:50:53,639 TRACE [org.jboss.security] (default task-2) PBOX000241: End login method, isValid: true
      2014-10-15 21:50:53,639 TRACE [org.jboss.security] (default task-2) PBOX000242: Begin commit method, overall result: false
      2014-10-15 21:50:53,639 TRACE [org.jboss.security] (default task-2) PBOX000242: Begin commit method, overall result: true
      2014-10-15 21:50:53,643 TRACE [org.jboss.security] (default task-2) PBOX000210: defaultLogin, login context: javax.security.auth.login.LoginContext@6190405c, subject: Subject(517536257).principals=org.jboss.security.SimplePrincipal@923101049(quickstartUser)org.jboss.security.SimpleGroup@1137464615(Roles(members:guest))org.jboss.security.SimpleGroup@1137464615(CallerPrincipal(members:quickstartUser))
      2014-10-15 21:50:53,645 TRACE [org.jboss.security] (default task-2) PBOX000207: updateCache, input subject: Subject(517536257).principals=org.jboss.security.SimplePrincipal@923101049(quickstartUser)org.jboss.security.SimpleGroup@1137464615(Roles(members:guest))org.jboss.security.SimpleGroup@1137464615(CallerPrincipal(members:quickstartUser)), cached subject: Subject(1025222123).principals=org.jboss.security.SimplePrincipal@923101049(quickstartUser)org.jboss.security.SimpleGroup@1137464615(Roles(members:guest))org.jboss.security.SimpleGroup@1137464615(CallerPrincipal(members:quickstartUser))
      2014-10-15 21:50:53,646 TRACE [org.jboss.security] (default task-2) PBOX000208: Inserted cache info: org.jboss.security.authentication.JBossCachedAuthenticationManager$DomainInfo@78f6aa6
      2014-10-15 21:50:53,646 TRACE [org.jboss.security] (default task-2) PBOX000201: End isValid, result = true
      2014-10-15 21:50:53,670 TRACE [org.jboss.security] (default task-2) PBOX000200: Begin isValid, principal: org.wildfly.extension.undertow.security.AccountImpl$AccountPrincipal@cde5800, cache entry: org.jboss.security.authentication.JBossCachedAuthenticationManager$DomainInfo@78f6aa6
      2014-10-15 21:50:53,670 TRACE [org.jboss.security] (default task-2) PBOX000204: Begin validateCache, domainInfo: org.jboss.security.authentication.JBossCachedAuthenticationManager$DomainInfo@78f6aa6, credential class: class [C
      2014-10-15 21:50:53,670 TRACE [org.jboss.security] (default task-2) PBOX000205: End validateCache, result = true
      2014-10-15 21:50:53,671 TRACE [org.jboss.security] (default task-2) PBOX000201: End isValid, result = true
      2014-10-15 21:50:53,672 TRACE [org.jboss.security.audit] (default task-2) [Success]Source=org.jboss.as.security.service.SimpleSecurityManager;Action=authentication;principal=quickstartUser;
      2014-10-15 21:50:53,673 TRACE [org.jboss.security] (default task-2) PBOX000354: Setting security roles ThreadLocal: {}
      2014-10-15 21:50:53,677 DEBUG [org.jboss.security] (default task-2) PBOX000293: Exception caught: javax.naming.NameNotFoundException: policyRegistration -- service jboss.naming.context.java.policyRegistration
          at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)
          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:202)
          at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:233)
          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:188)
          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)
          at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_67]
          at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_67]
          at org.jboss.security.plugins.javaee.EJBAuthorizationHelper.getPolicyRegistrationFromJNDI(EJBAuthorizationHelper.java:353) [picketbox-4.9.0.Beta1.jar:4.9.0.Beta1]
          at org.jboss.security.plugins.javaee.EJBAuthorizationHelper.authorize(EJBAuthorizationHelper.java:303) [picketbox-4.9.0.Beta1.jar:4.9.0.Beta1]
          at org.jboss.as.security.service.SimpleSecurityManager.authorize(SimpleSecurityManager.java:266) [wildfly-security-9.0.0.Alpha2-SNAPSHOT.jar:9.0.0.Alpha2-SNAPSHOT]
          at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:132) [wildfly-ejb3-9.0.0.Alpha2-SNAPSHOT.jar:9.0.0.Alpha2-SNAPSHOT]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
          at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100) [wildfly-ejb3-9.0.0.Alpha2-SNAPSHOT.jar:9.0.0.Alpha2-SNAPSHOT]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
          at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [wildfly-ejb3-9.0.0.Alpha2-SNAPSHOT.jar:9.0.0.Alpha2-SNAPSHOT]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
          at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [wildfly-ejb3-9.0.0.Alpha2-SNAPSHOT.jar:9.0.0.Alpha2-SNAPSHOT]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
          at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
          at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
          at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:450)
          at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
          at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
          at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
          at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
          at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
          at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)
          at org.jboss.as.quickstarts.ejb_security.SecuredEJB$$$view1.getSecurityInfo(Unknown Source) [classes:]
          at org.jboss.as.quickstarts.ejb_security.SecuredEJBServlet.doGet(SecuredEJBServlet.java:63) [classes:]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
          at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.2.0.Beta1.jar:1.2.0.Beta1]
          at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33) [undertow-core-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51) [undertow-core-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63) [undertow-servlet-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56) [undertow-servlet-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) [undertow-core-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.2.0.Beta1.jar:1.2.0.Beta1]
          at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247) [undertow-servlet-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76) [undertow-servlet-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166) [undertow-servlet-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.server.Connectors.executeRootHandler(Connectors.java:198) [undertow-core-1.2.0.Beta1.jar:1.2.0.Beta1]
          at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:744) [undertow-core-1.2.0.Beta1.jar:1.2.0.Beta1]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
          at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
      
      2014-10-15 21:50:53,686 DEBUG [org.jboss.security] (default task-2) PBOX000291: Method: getSecurityInfo, interface: Local, required roles: Roles(guest,)
      2014-10-15 21:50:53,687 TRACE [org.jboss.security.audit] (default task-2) [Success]Source=org.jboss.security.plugins.javaee.EJBAuthorizationHelper;Action=authorization;Resource:=[org.jboss.security.authorization.resources.EJBResource:contextMap={policyRegistration=null}:method=public java.lang.String org.jboss.as.quickstarts.ejb_security.SecuredEJB.getSecurityInfo():ejbMethodInterface=Local:ejbName=SecuredEJB:ejbPrincipal=org.wildfly.extension.undertow.security.AccountImpl$AccountPrincipal@cde5800:MethodRoles=Roles(guest,):securityRoleReferences=null:callerSubject=Subject:
          Principal: org.wildfly.extension.undertow.security.AccountImpl$AccountPrincipal@cde5800
          Principal: Roles(members:guest)
          Principal: CallerPrincipal(members:quickstartUser)
      :callerRunAs=null:callerRunAs=null:ejbRestrictionEnforcement=false:ejbVersion=2.0];policyRegistration=null;
      2014-10-15 21:50:53,703 TRACE [org.jboss.security] (default task-2) PBOX000354: Setting security roles ThreadLocal: null
      2014-10-15 21:50:53,705 TRACE [org.jboss.security] (default task-2) PBOX000354: Setting security roles ThreadLocal: null
      2014-10-15 21:51:01,659 DEBUG [org.jboss.as.security] (MSC service thread 1-2) Stopping security domain service jboss-ejb-policy
      2014-10-15 21:51:01,660 TRACE [org.jboss.security] (MSC service thread 1-2) PBOX000227: removeAppConfig(jboss-ejb-policy)
      2014-10-15 21:51:01,690 DEBUG [org.jboss.as.security] (MSC service thread 1-7) Stopping security domain service jboss-web-policy
      2014-10-15 21:51:01,690 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000227: removeAppConfig(jboss-web-policy)
      2014-10-15 21:51:01,691 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000337: nextState for action getPolicyConfiguration: open
      2014-10-15 21:51:01,691 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000315: delete, contextID: wildfly-ejb-security.war
      2014-10-15 21:51:01,691 TRACE [org.jboss.security] (MSC service thread 1-7) PBOX000337: nextState for action delete: deleted
      2014-10-15 21:51:01,694 TRACE [org.jboss.security] (MSC service thread 1-8) PBOX000337: nextState for action getPolicyConfiguration: open
      2014-10-15 21:51:01,694 TRACE [org.jboss.security] (MSC service thread 1-8) PBOX000315: delete, contextID: wildfly-ejb-security.war
      2014-10-15 21:51:01,694 TRACE [org.jboss.security] (MSC service thread 1-8) PBOX000337: nextState for action delete: deleted
      2014-10-15 21:51:01,701 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0022: Unregistered web context: /wildfly-ejb-security
      2014-10-15 21:51:01,702 TRACE [org.jboss.security] (MSC service thread 1-5) PBOX000354: Setting security roles ThreadLocal: null
      2014-10-15 21:51:01,704 TRACE [org.jboss.security] (MSC service thread 1-5) PBOX000354: Setting security roles ThreadLocal: null
      2014-10-15 21:51:01,710 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0019: Host default-host stopping
      2014-10-15 21:51:01,723 INFO  [org.jboss.weld.deployer] (MSC service thread 1-8) WFLYWELD0010: Stopping weld service for deployment wildfly-ejb-security.war
      2014-10-15 21:51:01,720 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) WFLYJCA0010: Unbound data source [java:jboss/datasources/ExampleDS]
      2014-10-15 21:51:01,725 DEBUG [org.jboss.as.security] (MSC service thread 1-5) Stopping security domain service other
      2014-10-15 21:51:01,725 TRACE [org.jboss.security] (MSC service thread 1-5) PBOX000227: removeAppConfig(other)
      2014-10-15 21:51:01,743 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) WFLYJCA0019: Stopped Driver service with driver-name = h2
      2014-10-15 21:51:01,751 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0008: Undertow HTTP listener default suspending
      2014-10-15 21:51:01,752 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0007: Undertow HTTP listener default stopped, was bound to /127.0.0.1:8080
      2014-10-15 21:51:01,758 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0028: Stopped deployment wildfly-ejb-security.war (runtime-name: wildfly-ejb-security.war) in 94ms
      2014-10-15 21:51:01,758 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0004: Undertow 1.2.0.Beta1 stopping
      2014-10-15 21:51:01,775 INFO  [org.jboss.as] (MSC service thread 1-3) WFLYSRV0050: WildFly Full 9.0.0.Alpha2-SNAPSHOT (WildFly Core 1.0.0.Alpha9) stopped in 94ms
      

       

      Is this a real bug?

       

      I'm not sure if this has a relation, but I thought this may relate to an EAP issue about @RunAs which uses for Servlet init() and destroy() methods.  So, I have an additional question about security-domain authorization. As per comment 6 in Regression of role-based authorization "jboss-ejb-policy" and "jboss-web-policy" domains just define the default authorization modules. Is there an order when server stops these security domain services? Seems that there is no dependency relation among them, this can cause an problem during server shutdown, if a web application uses the default "other" as its security domain, "jboss-ejb-policy" and "jboss-web-policy" services are stopped before stopping WebDeploymentService. Thus, no authorization module can use for application undeployment.