Wrong exception RollesAllowed constraint is not fulfilled
---------------------------------------------------------
Key: AS7-2993
URL:
https://issues.jboss.org/browse/AS7-2993
Project: Application Server 7
Issue Type: Bug
Components: EJB
Affects Versions: 7.1.0.Beta1b
Environment: If you have a SB with a method annotated with RollesAllowed({a,b,c})
and a SFSB which injects this bean. We also have client tries to access a method which
calls a restricted method on injected bean. This client does not possess a security role
specified in RolesAllowed , so the call should be rejected with EJBAccessException.
However, what I get is NoSuchEjbException.
Notes:
- this doesn't happen if there is only one security role in RollesAllowed
- this doesn't happen if the bean is injected to SLSB
- the NoSuchElement exception is thrown by
org.jboss.as.ejb3.component.stateful.StatefulComponentInstanceInterceptor:66 snipplet
follows:
ROOT_LOGGER.debug("Looking for stateful component instance with session id: " +
sessionId);
StatefulSessionComponentInstance instance = component.getCache().get(sessionId);
if (instance == null) {
//This exception will be transformed into the correct exception type by the
exception transforming interceptor
throw new NoSuchEJBException("Could not find SFSB " +
component.getComponentName() + " with " + sessionId);
}
- I'll provide a reproducer for this, it' ll be available in my git repo
(
https://github.com/jlanik/jboss-as), branch EJBSecurity
classes: InjectionAnnSFSBtoSFSBTestCase, InjectionAnnSLSBtoSFSBTestCase
you can also look at InjectionAnnSFSBtoSLSBTestCase InjectionAnnSLSBtoSLSBTestCase (which
work ok)
I'll create a pull request with this and some other tests, so hopefully, It'll be
accessible in the main jboss-as repo soon.
Reporter: Jan Lanik
Assignee: jaikiran pai
Fix For: 7.1.0.CR1
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira