This week's book giveaway is in the Java 9 forum. We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line! See this thread for details.
Getting an EJB session bean which uses @SecurityDomain annotation, in a unit test case through JNDI
posted 7 years ago
I am a novice in setting up unit testing framework. I am trying it for a Struts+EJB3 application. I intend to write a test case for each method that I write in a EJB3 session bean.
I wrote the following simple test class:
In above the ItemServiceRemote interface is the Remote interface which is being implemented by the stateless EJB: ItemServiceBean. The gim.ear is the name of the EAR file. Hence, I use "gim/ItemServiceBean/remote" for lookup. The ItemServiceBean has been annotated with @SecurityDomain annotation defined in org.jboss.annotation.security.SecurityDomain.
When I run the above test case then I get the following exception:
(The application uses JAAS/LDAP for Authentication and Authorization.)
Request you to help me in knowing the solution for this problem.
Thank You !