users@glassfish.java.net

Glassfish EJB3 and Wicket

From: <glassfish_at_javadesktop.org>
Date: Sat, 26 Apr 2008 07:00:10 PDT

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