2つの異なるDBMS(MS-SQLServerとInformix)のデータソースがlogin-config.xmlファイルのセキュリティドメイン構成を取得していないという問題が発生しました。
データソースは次のようになります。
<datasources>
<local-tx-datasource>
<jndi-name>ourTX</jndi-name>
<connection-url>jdbc:informix-sqli://our.server.com:1526/wlms:informixserver=ol_db</connection-url>
<driver-class>com.informix.jdbc.IfxDriver</driver-class>
<security-domain>ourDS</security-domain>
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>InformixDB</type-mapping>
</metadata>
<min-pool-size>5</min-pool-size>
<max-pool-size>50</max-pool-size>
<prefill>yes</prefill>
<prepared-statement-cache-size>10</prepared-statement-cache-size>
<idle-timeout-minutes>5</idle-timeout-minutes>
<new-connection-sql>set lock mode to wait 4;set isolation to cursor stability;</new-connection-sql>
<check-valid-connection-sql>SELECT count(*) FROM dummy;</check-valid-connection-sql>
</local-tx-datasource>
</datasources>
また、login-config.xmlには次のエントリがあります。
<application-policy name="ourDS">
<authentication>
<login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
<module-option name="userName">user</module-option>
<module-option name="password">-4e5f8b6c4217c342c03b57ed16d31678</module-option>
<module-option name="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=ourTX</module-option>
</login-module>
</authentication>
</application-policy>
ただし、JBossサーバーがデプロイされると、Informixで次のようなエラーが発生します。
13:23:13,521 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Incorrect password or user com.informix.asf.IfxASFRemoteException: user@my.computer.com is not known on the database server.)
また、MS-SQLServerの場合、次のようなInformixと同様のエラーが発生します。
13:25:23,053 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user ''. The user is not associated with a trusted SQL Server connection.)
ここで、* -ds.xmlファイルのsecurity-domain要素をコメントアウトし、それを単純なユーザー名とクリアテキストのパスワードに置き換えると、両方のデータソースが両方のデータベースエンジンで機能します。JBossでは「all」サーバー設定を使用しています。起動時にlogin-config.xmlが読み込まれることを確認しました。また、security-domain要素を使用するhqsqldb-ds.xmlが機能します。しかし、login-config.xmlに追加されたapplication-policyを使用すると、新しい接続を確立するときにデータソースが値を取得しないようです。
私たちが間違っていることについて何か考えはありますか?私たちは何かを逃したことがありますか?