aspose file tools*
The moose likes Testing and the fly likes Getting an EJB session bean which uses @SecurityDomain annotation,  in a unit test case through JNDI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Getting an EJB session bean which uses @SecurityDomain annotation,  in a unit test case through JNDI" Watch "Getting an EJB session bean which uses @SecurityDomain annotation,  in a unit test case through JNDI" New topic
Author

Getting an EJB session bean which uses @SecurityDomain annotation, in a unit test case through JNDI

Nitin Bhardwaj
Ranch Hand

Joined: Feb 02, 2007
Posts: 72
Hi Friends,
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 !
Nitin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting an EJB session bean which uses @SecurityDomain annotation, in a unit test case through JNDI
 
Similar Threads
Getting javax.naming.CommunicationException Using Jboss 4.0.5
Throws exception in Spring 3.0 DataAccess with lookup jndi in J2SE app
Class cast exception when grabbing remote EJB 3 interface
rampart security issue
lookup for remote bean - failure (only from eclipse)