-
1. Re: EJB3 and security role references
wolfgangknauf Nov 28, 2008 10:57 AM (in response to leobaz2)You could try to add this to "ejb-jar.xml" in the EJB JAR instead (just a guess).
Hope this helps
Wolfgang -
2. Re: EJB3 and security role references
leobaz2 Nov 28, 2008 12:19 PM (in response to leobaz2)Thanks Wolfgang, but I don't have an ejb-jar.xml since I am using annotations.
-
3. Re: EJB3 and security role references
wolfgangknauf Dec 1, 2008 10:51 AM (in response to leobaz2)It should be no problem to merge annotations and ejb-jar.xml.
Best regards
Wolfgang -
4. Re: EJB3 and security role references
leobaz2 Dec 2, 2008 2:31 PM (in response to leobaz2)Thanks for your help, I'll give that a try and let you know.
-
5. Re: EJB3 and security role references
leobaz2 Dec 4, 2008 11:45 AM (in response to leobaz2)I tried to create the ejb-jar.xml but it requires me to also define the ejb-class, session-type, transaction-type, etc. Shouldn't this all be defined from the annotations? It seems redundant to me. Is this the only way to define security role references?
I've tried in jboss.xml and jboss-app.xml but it doesn't work. There must be somebody out there that uses EJB3 annotations and security references. Please help. -
6. Re: EJB3 and security role references
wolfgangknauf Dec 5, 2008 7:39 AM (in response to leobaz2)Hi,
you don't need to specify your session beans in "ejb-jar.xml", if you just want to declare the roles. The beans can still use annotations.
Here is a sample:<?xml version="1.0" encoding="UTF-8"?> <ejb-jar id="ejb-jar_ID" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"> ... <assembly-descriptor> <security-role> <description><![CDATA[...]]></description> <role-name>...</role-name> </security-role> ... </assembly-descriptor> </ejb-jar>
I hope this works, and I hope that the "<enterprise-beans>" element is optional.
Wolfgang -
7. Re: EJB3 and security role references
leobaz2 Dec 8, 2008 10:31 PM (in response to leobaz2)That is what you do to declare your roles. I have already done that. I need to declare my role references because the roles that I have hardcoded in my beans might not necessarily be the roles used in the deployment.
-
8. Re: EJB3 and security role references
wolfgangknauf Dec 9, 2008 11:41 AM (in response to leobaz2)Ok, I'm sorry, I misunderstood your initial question. I cannot help you further.
Wolfgang -
9. Re: EJB3 and security role references
leobaz2 Dec 10, 2008 9:16 AM (in response to leobaz2)Does anyone else have any ideas? This was easy to do with EJB 2.x.