Hi,
I went through the topic DefaultDB in this forum and made corresponding changes. But still it seemed that my problem was not addressed here. Wish somebody can help.
Thanks in advance.
Jerry
My env:
Database Vendor: MySql
Database: authority
Table: users| username | password || scott | scott123 || start | start123 |+--+--+
Table:userroles| username | userrole || start | Coder || scott | Echo |
user "scott" has all previledges---
mysql-service.xml:
server
mbean code="org.jboss.resource.connectionmanager.LocalTxConnectionManager" name="jboss.jca:service=LocalTxCM,name=MySqlDS"
!--uncomment out this line if you are using the MySqlDbRealm above
attribute name="SecurityDomainJndiName"MySqlDbRealm/attribute
--
depends optional-attribute-name="ManagedConnectionFactoryName"
!--embedded mbean--
mbean code="org.jboss.resource.connectionmanager.RARDeployment" name="jboss.jca:service=LocalTxDS,name=MySqlDS"
attribute name="JndiName"DefaultDS/attribute
attribute name="ManagedConnectionFactoryProperties"
properties
config-property name="ConnectionURL" type="java.lang.String"jdbc:mysql://localhost:3306/authority/config-property
config-property name="DriverClass" type="java.lang.String"org.gjt.mm.mysql.Driver/config-property
!--set these only if you want only default logins, not through JAAS --
config-property name="UserName" type="java.lang.String"scott/config-property
config-property name="Password" type="java.lang.String"scott123/config-property
/properties
/attribute
!--Below here are advanced properties --
!--hack--
depends optional-attribute-name="OldRarDeployment"jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper/depends
/mbean
/depends
depends optional-attribute-name="ManagedConnectionPool"
!--embedded mbean--
mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool" name="jboss.jca:service=LocalTxPool,name=MySqlDS"
attribute name="MinSize"0/attribute
attribute name="MaxSize"50/attribute
attribute name="BlockingTimeoutMillis"5000/attribute
attribute name="IdleTimeoutMinutes"15/attribute
attribute name="Criteria"ByContainer/attribute
/mbean
/depends
depends optional-attribute-name="CachedConnectionManager"jboss.jca:service=CachedConnectionManager/depends
depends optional-attribute-name="JaasSecurityManagerService"jboss.security:service=JaasSecurityManager/depends
attribute name="TransactionManager"java:/TransactionManager/attribute
!--make the rar deploy! hack till better deployment--
dependsjboss.jca:service=RARDeployer/depends
/mbean
/server
---
login-config.xml
---
policy
authentication
login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required" /
module-option name = "principal"scott/module-option
module-option name = "userName"scott/module-option
module-option name = "password"scott123/module-option
module-option name = "unauthenticatedIdentity"nobody/module-option
module-option name = "managedConnectionFactoryName"jboss.jca:service=XaTxCM,name=MySqlDS/module-option
/authentication
/application-policy
/policy
standardjbosscmp-jdbc.xml:
jbosscmp-jdbc defaults datasourcejava:/DefaultDS/datasource datasource-mappingmySQL/datasource-mapping create-tabletrue/create-table remove-tablefalse/remove-table read-onlyfalse/read-only time-out300/time-out pk-constrainttrue/pk-constraint fk-constraintfalse/fk-constraint row-lockingfalse/row-locking preferred-relation-mappingforeign-key/preferred-relation-mapping read-ahead strategyon-load/strategy page-size1000/page-size eager-load-group*/eager-load-group /read-ahead list-cache-max1000/list-cache-max /defaults
.
/jbosscmp-jdbc
---
At last: the error:
2002-08-20 18:10:41,207 DEBUG [org.jboss.jetty.security.JBossUserRealm#jaastest-domain] JBossUserPrincipal: start2002-08-20 18:10:41,217 DEBUG [org.jboss.jetty.security.JBossUserRealm#jaastest-domain] created JBossUserRealm::JBossUserPrincipal: scott2002-08-20 18:10:41,217 DEBUG [org.jboss.jetty.security.JBossUserRealm#jaastest-domain] authenticating: Name:scott Password:2002-08-20 18:10:41,467 DEBUG [org.jboss.security.plugins.JaasSecurityManager.jaastest-domain] Login failurejavax.security.auth.login.LoginException: javax.naming.NameNotFoundException: DefaultDS not boundat org.jboss.security.auth.spi.DatabaseServerLoginModule.getUsersPassword(DatabaseServerLoginModule.java:110)at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:142)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:324)at javax.security.auth.login.LoginContext.invoke(LoginContext.java:664)at