title: EJB3 injection is Null in Wicket AuthenticateWebSession
body: <p>I'm using Wicket + EJB3 in an application and I face a problem but I can't find any topic related, so here it is:</p>
  
  <p>I'm using Wicket authentication, and need to use methods from an EJB in the overrided methods authenticate(...).</p>
  
  <p>I can use this EJB in any wicket page, but when it comes to the WebSession, it stays Null, the injection is not working somehow.</p>
  
  <p>My WicketSession class looks something like this:</p>
  
  <pre><code>public class WicketSession extends AuthenticatedWebSession {
  
     @EJB(name = "UserService")
     private UserService userService;
  
     private User user = null;
  
     public WicketSession(Request request) {
      super(request);
     }
  
     @Override
     public boolean authenticate(final String login, final String password) {
  
        user = userService.findByLoginPwd(login, password);
  
        return user != null;;
     }
  
     public User getUser() {
        return user;
     }
  
     public void setUser(User user) {
        this.user = user;
     }
  }
  </code></pre>
  
  <p>And my EJB3:</p>
  
  <pre><code>@Remote
  public interface UserService {
      public User findByLoginPwd(final String login, final String pwd);
  }
  
  @Stateless
  public class UserServiceImpl implements UserService {
  
     public User findByLoginPwd(final String login, final String pwd) {
         [...]
     }
  }
  </code></pre>
  
  <p>The Web part with Wicket is packaged in a war, the business part with EJBs is packaged in a jar, and then I make a ear to deploy it on a JOnAS server.</p>
  
  <p>Any help would be highly appreciated =)</p>
  
  <p>Nicolas</p>