OK!
so i'm finally making sense of all this :)
I have a little problem; I'm trying to add users to the users table
(using RoleUser).
Currently I can use:
users.addUser(user.getLogin(), new RoleUserAttributes(id,
user.getPassword(), new String[] { "user" }))
which works perfectly! what I'm trying to do is add users without
providing the userid. I noticed that RoleuserAttributes has a ctor
that takes just password and roles like: RoleUserAttributes(String,
String[]), but when I try this:
users.addUser(user.getLogin(), new RoleUserAttributes
(user.getPassword(), new
String[] { "user" }));
I get an exception (pasted below) which leads me to think that
adding
users without providing userid isn't implemented yet? Otherwise, is
there away of doing this that is currently handled? thx
[java] SEVERE:
com.uwyn.rife.authentication.credentialsmanagers.exceptions.AddUserE
rr
orException:
Error while adding user with login 'eokyere' and attributes
'com.uwyn.rife.authentication.credentialsmanagers.RoleUserAttributes
@1
533c8'.
[java] at
com.uwyn.rife.authentication.credentialsmanagers.DatabaseUsers._addU
se
r(DatabaseUsers.java:415)
[java] at
com.uwyn.rife.authentication.credentialsmanagers.databasedrivers.org
_a
pache_derby_jdbc_EmbeddedDriver.addUser
(org_apache_derby_jdbc_EmbeddedDriver.java:128)
[java] at
com.uwyn.rife.authentication.credentialsmanagers.databasedrivers.org
_a
pache_derby_jdbc_EmbeddedDriver.addUser
(org_apache_derby_jdbc_EmbeddedDriver.java:24)
[java] at friends.exits.Register.doCommit(Register.java:78)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0
(Native Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at
com.uwyn.rife.engine.ElementContext.processContext
(ElementContext.java:594)
[java] at
com.uwyn.rife.engine.RequestState.service(RequestState.java:212)
[java] at com.uwyn.rife.engine.Gate.handleRequest
(Gate.java:422)
[java] at com.uwyn.rife.engine.Gate.handleRequest
(Gate.java:240)
[java] at sun.reflect.GeneratedMethodAccessor9.invoke
(Unknown Source)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at
com.uwyn.rife.servlet.RifeFilter.doFilter(RifeFilter.java:112)
[java] at
org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter
(WebApplicationHandler.java:823)
[java] at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch
(WebApplicationHandler.java:473)
[java] at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
567)
[java] at org.mortbay.http.HttpContext.handle
(HttpContext.java:1565)
[java] at
org.mortbay.jetty.servlet.WebApplicationContext.handle
(WebApplicationContext.java:635)
[java] at org.mortbay.http.HttpContext.handle
(HttpContext.java:1517)
[java] at org.mortbay.http.HttpServer.service
(HttpServer.java:954)
[java] at
org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
[java] at
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
[java] at
org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
[java] at
org.mortbay.http.SocketListener.handleConnection
(SocketListener.java:244)
[java] at
org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
[java] at
org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
[java] Caused by:
com.uwyn.rife.database.exceptions.DatabaseException: SQL Exception:
The exception 'java.lang.ClassCastException:
org.apache.derby.impl.sql.execute.MaxMinAggregator' was thrown while
evaluating an expression.
[java] at
com.uwyn.rife.database.DbResultSet.hasResultRows(DbResultSet.java:
435)
[java] at
com.uwyn.rife.database.DbQueryManager.executeHasResultRows
(DbQueryManager.java:276)
[java] at
com.uwyn.rife.database.DbQueryManager.executeGetFirstLong
(DbQueryManager.java:924)
[java] at
com.uwyn.rife.database.DbQueryManager.executeGetFirstLong
(DbQueryManager.java:882)
[java] at
com.uwyn.rife.authentication.credentialsmanagers.DatabaseUsers
$4.useTransactionWithoutResult(DatabaseUsers.java:347)
[java] at
com.uwyn.rife.database.DbTransactionUserWithoutResult.useTransaction
(DbTransactionUserWithoutResult.java:43)
[java] at
com.uwyn.rife.database.DbQueryManager.inTransaction
(DbQueryManager.java:2783)
[java] at
com.uwyn.rife.authentication.credentialsmanagers.DatabaseUsers._addU
se
r(DatabaseUsers.java:317)
[java] ... 28 more
[java] Caused by: SQL Exception: The exception
'java.lang.ClassCastException:
org.apache.derby.impl.sql.execute.MaxMinAggregator' was thrown while
evaluating an expression.
[java] at
org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown
Source)
[java] at
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLExceptio
n(
Unknown
Source)
[java] at
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException
(Unknown
Source)
[java] at
org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown
Source)
[java] at
org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown
Source)
[java] at
org.apache.derby.impl.jdbc.EmbedResultSet.closeOnTransactionError
(Unknown
Source)
[java] at
org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown
Source)
[java] at
org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
[java] at com.uwyn.rife.database.DbResultSet.next
(DbResultSet.java:48)
[java] at
com.uwyn.rife.database.DbResultSet.hasResultRows(DbResultSet.java:
424)
[java] ... 35 more
On 11/9/05, Geert Bevin <[EMAIL PROTECTED]> wrote:
To summarize all this, it seems complex since you seem to want to
know the internals. In practice, all you need to do is inherit the
authentication element and everything within that scope is
automatically authenticated. Very easy ;-)
On 9-nov-05, at 11:49, Emmanuel Okyere wrote:
ok, that took care of the error... thx
I'm not sure I understand it fully though... at least now, I'm
getting
a login page... but how does the authentication package tie
into my
custom developed modules?
for instance, how does it know which table to use to retrieve my
usernames/password... there doesn't seem to be any
configuration for
that? and since i'm not creating any implementation (java class
files)
to work with the element declaration, what methods are called
after
the login phase?
thanks,
Emmanuel
--
Geert Bevin Uwyn bvba
"Use what you need" Avenue de Scailmont 34
http://www.uwyn.com 7170 Manage, Belgium
gbevin[remove] at uwyn dot com Tel +32 64 84 80 03
PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F
D6A9
Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net
_______________________________________________
Rife-users mailing list
Rife-users@uwyn.com
http://www.uwyn.com/mailman/listinfo/rife-users
_______________________________________________
Rife-users mailing list
Rife-users@uwyn.com
http://www.uwyn.com/mailman/listinfo/rife-users