Presumably you have a Project in your HttpSession with a null Account.  This
is most likely related to FetchGroups.  You probably want to put your
Project.account field in the default fetch group.  That way it will always
be available when you close the persistence manager you used to load the
Project.

On Thu, Nov 12, 2009 at 7:29 PM, IlyaE <ilyaelk...@gmail.com> wrote:

> I'm seeing an odd issue when loading my jsps for the first time (after
> deployment).
>
> I have an Account object that has many Projects
> [Account]
>        @Persistent(mappedBy = "account")
>        private List<Key> projects;
>
> and on the otherside
> [Project]
>        @Persistent
>        private Key account;
>
>
> Now when i first load my jsp that is forwarded from a servlet, i get a
> NPE on the "Long id = p.getAccount().getId();" in this code
>
>        Project p = (Project) request.getSession().getAttribute("project");
>        Account account = null;
>        if (p != null) {
>                Long id = p.getAccount().getId();
>                account = pm.getObjectById(Account.class, id);
>
> I know p is not null (since this code runs) and i know that it is
> associated with an account.
>
> The really odd thing is... If i refresh the page, everything works as
> expected. So this NPE only occurs after i deploy a new version of the
> app, or certain files expire.
> Do i need to initialize anything?
>
> Thanks!
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=.


Reply via email to