This content has been marked as final.
Show 4 replies
-
1. Re: No matching credentials in Subject Exception!
peterj May 15, 2008 11:36 AM (in response to kks_krishna)There is no way we can help you if you do not post the configuration changes you made. And any related code.
-
2. Re: No matching credentials in Subject Exception!
kks_krishna May 15, 2008 11:03 PM (in response to kks_krishna)The following are the changes I have made. Please help me at the earliest.
Chamges on Hibernate Configuration file<hibernate-configuration> <session-factory> <property name="dialect"> org.hibernate.dialect.MySQLDialect </property> <property name="connection.datasource">java:MySqlDS1</property> <mapping resource="Offlinetelephone.hbm.xml" /> </hibernate-configuration>
Changes in mysql-ds.xml<datasources> <local-tx-datasource> <jndi-name>MySqlDS</jndi-name> <connection-url>jdbc:mysql://192.168.48.227:3306/systemdatabase</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <min-pool-size>1</min-pool-size> <max-pool-size>20</max-pool-size> <security-domain>EncryptDBPassword</security-domain> <metadata> <type-mapping>mySQL</type-mapping> </metadata> </local-tx-datasource> <local-tx-datasource> <jndi-name>MySqlDS1</jndi-name> <connection-url>jdbc:mysql://192.168.48.227:3306/telephone_element1</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <min-pool-size>1</min-pool-size> <max-pool-size>20</max-pool-size> <security-domain>EncryptDBPassword</security-domain> <metadata> <type-mapping>mySQL</type-mapping> </metadata> </local-tx-datasource> </datasources>
Changes in login-config.xml
<application-policy name="EncryptDBPassword"> <authentication> <login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required"> <module-option name="username">root</module-option> <module-option name="password">6f8e652f571678f2</module-option> <module-option name="managedConnectionFactoryName">jboss.jca:name=MySqlDS,service=LocalTxCM</module-option> </login-module> </authentication> </application-policy>
-
3. Re: No matching credentials in Subject Exception!
jaikiran May 16, 2008 2:18 AM (in response to kks_krishna)<module-option name="managedConnectionFactoryName">jboss.jca:name=MySqlDS,service=LocalTxCM</module-option>
Shouldn't this be:<module-option name="managedConnectionFactoryName">jboss.jca:name=MySqlDS1,service=LocalTxCM</module-option>
-
4. Re: No matching credentials in Subject Exception!
purushothamreddy.p Aug 25, 2009 9:06 AM (in response to kks_krishna)For your data source you need two <application-policy> tags.
One is for MySqlDS another is for MySqlDS1.
You cannot put them into one single
<application-policy name="EncryptDBPassword">.
Try the following:
Your mysql-ds.xml file will be changed like this.<datasources> <local-tx-datasource> <jndi-name>MySqlDS</jndi-name> <connection-url>jdbc:mysql://192.168.48.227:3306/systemdatabase</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <min-pool-size>1</min-pool-size> <max-pool-size>20</max-pool-size> <security-domain>EncryptDBPassword</security-domain> <metadata> <type-mapping>mySQL</type-mapping> </metadata> </local-tx-datasource> <local-tx-datasource> <jndi-name>MySqlDS1</jndi-name> <connection-url>jdbc:mysql://192.168.48.227:3306/telephone_element1</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <min-pool-size>1</min-pool-size> <max-pool-size>20</max-pool-size> <security-domain>EncryptDBPassword1</security-domain> <metadata> <type-mapping>mySQL</type-mapping> </metadata> </local-tx-datasource> </datasources>
You can observe the brown color change in your mysql-ds.xml.
Then the login-config.xml file should be like this<application-policy name="EncryptDBPassword"> <authentication> <login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required"> <module-option name="username">root</module-option> <module-option name="password">6f8e652f571678f2</module-option> <module-option name="managedConnectionFactoryName">jboss.jca:name=MySqlDS,service=LocalTxCM</module-option> </login-module> </authentication> </application-policy> <application-policy name="EncryptDBPassword1"> <authentication> <login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required"> <module-option name="username">root</module-option> <module-option name="password">6f8e652f571678f2</module-option> <module-option name="managedConnectionFactoryName"> jboss.jca:name=MySqlDS1, service=LocalTxCM </module-option> </login-module> </authentication> </application-policy>
The main reason for this exception is the application is not getting the MySqlDS1 connection from the connection pool. Because you have not configured MySqlDS1 in the SecureIdentityLoginModule.
Thanks
Purushotham