How would you add a user directly in the xml file when the password is encrypted? I can't get into JSPWiki as admin. When clicking on the Install.jsp page, it threw an exception befor telling me what Admin password it created was. It was some type of regex error.

I tried to create an account with Login.jsp which takes me to this this page "UserPreferences.jsp?tab=profile".
The profile tab does not show data entry field when I code jspwiki.security = jaas in the jspwiki.properties file. I had to change it to jspwiki.security = off.
Then, I get this error when submiting the form:

JSPWiki has detected an error
Error Message
An unknown exception java.lang.ExceptionInInitializerError was caught by Error.jsp.
Exception
java.lang.ExceptionInInitializerError
Place where detected
com.ecyrd.jspwiki.auth.UserManager.parseProfile(), line 345

There was nothing in the jspwiki.log file about the above error. It was also some type of parsing error that I saw when trying to set things up with Install.jsp page. In that case, it complained about an invalid character and showed me the regular expression.

Create a new group by clicking on "Create Group" on the action bar on the top right and call it "Admin" and add yourself to it. Normally this is done by the Installer. If you turn security=off, then we don't care about user accounts and preferences anymore. The fact that it throws an exception is a bug, yes, but it should not be doing anything...

There must be something really wrong with my setup. I can't add a group. I get this when clicking on the create group tab. And even if I could create a group. I couldn't add my self to it, because I can't create an account as mentioned above.

JSPWiki has detected an error
Error Message
An unknown exception java.lang.ExceptionInInitializerError was caught by Error.jsp.
Exception
java.lang.ExceptionInInitializerError
Place where detected
com.ecyrd.jspwiki.auth.authorize.GroupManager.parseGroup(), line 328

No luck! I downloaded the latest.zip, changed the jspwiki.properties file and tried to run Install.jsp. The same result as last time was...

500 Servlet Exception
java.util.regex.PatternSyntaxException: Unexpected character '�' near index
24
[\x00\r\n\x0f"':<>;&@\xff{}\$%\\]
^
at java.util.regex.Pattern.error(Pattern.java(Compiled Code))
at java.util.regex.Pattern.range(Pattern.java(Compiled Code))
at java.util.regex.Pattern.clazz(Pattern.java(Compiled Code))
at java.util.regex.Pattern.sequence(Pattern.java(Compiled Code))
at java.util.regex.Pattern.expr(Pattern.java(Compiled Code))
at java.util.regex.Pattern.compile(Pattern.java(Compiled Code))
at java.util.regex.Pattern.<init>(Pattern.java(Compiled Code))
at java.util.regex.Pattern.compile(Pattern.java(Compiled Code))
at at com.ecyrd.jspwiki.ui.InputValidator.<clinit>(InputValidator.java:43).null(Unknown Source)
at com.ecyrd.jspwiki.auth.authorize.GroupManager.parseGroup(GroupManager.java:327)
at com.ecyrd.jspwiki.ui.Installer.createAdministrator(Installer.java:148)
at _jsp._Install__jsp._jspService(_Install__jsp.java:64)
at com.caucho.jsp.JavaPage.service(JavaPage.java:63)
at com.caucho.jsp.Page.pageservice(Page.java:578)
at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:159)
at com.ecyrd.jspwiki.ui.WikiServletFilter.doFilter(WikiServletFilter.java:99)
at com.ecyrd.jspwiki.ui.WikiJSPFilter.doFilter(WikiJSPFilter.java:71)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:163)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:208)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:259)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:341)
at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:467)
at com.caucho.util.ThreadPool.run(ThreadPool.java:408)
at java.lang.Thread.run(Thread.java:566)

Resin does not work with JSPWiki because of the way they load signed JARs, which causes our custom permissions classes to fail to load. That's why you aren't able to do anything unless you set jspwiki.security == off. But of course, if you turn off JAAS you don't get to log in or use page permissions.

The root cause is the version of the servlet container you're using. See the documentation note on Resin for more details. Caucho has applied a fix in their snapshot builds -- try one of those with a clean JSPWiki install and see if that helps.

--Andrew Jaquith, 01-Nov-2006

hiii Im trying to connect my jspwiki from a remote user by passing the ip of the server...but when i try to login in the jspwiki it redirects me to the local host of the remote user(which is wrong)..so what should i do in that case ...to connect my jspwiki from a remote user...

I'm referring to the initial question on this page: how can users be added to the userdatabase.xml file?
My intention is not to allow any users to register, but to request a login to the admin of the site. The admin would then provision a new user in the xml file.
I tried to hash pw with the sha1sum utility standard on linux, but no luck.

--Joachim, 29-Dec-2006

HI Joachim --

We do not have an "administrator's registration tool" for JSPWiki at the moment. Right now, users can only self-register, and that is the only official way that userdatabase.xml can be changed.

That said, you should be able to do this manually by hacking the file. I can't think of any obvious reason why manually generating the SHA1 hash isn't working for you, unfortunately.

Sorry if this isn't the answer that you want. We *are* looking into some other ways for doing bulk registration, but we don't have a time frame for getting it done.

--Andrew Jaquith, 02-Jan-2007

Hi,

I managed to hack the userdatabase.xml creating the SHA pw as follows:

echo -n password | sha1sum

It did not work for me earlier because i used the interactive form of entering values to sha1sum ending with ctrl+d ...

I forgot my password and does not have set up email for the Wiki, so I did this to change my password

generate the password with SHA1 on unix:
echo -n password | sha1sum
gives the sum 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 (if you use this sum your password will be "password" remember to change it from inside JSPWiki.

insert the password into the file:
The file is called userdatabase.xml
and will have a <user tag> for each user.. find your user (use loginName to login) and the password string should be something like:
password="{SSHA}XXXXXXXXXXXXXXXXXXXXXXXXX"
change this to
password="{SHA}YYYYYYYYYYYYYYYYYYYYYYYYYY"

NOTE THE CHANGE FROM SSHA to SHA.. then it should work
--Erlend Aakre, 22-Oct-2009