Skip to main content

NullPointerException from inside proxy: logging of proxy operations?

3 replies [Last post]
ljnelson
Offline
Joined: 2003-08-04
Points: 0

I am staring at something quite bizarre in my debugger.

I have a local EJB injected thusly into another EJB:

@EJB
private FooProcessor fooProcessor;

In a method that I am debugging through, I do this:

assert this.fooProcessor != null;

Assertions are enabled; this test passes.

Then immediately following that assertion I do this:

this.fooProcessor.someMethod();

A NullPointerException is raised from that line. The stack originates from
that line. No GlassFish internals show up in the stack. The EJB that
implements this interface (a @Local bean) is never entered. All I can
conclude is that the proxy code somewhere is throwing a
NullPointerException and the stack is being lost. I cannot reproduce this
in a unit test.

Is there a logging level I can turn on to hopefully discover what is going
on?

GlassFish 3.1.2.2; no deployment errors.

Best,
Laird

--
http://about.me/lairdnelson

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ljnelson
Offline
Joined: 2003-08-04
Points: 0

On Fri, Aug 30, 2013 at 11:23 AM, Laird Nelson wrote:

> this.fooProcessor.someMethod();
>
> A NullPointerException is raised from that line. The stack originates
> from that line. No GlassFish internals show up in the stack. The EJB that
> implements this interface (a @Local bean) is never entered. All I can
> conclude is that the proxy code somewhere is throwing a
> NullPointerException and the stack is being lost. I cannot reproduce this
> in a unit test.
>

Should mention as well that other methods in fooProcessor() execute fine,
indicating that there is no problem with FooProcessorBean (the implementing
class) construction or location.

Best,
Laird

--
http://about.me/lairdnelson

ljnelson
Offline
Joined: 2003-08-04
Points: 0

On Fri, Aug 30, 2013 at 12:14 PM, Laird Nelson wrote:

> Should mention as well that other methods in fooProcessor() execute fine,
> indicating that there is no problem with FooProcessorBean (the implementing
> class) construction or location.
>

But when I remove these other method invocations, and make this method
invocation be the first one, I do not see any indication that
FooProcessorBean's constructor is ever invoked. This suggests a proxy
issue. It would be nice to know what logging level to turn on to see why
the internal proxy is failing with no log messages. Thanks for any help.

Best,
Laird

--
http://about.me/lairdnelson

mvatkina
Offline
Joined: 2005-04-04
Points: 0

Try ejb-container at FINE level, but proxies don't have logging in them.

-marina

On 8/30/13 9:25 AM, Laird Nelson wrote:
> On Fri, Aug 30, 2013 at 12:14 PM, Laird Nelson > wrote:
>
> Should mention as well that other methods in fooProcessor()
> execute fine, indicating that there is no problem with
> FooProcessorBean (the implementing class) construction or location.
>
>
> But when I remove these other method invocations, and make this method
> invocation be the first one, I do not see any indication that
> FooProcessorBean's constructor is ever invoked. This suggests a proxy
> issue. It would be nice to know what logging level to turn on to see
> why the internal proxy is failing with no log messages. Thanks for
> any help.
>
> Best,
> Laird
>
> --
> http://about.me/lairdnelson