Sun Java System Application Server Platform Edition 9 Release Notes

Accessing a LAZY initialized relationship from client side sometimes causes a NullPointerException.

For more information, see https://glassfish.dev.java.net/issues/show_bug.cgi?id=404.

Solution

Access LAZY initialized relationship in server-side code before returning an instance to the client.