2 Replies Latest reply on Dec 12, 2005 12:02 PM by Anna Veirauchs

    JBoss 'all' configuration, DataSources, and Security Domains

    Anna Veirauchs Newbie

      Heya,

      I've been running a default configuration on JBoss4.0.1sp1 using a DataSource with a Security Domain that uses SecureIdentityLoginModule. I'm starting to looking into clustering, so I switched to an 'all' configuration using JBoss4.0.3sp1. Now I'm getting exceptions thrown when my application attempts to use the DataSource. I've tried a 'default' configuration under JBoss4.0.3sp1 and it will work with the security domain. If I remove the security domain and put the username/password into the *-ds.xml file, everything is fine under an 'all' configuration. Is there something else I must configure? I've included snippets from the relevant files and the exception thrown below.

      Thanks!
      Anna

      ================
      *-ds.xml:

      <local-tx-datasource>
      <jndi-name>app/jdbc/JDBCDataSource</jndi-name>
      <connection-url>jdbc:jtds:sqlserver://99.99.99.99:1433/myDatabase;instance=myInstance</connection-url>
      <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>

      <!--sql to call on an existing pooled connection when it is obtained from pool-->
      <check-valid-connection-sql>SELECT COUNT(*) from sysobjects</check-valid-connection-sql>

      <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
      <min-pool-size>10</min-pool-size>

      <!-- The maximum connections in a pool/sub-pool -->
      <max-pool-size>20</max-pool-size>

      <!-- Use the security domain defined in conf/login-config.xml -->
      <security-domain>EncryptDBPassword</security-domain>


      <type-mapping> MS SQLSERVER2000</type-mapping>

      </local-tx-datasource>


      ==================
      login-config.xml:

      .
      .
      <application-policy name = "EncryptDBPassword">

      <login-module code = "org.jboss.resource.security.SecureIdentityLoginModule"
      flag = "required">
      <module-option name = "username">user</module-option>
      <module-option name = "password">1664e406af7c012d</module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=TxCM,name=app/jdbc/JDBCDataSource</module-option>
      </login-module>

      </application-policy>
      .
      .
      =================
      Exception thrown:


      2005-12-02 16:53:46,593 ERROR [org.jboss.resource.security.AbstractPasswordCredentialLoginModule] The ConnectionManager mbean: jboss.jca:name=app/jdbc/JDBCDataSource,service=TxCM specified in a ConfiguredIdentityLoginModule could not be found. ConnectionFactory will be unusable!
      2005-12-02 16:53:46,603 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/PortfolioBuilder].[ApplicationController]] Servlet.service() for servlet ApplicationController threw exception
      java.lang.SecurityException: Invalid authentication attempt, principal=null
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getSubject(BaseConnectionManager2.java:665)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:461)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:894)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:73)
      .
      .
      .