[Security & JAAS/JBoss] - Re: Beginner's problems with ClientLoginModule
by tdemuth
Well I have problems getting this running on my MySQL-Database. I think, the problem is, that I have not configured the MySQL-Datasource correctly.
This is my mysql-ds.xml-File:
<?xml version="1.0" encoding="UTF-8"?>
|
| <datasources>
| <local-tx-datasource>
| <jndi-name>MySqlDS</jndi-name>
| <connection-url>jdbc:mysql://localhost:3306/cube</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>root</user-name>
| <password>password</password>
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
| <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
| <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
| <metadata>
| <type-mapping>mySQL</type-mapping>
| </metadata>
| </local-tx-datasource>
| </datasources>
The JDBC-Driver lays in server/myServerInstance/lib.
The log-file contains the following exception when I try to login (code is shown in my first post):
2007-08-23 13:53:46,093 DEBUG [org.jboss.ejb3.security.Ejb3AuthenticationInterceptor] Authentication failure
| javax.security.auth.login.LoginException: Query failed
| at org.jboss.security.auth.spi.DatabaseServerLoginModule.getUsersPassword(DatabaseServerLoginModule.java:168)
| at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:206)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at javax.security.auth.login.LoginContext.invoke(Unknown Source)
| at javax.security.auth.login.LoginContext.access$000(Unknown Source)
| at javax.security.auth.login.LoginContext$4.run(Unknown Source)
| at java.security.AccessController.doPrivileged(Native Method)
| at javax.security.auth.login.LoginContext.invokePriv(Unknown Source)
| at javax.security.auth.login.LoginContext.login(Unknown Source)
| at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:603)
| at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:537)
| at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:344)
| at org.jboss.aspects.security.AuthenticationInterceptor.authenticate(AuthenticationInterceptor.java:123)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:66)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:278)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:560)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:369)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
| Caused by: org.jboss.util.NestedSQLException: Unexpected throwable while trying to create a connection: null; - nested throwable: (java.lang.reflect.UndeclaredThrowableException); - nested throwable: (org.jboss.resource.JBossResourceException: Unexpected throwable while trying to create a connection: null; - nested throwable: (java.lang.reflect.UndeclaredThrowableException))
| at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
| at org.jboss.security.auth.spi.DatabaseServerLoginModule.getUsersPassword(DatabaseServerLoginModule.java:141)
| ... 29 more
| Caused by: org.jboss.resource.JBossResourceException: Unexpected throwable while trying to create a connection: null; - nested throwable: (java.lang.reflect.UndeclaredThrowableException)
| at org.jboss.resource.JBossResourceException.rethrowAsResourceException(JBossResourceException.java:61)
| at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:293)
| at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:500)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
| at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:315)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
| at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
| ... 30 more
| Caused by: java.lang.reflect.UndeclaredThrowableException
| at org.jboss.resource.JBossResourceException.process(JBossResourceException.java:204)
| at org.jboss.resource.JBossResourceException.<init>(JBossResourceException.java:111)
| ... 38 more
| Caused by: java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
| at java.lang.Class.forName0(Native Method)
| at java.lang.Class.forName(Unknown Source)
| at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:272)
| at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:170)
| at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:577)
| at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:262)
| ... 36 more
My login-conf.xml says the following:
<!-- The login used by the Cube-client -->
| <application-policy name="cube">
| <authentication>
| <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
| <module-option name="password-stacking">useFirstPass</module-option>
| <module-option name="dsJndiName">java:/MySqlDS</module-option>
| <module-option name = "principalsQuery">SELECT Password FROM Principals WHERE PrincipalID=?</module-option>
| <module-option name = "rolesQuery">SELECT Role, RoleGroup FROM Roles WHERE PrincipalID=?</module-option>
| </login-module>
| </authentication>
| </application-policy>
My database-scheme is for testing-purposes just copied from the JBoss-Handbook:
Table Principals(PrincipalID text, Password text)
| Table Roles(PrincipalID text, Role text, RoleGroup text)
Sorry for asking such "dumb" questions, but I don't how to track down this error. I hope, anybody can help me?!?
Thanks in advance,
Tobias
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077283#4077283
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077283
18Â years, 8Â months
[JBossWS] - Re: Jboww WS problem - plz help
by thomas.dieslerï¼ jboss.com
http://jira.jboss.org/jira/browse/JBWS-1793
Does this also work?
| @echo off
|
| rem $Id: wsprovide.bat 2325 2007-02-09 22:14:15Z jason.greene(a)jboss.com $
|
| @if not "%ECHO%" == "" echo %ECHO%
| @if "%OS%" == "Windows_NT" setlocal
|
| set DIRNAME=.\
| if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%
| set PROGNAME=run.bat
| if "%OS%" == "Windows_NT" set PROGNAME=%~nx0%
|
|
| if not [%1] == [] goto start
| echo %PROGNAME% is a command line tool that invokes a JBossWS JAX-WS Web Service client.
| echo It builds the correct classpath and endorsed libs for you. Feel free to use
| echo the code for this script to make your own shell scripts. It is open source
| echo after all.
| echo.
| echo usage: %PROGNAME% [-classpath ^<additional class path^>] ^<java-main-class^> [arguments...]
| goto EOF
| :start
| set ARGS=
| :loop
| if [%1] == [] goto endloop
| if not %1 == -classpath goto argset
| set WSRUNCLIENT_CLASSPATH=%2
| shift
| shift
| goto loop
| :argset
| set ARGS=%ARGS% %1
| shift
| goto loop
| :endloop
|
| set JAVA=%JAVA_HOME%\bin\java
| set JBOSS_HOME=%DIRNAME%\..
| rem Setup the java endorsed dirs
|
| # Setup the java endorsed dirs
| set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed
|
| # Setup the client classpath
| set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/log4j.jar
| set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/jbossws-client.jar
|
| # JBossAS-5.0 subset of jbossall-client.jar
| set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME/client/jboss-logging-spi.jar
| set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME/client/jboss-common-core.jar
|
| # JBossAS-4.2 subset of jbossall-client.jar
| set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME/client/jboss-common-client.jar
|
| rem Execute the JVM
| "%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSRUNCLIENT_CLASSPATH%" %ARGS%
| :EOF
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077282#4077282
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077282
18Â years, 8Â months