Grzegorz Borkowski wrote:
> 
> Now I'm trying to build some application with JSecurity and I had problem
> with NullPointerException being thrown all the time. After long time I
> found the reason: the Cache field is not set in AuthorizingRealm; (it
> tries EHCache, and it gives up after not finding it on classpath). So when
> I call the code then:
> 
> SecurityUtils.getSubject().login(new UsernamePasswordToken("empl1",
> "pass1"));
> 
> the method doGetAuthenticationInfo() from SimpleAccountRealm throws NPE
> because of its second line:
> SimpleAccount account = (SimpleAccount)
> getAuthorizationCache().get(upToken.getUsername());
> and getAuthorizatoinCache() return null.
> 
> I'm thinking about two solutions: change the doGetAuthenticationInfo() so
> that it not use the Cache object (if it is possible) - or change the
> deafault CachingSecurityManager to uses HashtableCache as default
> implementation, not EHCache. I would vote for second solution, as this is
> more aligned with JSecurity policy of "working out of the box with zero
> configuration". And at miniumum it shouldn't throw NPE, but inform the
> user about missing cache. I think I should post Jira ticket for this.
> 

In the meantime similar issue was raised:
https://issues.apache.org/jira/browse/JSEC-24
So I've added the link to this conversation to that issue.
-- 
View this message in context: 
http://n2.nabble.com/Problematic-first-steps-with-JSecurity-tp1316205p1478456.html
Sent from the JSecurity Developer mailing list archive at Nabble.com.

Reply via email to