1 Reply Latest reply on Jun 3, 2009 5:55 PM by Peter Johnson

    Problem with encrypted passwords for an Oracle datasource

    Holger Beetz Newbie

      Hi there,

      I have a problem with using encrypted passwords with JBoss datasources.

      I´ve been following this guide:
      http://www.jboss.org/community/wiki/EncryptingDataSourcePasswords

      Here is the datasource:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <datasources>
       <xa-datasource>
       <jndi-name>epr-db</jndi-name>
       <track-connection-by-tx/>
       <isSameRM-override-value>false</isSameRM-override-value>
       <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
       <xa-datasource-property name="URL">
       jdbc:oracle:thin:@127.0.0.1:1521:xe
       </xa-datasource-property>
       <!--
       <xa-datasource-property name="User">epr</xa-datasource-property>
       <xa-datasource-property name="Password">verlag</xa-datasource-property>
       -->
       <security-domain>ePR-Password</security-domain>
       </xa-datasource>
      </datasources>
      

      I´ve commented the initial DB user and password out. If I use the user and password in clear-text the database connection works fine.

      This is the security domain I´ve set up in the login-config.xml:
       <application-policy name="ePR-Password">
       <authentication>
       <login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
       <module-option name="username">epr</module-option>
       <module-option name="password">-2a049cd3108dc16b</module-option>
       <module-option name="managedConnectionFactoryName">jboss.jca:name=epr-db,service=LocalTxCM</module-option>
       </login-module>
       </authentication>
       </application-policy>
      


      The database I use is a locally running Oracle XE. The JBoss (Community Version 4.2.2GA) reports the following error:
      2009-06-03 21:08:57,203 ERROR [org.jboss.resource.security.AbstractPasswordCredentialLoginModule] The ConnectionManager mbean: jboss.jca:service=LocalTxCM,name=epr-db specified in a ConfiguredIdentityLoginModule could not be found. ConnectionFactory will be unusable!
      ..
      

      This causes that the deployment of all ear-files depending on the data source fails. I´m unshure if the service property for the module is correct but most examples for standard datasources look like this.

      Does anyone have a clue what I´m doing wrong ?

      TIA,
      Holger


        • 1. Re: Problem with encrypted passwords for an Oracle datasourc
          Peter Johnson Master

          The wiwki entry assume a local transaction databasource. You are using XA. Try, which generate different mbeans. Try changing this one line in the login module (note the changed service name):

          <module-option name="managedConnectionFactoryName">jboss.jca:name=epr-db,service=XATxCM</module-option>
          


          I hope that is the right name, but you could deploy your *-ds.xml file with the user-name and password and then lookup the mbean name.

          One caveat - I'm not sure if doing this works for XA data sources.