运行成在那里我们为两个不同的DBMS(MS-SQLServer的和Informix)数据源不在登录-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>

和我们的登录-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文件中的安全域的元素,并用简单的用户名和明文密码,既有数据库引擎的两个数据源的工作更换。我们正在使用JBoss中的“所有”服务器配置。我们确信,登录-config.xml中是越来越在启动时加载。并使用安全域元素hqsqldb-ds.xml中工作。但使用我们添加的应用策略到登录-config.xml中,似乎建立新连接时的数据源没有得到的值。

任何想法,我们做错了什么?难道我们错过了什么?

有帮助吗?

解决方案

我们是通过管理控制台测试数据源的有效性。因为我们在那里测试数据库,这是在JBoss EAP 5.0.0.GA版本的bug。虽然没有被确认,也可以是一个,但在管理控制台为5.0.1.GA错误,也许5.0.2.GA。

一切上述实际工作。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top