You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Axel <ax...@gmail.com> on 2005/08/30 20:58:02 UTC

NPE's

If I update my website settings, I get the message:
" Saved changes to weblog settings"

and the following NPE:

   java.lang.NullPointerException
	at org.roller.presentation.RollerSession.hasPermissions(RollerSession.java:228)
	at org.roller.presentation.RollerSession.isUserAuthorizedToAdmin(RollerSession.java:220)
	at org.roller.presentation.website.actions.WebsiteFormAction.edit(WebsiteFormAction.java:78)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)

----

If I press the "customize" button I get the message 

"Unexpected Exception
Roller has encountered and logged an unexpected exception.
Reason: 404"

If I'm selecting now the "custom" theme again, I get:
   net.sf.hibernate.LazyInitializationException: Failed to lazily
initialize a collection - no session or session was closed
	at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209)
	at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71)
	at net.sf.hibernate.collection.Bag.iterator(Bag.java:256)
	at org.roller.pojos.WebsiteData.hasUserPermissions(WebsiteData.java:965)
	at org.roller.presentation.RollerSession.hasPermissions(RollerSession.java:228)
	at org.roller.presentation.RollerSession.isUserAuthorizedToAdmin(RollerSession.java:220)
	at org.roller.presentation.website.actions.ThemeEditorAction.preview(ThemeEditorAction.java:145)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
	at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)

----

Invite a User for your blog:

   org.roller.RollerException: Website cannot be null
	at org.roller.business.UserManagerImpl.inviteUser(UserManagerImpl.java:370)
	at org.roller.presentation.website.actions.InviteMemberAction.save(InviteMemberAction.java:130)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
	at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)

Re: NPE's

Posted by Axel <ax...@gmail.com>.
On 8/31/05, Dave Johnson <da...@rollerweblogger.org> wrote:
> Logins work fine for me, for users with 0, 1 and greater than 1 weblogs.
> 
> I can't duplicate this one.
> 
> - Dave
You're right. 
I created a new user account and everything works fine.
The problem only occurs with the old testuser account (i.e. used for
creating a weblog, deleted all  weblogs,...)

Re: NPE's

Posted by Dave Johnson <da...@rollerweblogger.org>.
Logins work fine for me, for users with 0, 1 and greater than 1 weblogs.

I can't duplicate this one.

- Dave


On Aug 31, 2005, at 12:40 PM, Axel wrote:

> On 8/30/05, Dave Johnson <da...@rollerweblogger.org> wrote:
>
> I think I'm now at the latest source from SVN
> directly after logging in I'm redirected to this url
> /editor/weblog.do? 
> method=create&rmk=tabbedmenu.weblog&rmik=tabbedmenu.weblog.newEntry&web 
> log=root
>
> and get the following stacktrace (must I reset some user data?):
>
>    net.sf.hibernate.LazyInitializationException: Failed to lazily
> initialize a collection - no session or session was closed
> 	at  
> net.sf.hibernate.collection.PersistentCollection.initialize(PersistentC 
> ollection.java:209)
> 	at  
> net.sf.hibernate.collection.PersistentCollection.read(PersistentCollect 
> ion.java:71)
> 	at net.sf.hibernate.collection.Bag.iterator(Bag.java:256)
> 	at  
> org.roller.pojos.WebsiteData.hasUserPermissions(WebsiteData.java:965)
> 	at  
> org.roller.presentation.RollerSession.hasPermissions(RollerSession.java 
> :228)
> 	at  
> org.roller.presentation.RollerSession.isUserAuthorized(RollerSession.ja 
> va:202)
> 	at  
> org.roller.presentation.weblog.actions.WeblogEntryFormAction.create(Web 
> logEntryFormAction.java:103)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at  
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja 
> va:39)
> 	at  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso 
> rImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at  
> org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction. 
> java:276)
>


Re: NPE's

Posted by Axel <ax...@gmail.com>.
On 8/30/05, Dave Johnson <da...@rollerweblogger.org> wrote:

I think I'm now at the latest source from SVN
directly after logging in I'm redirected to this url 
/editor/weblog.do?method=create&rmk=tabbedmenu.weblog&rmik=tabbedmenu.weblog.newEntry&weblog=root

