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

<depends>jboss.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>
      <datasource>java:/DefaultDS</datasource>
      <datasource-mapping>mySQL</datasource-mapping>
 
      <create-table>true</create-table>
      <remove-table>false</remove-table>
      <read-only>false</read-only>
      <time-out>300</time-out>
      <pk-constraint>true</pk-constraint>
      <fk-constraint>false</fk-constraint>
      <row-locking>false</row-locking>
      <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
      <read-ahead>
      <strategy>on-load</strategy>
      <page-size>1000</page-size>
      <eager-load-group>*</eager-load-group>
      </read-ahead>
      <list-cache-max>1000</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: start
2002-08-20 18:10:41,217 DEBUG [org.jboss.jetty.security.JBossUserRealm#jaastest-domain] created JBossUserRealm::JBossUserPrincipal: scott
2002-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 failure
javax.security.auth.login.LoginException: javax.naming.NameNotFoundException: DefaultDS not bound
 at 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 javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
 at javax.security.auth.login.LoginContext$4.run(LoginContext.java:599)
 at java.security.AccessController.doPrivileged(Native Method)
 at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:596)
 at javax.security.auth.login.LoginContext.login(LoginContext.java:523)

 


 

 



Do You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs

Reply via email to