Problems calling Secured EJB remotely from a Standalone client in EAP 6
Issue
- The EJB is configured with
@SecurityDomainand the@RolesAllowedAnnotation. - When the Username/PAssword is provided programmatically using the InitialContext the authentication is not working but when it is the same is included into the jboss-
ejb-client.propertiesthe authentication is successful. - When the EJB Secured method is invoked, the $local Principal is seen in the Server Console and logs, but the authentication does not happen.
- On invoking the Secured EJB method with
@RolesAllowed, the Security Credentials do not seem to propagate but gives the name asanonymousas the Principal Caller in the Server console. - On trying to invoke the Bean, the following exception is encountered:
javax.ejb.EJBAccessException: JBAS014502: Invocation on method: public abstract <method_name> of bean: <Bean_name> is not allowed
- Geting following ERROR in JBoss. What does this following ERROR mean?
10:49:53,426 ERROR [org.jboss.as.ejb3.invocation] (Thread-265) JBAS014134: EJB Invocation failed on component TestPojoPersistence for method public example.UserClass example.TestPojoPersistence.get(java.lang.String,example.TestBean,example.TestUser) throws java.lang.Exception: javax.ejb.EJBAccessException: JBAS014502: Invocation on method: public example.UserClass example.TestPojoPersistence.get(java.lang.String,example.TestBean,example.TestUser) throws java.lang.Exception of bean: TestPojoPersistence is not allowed
at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:114) [jboss-as-ejb3-7.4.2.Final-redhat-2.jar:7.4.2.Final-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:86) [jboss-as-ejb3-7.4.2.Final-redhat-2.jar:7.4.2.Final-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [jboss-as-ejb3-7.4.2.Final-redhat-2.jar:7.4.2.Final-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.4.2.Final-redhat-2.jar:7.4.2.Final-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.4.2.Final-redhat-2.jar:7.4.2.Final-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [jboss-as-ejb3-7.4.2.Final-redhat-2.jar:7.4.2.Final-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.4.2.Final-redhat-2.jar:7.4.2.Final-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185) [jboss-as-ee-7.4.2.Final-redhat-2.jar:7.4.2.Final-redhat-2]
at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182) [jboss-as-ee-7.4.2.Final-redhat-2.jar:7.4.2.Final-redhat-2]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73) [jboss-as-ee-7.4.2.Final-redhat-2.jar:7.4.2.Final-redhat-2]
...
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x.x (except 6.0.0)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.