and get the following stacktrace (must I reset some user data?):

   net.sf.hibernate.LazyInitializationException: Failed to lazily
initialize a collection - no session or session was closed
	at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209)
	at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71)
	at net.sf.hibernate.collection.Bag.iterator(Bag.java:256)
	at org.roller.pojos.WebsiteData.hasUserPermissions(WebsiteData.java:965)
	at org.roller.presentation.RollerSession.hasPermissions(RollerSession.java:228)
	at org.roller.presentation.RollerSession.isUserAuthorized(RollerSession.java:202)
	at org.roller.presentation.weblog.actions.WeblogEntryFormAction.create(WeblogEntryFormAction.java:103)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)

Re: NPE's

Posted by Dave Johnson <da...@rollerweblogger.org>.
Comments below...


On Aug 30, 2005, at 2:58 PM, Axel wrote:

> If I update my website settings, I get the message:
> " Saved changes to weblog settings"
>
> and the following NPE:
>
>    java.lang.NullPointerException
> 	at  
> org.roller.presentation.RollerSession.hasPermissions(RollerSession.java 
> :228)
> 	at  
> org.roller.presentation.RollerSession.isUserAuthorizedToAdmin(RollerSes 
> sion.java:220)
> 	at  
> org.roller.presentation.website.actions.WebsiteFormAction.edit(WebsiteF 
> ormAction.java:78)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at  
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja 
> va:39)
> 	at  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso 
> rImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at  
> org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction. 
> java:276)

I found and fixed this one today. Are you on the latest code?


> ----
>
> If I press the "customize" button I get the message
>
> "Unexpected Exception
> Roller has encountered and logged an unexpected exception.
> Reason: 404"
>
> If I'm selecting now the "custom" theme again, I get:
>    net.sf.hibernate.LazyInitializationException: Failed to lazily
> initialize a collection - no session or session was closed
> 	at  
> net.sf.hibernate.collection.PersistentCollection.initialize(PersistentC 
> ollection.java:209)
> 	at  
> net.sf.hibernate.collection.PersistentCollection.read(PersistentCollect 
> ion.java:71)
> 	at net.sf.hibernate.collection.Bag.iterator(Bag.java:256)
> 	at  
> org.roller.pojos.WebsiteData.hasUserPermissions(WebsiteData.java:965)
> 	at  
> org.roller.presentation.RollerSession.hasPermissions(RollerSession.java 
> :228)
> 	at  
> org.roller.presentation.RollerSession.isUserAuthorizedToAdmin(RollerSes 
> sion.java:220)
> 	at  
> org.roller.presentation.website.actions.ThemeEditorAction.preview(Theme 
> EditorAction.java:145)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at  
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja 
> va:39)
> 	at  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso 
> rImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at  
> org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction. 
> java:276)
> 	at  
> org.apache.struts.actions.DispatchAction.execute(DispatchAction.java: 
> 196)
> 	at  
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestP 
> rocessor.java:421)
> 	at  
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java 
> :226)
> 	at  
> org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
> 1164)
> 	at  
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)

I can't duplicate this one either. The Preferences:Theme page is  
working fine for me, but blogs don't seem to be rendering properly if  
you "customize" a theme. I must have broken Allen's new theme stuff  
when I did the merge.


> Invite a User for your blog:
>
>    org.roller.RollerException: Website cannot be null
> 	at  
> org.roller.business.UserManagerImpl.inviteUser(UserManagerImpl.java: 
> 370)
> 	at  
> org.roller.presentation.website.actions.InviteMemberAction.save(InviteM 
> emberAction.java:130)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at  
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja 
> va:39)
> 	at  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso 
> rImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at  
> org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction. 
> java:276)
> 	at  
> org.apache.struts.actions.DispatchAction.execute(DispatchAction.java: 
> 196)
> 	at  
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestP 
> rocessor.java:421)
> 	at  
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java 
> :226)
> 	at  
> org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
> 1164)
> 	at  
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)


I fixed that one today too. Make sure you get the latest code.

- Dave