cancel
Showing results for 
Search instead for 
Did you mean: 

Defining EJB Security Roles using Annotation

arpitgoyal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

How can I define security roles for EJB 3.0 stateless session bean.

In my server http://localhost:50000/useradmin I have "myUserRole" roles defined which I want to use for access control of the bean.

I am using this annotation (before class)

@RolesAllowed(value={"myUserRole"})

During deployment I get exception -

com.sap.engine.services.deploy.exceptions.ServerDeploymentException: [ERROR CODE DPL.DS.5082] Exception while [downloading files of application -XXXXXXX]

Regards,

Arpit

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

You have to map the Java EE role "myUserRole" to a server role (in your case it would be with the same name). Details [here|http://help.sap.com/saphelp_nwce711/helpdata/en/46/3079bf50094f09e10000000a114a6b/frameset.htm].

Regarding the exception - check the server default trace for more detailed problem description.

HTH!

\-- Vladimir

arpitgoyal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Based on the link given here is the xml. This XML already exists in the application and has such structure

<security-permission>

<security-role-map>

<role-name>developer</role-name>

<server-role-name>role1</server-role-name>

<server-role-name>role2</server-role-name>

<server-role-name>role3</server-role-name>

<server-role-name>role4</server-role-name>

<server-role-name>role5</server-role-name>

</security-role-map>

</security-permission>

My question is, which of the following annotation will work:

@RolesAllowed(value=)

or

@RolesAllowed(value=) //currently I am using this.

Edited by: Arpit Goyal on Feb 27, 2009 4:39 AM

Vlado
Advisor
Advisor
0 Kudos

The other one

Answers (0)