Problem#

I'm trying to setup JspWiki 2.4, and would like to edit the userdatabase.xml file. If I open the file I only see the following:

<?xml version="1.0" encoding="UTF-8"?>
<users>
</users>

Question#

What XML do I need to add users? It would be handy if in future releases example users for different configurations (admin and guest for instance) would be added in this file, commented out.

-- RvW


I already found out that the structure is like this:

<?xml version="1.0" encoding="UTF-8"?>
<users>
<user loginName="admin" wikiName="Administrator" fullName="Administrator" email="somebody@gmail.com" 
password="{SHA}**************" created="24-sep-2006 18:10:54" lastModified="24-sep-2006 18:10:54"  />
</users>

--RvW


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.

--AnonymousCoward, 25-Oct-2006


It's okay. Just create any account and add it to the Admin group (in the GroupXMLDatabase XML file )manually. Administrator accounts don't have to be called "Administrator" :-)

-- JanneJalkanen


I can't add an account and I don't know how to code groups in the xml file. After the Install.jsp failed, this is what groupdatabase.xml looks like

<groups>
</groups>

And this is what the userdatabase.xml looks like. But I don't know the password.

<users>
<user loginName="admin" wikiName="Administrator" fullName="Administrator" email="" password="{SHA}ff853a4cfe6c45ceabd427c9e9bbd326a6bf6f5c" created="2006.10.24 at 16:09:36:059 EDT" lastModified="2006.10.24 at 16:09:36:059 EDT"  />
</users>

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.

--AnonymousCoward, 26-Oct-2006


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...

-- JanneJalkanen


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

--AnonymousCoward, 26-Oct-2006


Hookay... Maybe you should try a clean reinstall?

-- JanneJalkanen, 26-Oct-2006


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)

As you see the container is Resin, it's version 3.0.11. The jvm is...

resin@nycrs100:/tmp:> java -version
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0)
Classic VM (build 1.4.0, J2RE 1.4.0 IBM AIX 5L for PowerPC (64 bit JVM) build caix641401-20021126 (JIT enabled: jitc))
This is just not going to work. Although everyting I've done so far with security = off seems to be OK.

--AnonymousCoward, 26-Oct-2006


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...

--AnonymousCoward, 19-Dec-2006


Hello,

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 ...

Next step is to write a script to add subscribers like: jspwiki/bin/add_user.sh joe -p test -g RegisteredUsers etc etc

Another question: why are the timestamps of created and lastmodified in different format?

Cheers

--Joachim Zaisberger, 08-Jan-2007


Hello, I just tried to install 2.6.2 and Install.jsp did not display admin account credentials in message template. Cheers, Al

--AnonymousCoward, 19-May-2008


I installed 2.6.2 a week ago and I had the same problem.

--AnonymousCoward, 23-May-2008


To get initial credentials, change line 43 of Install.jsp to MessageFormat.format("Credentials: Name - {0}, Password - {1} ", Installer.ADMIN_ID, password));

--AnonymousCoward, 10-Jun-2008


This was fixed in 2.6.3...

--JanneJalkanen, 11-Jun-2008


How to reset the password from console#

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

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-36) was last changed on 16-Mar-2012 10:30 by Janne Jalkanen