users@glassfish.java.net

Re: Glassfish EJB3 and Wicket

From: Sahoo <Sahoo_at_Sun.COM>
Date: Sat, 26 Apr 2008 19:34:55 +0530

Have you looked at GlassFish EJB FAQ [1]?

Thanks,
Sahoo

[1] https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

glassfish_at_javadesktop.org wrote:
> Hello,
>
> I am building an EJB Application. I have two projects,
> an EJB project with my Java Beans and a web project.
> For the web project I am using Wicket.
>
> My EJB project is deploying on Glassfish without errors.
> But my web project throws an exception.
>
> In my WicketApplication class, I want to get an instance
> of a Java Bean. I am using simple JNDI lookup. But here
> is the problem. The lookup do not find my bean.
>
> This is my first EJB Application and I am confused.
> Do I have to define this Bean I want to use in the web.xml?
>
> The Bean class has a @Stateless annotation. So the resulting name
> is the Bean class name, right?
>
> Bean:
> @Stateless
> public class UserDelegateBean implements IUserDelegate {
> ...
> }
>
> Wicket:
> try {
> InitialContext context = new InitialContext();
>
> userDelegate = (IUserDelegate) context.lookup("UserDelegateBean");
> } catch (NamingException e) {
> ...
> }
> [Message sent by forum member 'marsias' (marsias)]
>
> http://forums.java.net/jive/thread.jspa?messageID=271635
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>