Hi Alex

I tested exactly the same scenario as yours

What I found out:
1. subject.getPrincipals(PrincipalCollection.class) is never null (even with a newly created repository)
2. Perhaps your src does not match jar's?
3. If you dont assign any rights for this repository there will be an exception on line 259 - permissionList = acl.getList(); // here acl is null resulting in an NullPointerException

I have fixed this part so it sets a an empty initialized permissionList if no rights are assigned to this repository.

Try again with the fresh build from svn I am sure your code either not in sync or ( something really weird ;) )

regards,
- Sameer




On Oct 20, 2005, at 11:26 PM, Alexandru Popescu wrote:

#: Alexandru Popescu changed the world a bit at a time by saying on 10/20/2005 11:01 PM :#
Hi!
I am trying to figure out a NPE that is occuring on my system:
[trace]
[ERROR][servlets.EntryServlet]  (20.10.2005 22:54:02)
java.lang.NullPointerException
info.magnolia.cms.security.SessionAccessControl.createRepositorySessio n(SessionAccessControl.java:263) info.magnolia.cms.security.SessionAccessControl.getRepositorySession(S essionAccessControl.java:213) info.magnolia.cms.security.SessionAccessControl.getSession(SessionAcce ssControl.java:87) info.magnolia.cms.security.SessionAccessControl.createHierarchyManager (SessionAccessControl.java:277) info.magnolia.cms.security.SessionAccessControl.getHierarchyManager(Se ssionAccessControl.java:121) info.magnolia.cms.security.SessionAccessControl.getHierarchyManager(Se ssionAccessControl.java:107)
info.magnolia.cms.gui.control.Tree.getHtmlChildren(Tree.java:1112)
info.magnolia.cms.gui.control.Tree.getHtml(Tree.java:934)
info.magnolia.module.admininterface.AdminTreeMVCHandler.renderTree(Adm inTreeMVCHandler.java:414) info.magnolia.module.admininterface.AdminTreeMVCHandler.renderHtml(Adm inTreeMVCHandler.java:357)
info.magnolia.cms.servlets.MVCServlet.doGet(MVCServlet.java:113)
[...]
[/trace]
The scenario is quite complex to reproduce it:
1/ I have created through repository.xml a new repository
2/ I have registered it inside Config to be displayed in the menu
3/ for the beginning (just playing) I have set the AdminTreeConfig to display it Upon a new started Tomcat instance while firstly accessing this new menu item (so accessing the underlying new created repository) it results in the above exception. What is real strange is that upon the second access to this menu item the exception doesn't happen again.
The code throwing it is:
[code]
Set principalSet = subject.getPrincipals(PrincipalCollection.class);
             Iterator it = principalSet.iterator();
PrincipalCollection principals = (PrincipalCollection) it.next(); ACL acl = (ACL) principals.get(repositoryID + "_" + workspaceID);
             permissionList = acl.getList();
[/code]
the principalSet is null.
If I am not completely wrong the Subject gets populated inside the JCRLoginModule (as this seems the one configured by Magnolia), and I cannot see any reason (at least at the moment for this to happen.
Do you have any ideas?
./alex
--
.w( the_mindstorm )p.
ps: I have logged in as superuser, but I haven't set any permissions against the new created repository.

The weirdness continued:

debuggin in the above piece of code (SessionAccessControl.createRepositorySession):

the above piece is executed for website/default, config/default and newscentral/default. in all cases the same Subject is retrieved from Authentication.getSubject(request) (identified by its hashCode()). However only when accessing the newscentral/default one (the new repository) even if the content of Subject is good the call subject.getPrincipals(PrincipalCollection.class) returns null.

I must confess that this is over my understanding for the moment. Can anybody put some light on it?

tones of thanks

./alex
--
.w( the_mindstorm )p.


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to