users@glassfish.java.net

Re: Call secured _at_Remote EJB from WebClient

From: <glassfish_at_javadesktop.org>
Date: Sat, 14 Aug 2010 06:51:53 PDT

I found the reason for the above mentioned exception:

1. in a web client, you needn't set all the properties but instead just invoke the lookup method of the Context object.

2. the lookup name is NOT only the ejb-ref-name one defines in the sun-web.xml but the ejb-ref-name with the prefix "java:comp/env/" !

So my lookup code looks like this:

Context context = new InitialContext();
ejbBean = (EjbBeanRemote) context.lookup("java:comp/env/ejb/ejbBean");

My ejb-ref-name therefore is "ejb/ejbBean"

Ralph, thanks a ton for your help, with Programmatic Login it finally works, that was the key!
[Message sent by forum member 'martyj']

http://forums.java.net/jive/thread.jspa?messageID=480169