1 Reply Latest reply on Jun 16, 2011 9:09 AM by jaikiran

    JBoss 7: Using encrypted datasource password

    juergen.zimmermann

      In JBoss 6 I'm using an encrypted datasource password specified in a file *-jboss-beans.xml. Now I tried the following in standalone/configuration/standalone.xml of JBoss 7:
      a) Inside the datasource tag:
      <security>
         <security-domain>verschluesseltesDbPassword</security-domain>
      </security>

      b) Inside the security-domains tag:
      <security-domain name="verschluesseltesDbPassword" cache-type="default">
        <authentication>

          <login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
            <module-option name="username" value="swe2"/>
            <module-option name="password" value="..."/>
            <module-option name="managedConnectionFactoryName" value="jboss.jca:name=swe2DS,service=LocalTxCM"/>
          </login-module>
        </authentication>
      </security-domain>

      However, I get the following error message when launching the JBoss server. Any hint is appreciated!
      11:03:57,206 ERROR [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-2) Exception during createSubject()Unauthenticated caller:null: java.lang.SecurityException: Unauthenticated caller:null
          at org.jboss.security.plugins.JBossSecuritySubjectFactory.createSubject(JBossSecuritySubjectFactory.java:83)
          at org.jboss.jca.deployers.common.AbstractDsDeployer$1.run(AbstractDsDeployer.java:979)
          at org.jboss.jca.deployers.common.AbstractDsDeployer$1.run(AbstractDsDeployer.java:959)
          at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_26]
          at org.jboss.jca.deployers.common.AbstractDsDeployer.createSubject(AbstractDsDeployer.java:958)
          at org.jboss.jca.deployers.common.AbstractDsDeployer.deployDataSource(AbstractDsDeployer.java:507)
          at org.jboss.jca.deployers.common.AbstractDsDeployer.createObjectsAndInjectValue(AbstractDsDeployer.java:246)
          at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer.deploy(AbstractDataSourceService.java:241)
          at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:105)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1675)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
          at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]