All,
I've tried the approach listed above to update username and password, but I get a NullPointerException error. I'm using acegi 0.7, spring 1.1, struts 1.1, and hibernate 2.1.
First, I update the database via hibernate. This piece works fine. Next, I run the following code:
Code:
final SecureContextImpl newContext = new SecureContextImpl();
newContext.setAuthentication(new UsernamePasswordAuthenticationToken(username, pform.getString("password")));
ContextHolder.setContext(newContext);
Again, no exceptions and I'm forwarded to the thank you page. So far so good, but if I click any page the uses acegi custom tags, I get the following:
Code:
java.lang.NullPointerException
java.util.Arrays$ArrayList.<init>(Arrays.java:2342)
java.util.Arrays.asList(Arrays.java:2328)
net.sf.acegisecurity.taglibs.authz.AuthorizeTag.getPrincipalAuthorities(AuthorizeTag.java:132)
net.sf.acegisecurity.taglibs.authz.AuthorizeTag.doStartTag(AuthorizeTag.java:78)
org.apache.jsp.index_jsp._jspx_meth_authz_authorize_0(index_jsp.java:292)
org.apache.jsp.index_jsp._jspService(index_jsp.java:140)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:70)
net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:169)
net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:105)
net.sf.acegisecurity.ui.AbstractIntegrationFilter.doFilter(AbstractIntegrationFilter.java:170)
net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:105)
net.sf.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:333)
net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:105)
Is there something that I'm missing? When I don't modify the username/password, the application works fine. Any help would be appreciated.
Thanks in advance