Jerome Velociter wrote:
Jerome Velociter wrote:
Jerome Velociter wrote:
Hello Jarmo,
I could not reproduce this behavior on 1.1-m1 with a member account. Something I don't understand in the exception you paste, is that it refers to a page in edition :
org.apache.velocity.exception.MethodInvocationException: Invocation of method 'contains' in class java.util.ArrayList threw exception java.lang.NullPointerException @ XWS.MySpaces49,100? <http://www.prepost-test.com:8180/xwiki/bin/edit/XWS/49%2C100?parent=XWS.MySpaces&editor=wysiwyg>
Have you edited XWS.MySpaces ? Can you give us a scenario to reproduce this error ?
Thanks for the feedback, Jérôme.
Thanks for the quick answer. I am very new with Workspaces but I'll found it very useful and like to use it.
No I have not done any changes to code or XWS.MySpace. I just installed XWS couple of days ago. When I was admin I did some users and these users did some new spaces. Very soon I got this error listed below. When I am admin I won't get any error when listing All my Spaces?! By the way, admin has no spaces or there are no organization space yet. Other users have spaces.
You are lucky : We reproduced the exact same error on one of our running instances this morning. I'm investigating this right now, I'll keep posted.
Jerome.
It seems to be very unstable. I copied the code from working XWS.MySpace page (from windows dist.). Then I created blank wiki page where I pasted the code and strip some parts of the code away. First I strip the code for Public spaces listing away and then page worked well. For one of my colleague I stripped the code for My memberships away and listings worked but without My memberships part, of course. For someone some of the code will work but the same workaround does not work for everyone?!
I found that code parts for listings Public spaces and My memberships produce errors.
Yesterday when some more spaces were created (16 registered users) and All my spaces suddenly started to work. I hope this will help you to catch the bug.
I strongly suspect that the NPE occurs when comparing two com.xpn.xwiki.doc.XWikiDocument with "equals()", but I can't prove it and know where exactly/under which conditions, as I still couldn't reproduce it locally. Anyway, I will provide a patch for XWS 1.2 M2 (Planned for Monday). You will need to upgrade, as it will involve changes in the Java plugin (not only the velocity code.)
Thanks for the help, Jerome.
If someone found stable workaround for this I will adopt it right away.
I forgot, there is a possible workaround : remove the "&& !$mships.contains($sp)" part of the conditional statement for displaying public and open spaces. The drawback is that can have spaces listed twice : both as a membership and as public or private.
This (above fix) worked. I think that velocity code will work only if all users have some memberships... -jarmo
If you still have the trace after that, try removing the "!$sp.equals($org) && !$sp.equals($myspace)" part too, as it potentially can raise the issue too. If you still have the trace, then... let me know :)
Jerome.