You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jspwiki.apache.org by Hans Glocke <il...@gmx.net> on 2008/09/25 16:52:56 UTC

Using database

Hi,

i am currently using JSPWiki on a JBoss Server.

In addition I am running a second application on this server, too.
Now I am trying to make JSPWiki use the database of the other application to authorize users.

Thus I modified the "jspwiki.properties" in the following way:

first comment:
#jspwiki.userdatabase =com.ecyrd.jspwiki.auth.user.XMLUserDatabase

and then:
jspwiki.userdatabase = com.ecyrd.jspwiki.auth.user.JDBCUserDatabase
jspwiki.userdatabase.datasource = jdbc:mysql://localhost:3306/MYDATABASE
jspwiki.userdatabase.table = MYUSERSTABLE
jspwiki.userdatabase.loginName = display_name
jspwiki.userdatabase.password = password

As my other application has no columns for email or fullname, I just let them out.

But this does not work.
Is there anything I forgot?

In addition here is the error, when I try to register a new user;
JSPWiki has detected an error

Error Message
    An unknown exception java.lang.NullPointerException was caught by Error.jsp.
Exception
    java.lang.NullPointerException
Place where detected
    com.ecyrd.jspwiki.auth.user.JDBCUserDatabase.findByPreparedStatement(), line 701 


Best regards
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

Re: Using database

Posted by Eric Ladner <er...@gmail.com>.
You could also create a view on top of the user table that includes
columns that JSPWiki needs, but jsut passes NULL if they don't exist
in your table..

like if your table just contains username and password and it's called
USERS, you could create a view like (this one returns the username
twice, once for the FullName).

create view WIKI_USERS as select username, password, null email,
username fullname from users;

Then point JSPWiki at the WIKI_USERS table.  This is asuuming that the
wiki doesn't do updates to that table, too.

On Thu, Sep 25, 2008 at 10:16 AM, Andrew Jaquith <an...@me.com> wrote:
> The JDBCUserDatabase expects that it will be able to find columns for all of
> the profile properties, such as e-mail. You cannot simply "let them out" (I
> assume you meant: "leave them blank"). That is why the prepared statement
> (line 701) is failing.
>
> You should alter your table to add the columns JSPWiki needs. You can take a
> look at the sample SQL DDL files in etc/db for ideas.
>
> Andrew
>
> On Sep 25, 2008, at 10:52 AM, Hans Glocke wrote:
>
>> Hi,
>>
>> i am currently using JSPWiki on a JBoss Server.
>>
>> In addition I am running a second application on this server, too.
>> Now I am trying to make JSPWiki use the database of the other application
>> to authorize users.
>>
>> Thus I modified the "jspwiki.properties" in the following way:
>>
>> first comment:
>> #jspwiki.userdatabase =com.ecyrd.jspwiki.auth.user.XMLUserDatabase
>>
>> and then:
>> jspwiki.userdatabase = com.ecyrd.jspwiki.auth.user.JDBCUserDatabase
>> jspwiki.userdatabase.datasource = jdbc:mysql://localhost:3306/MYDATABASE
>> jspwiki.userdatabase.table = MYUSERSTABLE
>> jspwiki.userdatabase.loginName = display_name
>> jspwiki.userdatabase.password = password
>>
>> As my other application has no columns for email or fullname, I just let
>> them out.
>>
>> But this does not work.
>> Is there anything I forgot?
>>
>> In addition here is the error, when I try to register a new user;
>> JSPWiki has detected an error
>>
>> Error Message
>>   An unknown exception java.lang.NullPointerException was caught by
>> Error.jsp.
>> Exception
>>   java.lang.NullPointerException
>> Place where detected
>>   com.ecyrd.jspwiki.auth.user.JDBCUserDatabase.findByPreparedStatement(),
>> line 701
>>
>>
>> Best regards
>> --
>> Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen:
>> http://www.gmx.net/de/go/multimessenger
>
>



-- 
Eric Ladner

Re: Using database

Posted by Andrew Jaquith <an...@me.com>.
The JDBCUserDatabase expects that it will be able to find columns for  
all of the profile properties, such as e-mail. You cannot simply "let  
them out" (I assume you meant: "leave them blank"). That is why the  
prepared statement (line 701) is failing.

You should alter your table to add the columns JSPWiki needs. You can  
take a look at the sample SQL DDL files in etc/db for ideas.

Andrew

On Sep 25, 2008, at 10:52 AM, Hans Glocke wrote:

> Hi,
>
> i am currently using JSPWiki on a JBoss Server.
>
> In addition I am running a second application on this server, too.
> Now I am trying to make JSPWiki use the database of the other  
> application to authorize users.
>
> Thus I modified the "jspwiki.properties" in the following way:
>
> first comment:
> #jspwiki.userdatabase =com.ecyrd.jspwiki.auth.user.XMLUserDatabase
>
> and then:
> jspwiki.userdatabase = com.ecyrd.jspwiki.auth.user.JDBCUserDatabase
> jspwiki.userdatabase.datasource = jdbc:mysql://localhost:3306/ 
> MYDATABASE
> jspwiki.userdatabase.table = MYUSERSTABLE
> jspwiki.userdatabase.loginName = display_name
> jspwiki.userdatabase.password = password
>
> As my other application has no columns for email or fullname, I just  
> let them out.
>
> But this does not work.
> Is there anything I forgot?
>
> In addition here is the error, when I try to register a new user;
> JSPWiki has detected an error
>
> Error Message
>    An unknown exception java.lang.NullPointerException was caught by  
> Error.jsp.
> Exception
>    java.lang.NullPointerException
> Place where detected
>     
> com 
> .ecyrd.jspwiki.auth.user.JDBCUserDatabase.findByPreparedStatement(),  
> line 701
>
>
> Best regards
> -- 
> Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit  
> allen: http://www.gmx.net/de/go/multimessenger