users@glassfish.java.net

Re: Jersey NullPointerException (one in a series)

From: <glassfish_at_javadesktop.org>
Date: Wed, 29 Sep 2010 06:28:37 PDT

Right there with you.

The only help I can offer here is: do whatever you can to get CDI out of your application--Weld is still dodgy, and probably will be for years. Make sure all of your resource classes are annotated with @ManagedBean (if you use @EJB injection inside them).

We've also noticed that in a huge application with dozens if not hundreds of beans we sometimes encounter inadvertent bean name collisions--e.g. com.foo.bar.FooBean and com.foo.bizbaw.FooBean will have, by default, the same bean name: "FooBean".

This is not reported or tested for in any way, and results in all sorts of ugly injection problems (including NullPointerExceptions) and can be very hard to track down. So check to make sure your beans all have good names, either by default or explicitly.

Best,
Laird
[Message sent by forum member 'ljnelson']

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