I'm sorry Lou, I don't see an easy way to get just this fix on your (2.8.1) level, there have been a lot of commits both before and after this patch
regards, Harry 2011/8/8 <[email protected]> > Harry: > > Thanks. Do I have to completely upgrade to 2.8.4 or can I do it > piecemeal? Maybe a single file? > > -Lou > > > Harry Metske <[email protected]> wrote on 08/06/2011 12:49:10 PM: > > > Louis, > > > > this has been fixed in 2.8.2-svn-14: > > > > 2009-03-19 Andrew Jaquith <ajaquith AT apache DOT org> > > > > * 2.8.2-svn-14 > > > > * Fixed bug in XMLUserDatabase that was preventing UIDs from > being > > saved, which generated tons of NPEs afterwards. Added unit tests > > to check for correct saving of UIDs. Tightened input filtering > on > > user profile fields to prohibit more characters. > > > > See also : http://web.archiveorange.com/archive/v/4EcsS3r0TQl81crBoOks > > > > regards, > > Harry > > > > > > > > 2011/8/6 <[email protected]> > > > > > I'm running into a problem with some code of mine. The following code > > > takes a list of our main DB users and "pushes" it into the wiki's DB > > > (currently an XML file). Here is a snippet of my code: > > > > > > com.ecyrd.jspwiki.auth.user.UserDatabase udb = > > > engine.getUserManager().getUserDatabase(); > > > > > > for(Map.Entry<String, String> entry : > > > rc.entrySet()) { //a list of users and emails > > > String key = entry.getKey(); > > > String value = entry.getValue(); > > > > > > com.ecyrd.jspwiki.auth.user.UserProfile > > > newP = udb.newProfile(); > > > newP.setLoginName(key); > > > newP.setFullname(key); > > > newP.setEmail(value); > > > udb.save(newP); > > > } > > > > > > The problem I am running into is when it runs on a XML file that > already > > > exists (contains hundreds of users) and tries to add new users, the > users > > > go in with a UID of "" (empty string) and the wiki crashes. I'm not > 100% > > > sure that the wiki is crashing due to the empty UID, but it is my only > > > guess. I see the following stack trace: > > > > > > java.lang.NullPointerException > > > at > > > > org.apache.xerces.dom.DeepNodeListImpl.nextMatchingElementAfter(Unknown > > > Source) > > > at org.apache.xerces.dom.DeepNodeListImpl.item(Unknown Source) > > > at org.apache.xerces.dom.DeepNodeListImpl.getLength(Unknown > > > Source) > > > at > > > > > > com.ecyrd.jspwiki.auth.user.XMLUserDatabase. > > findByAttribute(XMLUserDatabase.java:617) > > > at > > > > > > com.ecyrd.jspwiki.auth.user.XMLUserDatabase. > > findByFullName(XMLUserDatabase.java:163) > > > at > > > > > > com.ecyrd.jspwiki.auth.user.AbstractUserDatabase. > > find(AbstractUserDatabase.java:81) > > > at > > > > > > com.ecyrd.jspwiki.WikiSession. > > injectUserProfilePrincipals(WikiSession.java:672) > > > at > > > com.ecyrd.jspwiki.WikiSession.actionPerformed(WikiSession.java:548) > > > at > > > > > > com.ecyrd.jspwiki.event.WikiEventManager$WikiEventDelegate. > > fireEvent(WikiEventManager.java:566) > > > at > > > > > > com.ecyrd.jspwiki.event.WikiEventManager. > > fireEvent(WikiEventManager.java:347) > > > at > > > > > > com.ecyrd.jspwiki.auth.AuthenticationManager. > > fireEvent(AuthenticationManager.java:751) > > > at > > > > > > com.ecyrd.jspwiki.auth.AuthenticationManager. > > login(AuthenticationManager.java:274) > > > at > > > > com.ecyrd.jspwiki.ui.WikiServletFilter.doFilter(WikiServletFilter.java:156) > > > at > > > > > > org.apache.catalina.core.ApplicationFilterChain. > > internalDoFilter(ApplicationFilterChain.java:235) > > > at > > > > > > org.apache.catalina.core.ApplicationFilterChain. > > doFilter(ApplicationFilterChain.java:206) > > > at > > > > > > org.jboss.web.tomcat.filters.ReplyHeaderFilter. > > doFilter(ReplyHeaderFilter.java:96) > > > at > > > > > > org.apache.catalina.core.ApplicationFilterChain. > > internalDoFilter(ApplicationFilterChain.java:235) > > > at > > > > > > org.apache.catalina.core.ApplicationFilterChain. > > doFilter(ApplicationFilterChain.java:206) > > > at > > > > > > org.apache.catalina.core.StandardWrapperValve. > > invoke(StandardWrapperValve.java:230) > > > at > > > > > > org.apache.catalina.core.StandardContextValve. > > invoke(StandardContextValve.java:175) > > > at > > > > > > org.jboss.web.tomcat.security.SecurityAssociationValve. > > invoke(SecurityAssociationValve.java:179) > > > at > > > > > > org.jboss.web.tomcat.security.JaccContextValve. > > invoke(JaccContextValve.java:84) > > > at > > > > > > org.apache.catalina.core.StandardHostValve. > > invoke(StandardHostValve.java:128) > > > at > > > > > > org.apache.catalina.valves.ErrorReportValve. > > invoke(ErrorReportValve.java:104) > > > at > > > > > > org.jboss.web.tomcat.service.jca.CachedConnectionValve. > > invoke(CachedConnectionValve.java:157) > > > at > > > > > > org.apache.catalina.core.StandardEngineValve. > > invoke(StandardEngineValve.java:109) > > > at > > > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241) > > > at > > > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) > > > at > > > > > > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler. > > process(Http11Protocol.java:580) > > > at > > > > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) > > > at java.lang.Thread.run(Thread.java:595) > > > > > > I did notice that if I restart the wiki server, the UID's are fixed > (have > > > values) and the app starts working again. > > > > > > Any thoughts? I'm running 2.8.1 on Windows. >
