1 2 Previous Next 21 Replies Latest reply on Aug 10, 2016 9:17 AM by Muhammad Zeeshan

    Problem Encrypting Datasource Password for JBoss AS 6.0 M2

    Robert Sullivan Novice

      Hey All,

       

      I've been trying to encrypt my database password using the SecureIdentityLoginModule and I can't seem to get it to work.  Was wondering if anyone could point me in the right direction if things had changed for JBoss 6.0?

       

      For reference, I followed the instructions at this post: http://community.jboss.org/wiki/encryptingdatasourcepasswords

       

      I encrypted my password using the following command:

      C:\apps\jboss-6.0.0.20100216-M2>java -cp client/jboss-logging-spi.jar;common/lib/jbosssx.jar org.jbo
      ss.resource.security.SecureIdentityLoginModule <my database password>
      Encoded password: 1996ff11d0bb3fb4c3bc376bef610c0a

       

      Here's my oracle-ds.xml :

      <datasources>
      
          <local-tx-datasource>
      
              <jndi-name>encryptOracleDS</jndi-name>
      
              <connection-url>jdbc:oracle:thin:@mydbip:port:schema</connection-url>
      
              <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
              <min-pool-size>1</min-pool-size>
              <max-pool-size>5</max-pool-size>
      
          
              <security-domain>EncryptDBPassword</security-domain>
      
              <metadata>
                  <type-mapping>oracle 10g</type-mapping>
              </metadata>
      
          </local-tx-datasource>
      
      </datasources>
      
      

      And in my login-config.xml I put:

          <application-policy name="EncryptDBPassword">
              <authentication>
                  <login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
                      <module-option name="username">myUserId</module-option>
                      <module-option name="password">1996ff11d0bb3fb4c3bc376bef610c0a</module-option>
                      <module-option name="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=encryptOracleDS</module-option>
                  </login-module>
              </authentication>
          </application-policy>

       

       

      When I test the datasource through the admin console I get the following exception:

       

      2010-03-26 11:14:22,377 WARN  [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (ResourceContainer.invoker.nonDaemon-1) Throwable while attempting to get a new connection: null: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: ORA-01017: invalid username/password; logon denied
      )
          at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:225)
          at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:195)
          at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:643)
          at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:267)
          at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:659)
          at org.jboss.resource.connectionmanager.JBossManagedConnectionPool.testConnection(JBossManagedConnectionPool.java:354)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)
          at org.jboss.system.microcontainer.ServiceControllerContext.invoke(ServiceControllerContext.java:194)
          at org.jboss.kernel.plugins.registry.basic.LifecycleAwareKernelBus$1.dispatch(LifecycleAwareKernelBus.java:61)
          at org.jboss.kernel.plugins.registry.basic.LifecycleAwareKernelBus$1.dispatch(LifecycleAwareKernelBus.java:58)
          at org.jboss.kernel.plugins.registry.basic.BasicKernelBus.execute(BasicKernelBus.java:71)
          at org.jboss.kernel.plugins.registry.basic.LifecycleAwareKernelBus.invoke(LifecycleAwareKernelBus.java:57)
          at org.jboss.profileservice.management.KernelBusRuntimeComponentDispatcher.invoke(KernelBusRuntimeComponentDispatcher.java:186)
          at org.jboss.profileservice.management.DelegatingComponentDispatcherImpl.invoke(DelegatingComponentDispatcherImpl.java:103)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
          at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
          at org.jboss.profileservice.remoting.ProfileServiceInvocationHandler.invoke(ProfileServiceInvocationHandler.java:99)
          at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:897)
          at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)
          at org.jboss.remoting.Client.invoke(Client.java:1927)
          at org.jboss.remoting.Client.invoke(Client.java:770)
          at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
          at org.jboss.aop.generatedproxies.AOPProxy$1.invoke(AOPProxy$1.java)
          at org.jboss.profileservice.management.client.ManagedOperationDelegate.invoke(ManagedOperationDelegate.java:63)
          at org.rhq.plugins.jbossas5.ManagedComponentComponent.invokeOperation(ManagedComponentComponent.java:218)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)
      Caused by: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
      
          at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
          at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
          at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
          at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
          at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:406)
          at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
          at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:799)
          at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:368)
          at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508)
          at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)
          at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
          at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)
          at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:207)
          ... 51 more
      

       

       

      I know the username and password are correct.  As the connection works perfectly if I hardcode the username and password into the datasource config.  My suspicion is that the login-config.xml identity and oracle-ds config aren't being linked up properly.  Is there anything else I need to do to enable this security functionality?  When I register the datasource, the console spits out:

      11:03:46,874 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound Conn
      ectionManager 'jboss.jca:service=DataSourceBinding,name=encryptOracleDS' to JNDI name 'java:encryptO
      racleDS'

       

      I've tried setting service=DataSourceBinding in my login-config managedConnectionFactoryName but that doesn't solve the error.  Any help would be greatly appreciated.  Let me know if you'd like me to post any more detailed information.  Thanks!

        • 1. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
          Robert Sullivan Novice

          So last night I tried the same configuration files (oracle-ds.xml and login-config.xml) against JBoss 4 and JBoss 5 and they worked fine.  Is this a bug against JBoss 6?  Or is there a different way to do this now?

          • 2. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
            Tim Mercer Apprentice

            I have the same issue - using jboss-6.0.0.20100216-M2.  I have been researching this bug for the last two days trying to find anything in any forum about this type of problem.  I have tried with both MySQL and PostgreSQL as dbs.  In both cases, when I provide the username and password and no security domain, their is no issue.  As soon as I provide a security domain, I get the following stack traces, depending on the action undertaken.

             

            1) If I deploy an EJB with a persistence.xml that references the data source which references a security domain, I get the following type of error message:

             

             

            2010-04-05 13:49:58,937 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (HDScanner) Error installing to Start: name=persistence.unit:unitName=#whatever state=Create: java.lang.SecurityException: Unauthenticated caller:null
            

             

             

            2) If I do not deploy anything but bring up the JBOSS AS admin console, and try to complete a test connection under Local Tx Datasources, I get the following type of error - this is for the MySQL datasource.

             

             

            [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO))
                at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:225)
                at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:195)
                at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:643)
                at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:267)
                at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:659)
                at org.jboss.resource.connectionmanager.JBossManagedConnectionPool.testConnection(JBossManagedConnectionPool.java:354)
            

             

            Here is my relevant login-config.xml snipit

             

             

                 <application-policy name="EncryptedMySQLDbRealm">
                    <authentication>
                        <login-module
                            code="org.jboss.resource.security.JaasSecurityDomainIdentityLoginModule"
                            flag="required">
                            <module-option name="username">myUserName</module-option>
                            <module-option name="password">myEncryptedPassword</module-option>
                            <module-option name="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MySqlDS</module-option>
                            <module-option name="jaasSecurityDomain">jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword</module-option>
                        </login-module>
                    </authentication>
                </application-policy>
            

             

            Here is my datascoure

             

             

            <?xml version="1.0" encoding="UTF-8"?>
            <datasources>
                <local-tx-datasource>
                    <jndi-name>MySqlDS</jndi-name>
                    <connection-url>jdbc:mysql://127.0.0.1:3306/myDBName</connection-url>
                    <driver-class>com.mysql.jdbc.Driver</driver-class>
                    <security-domain>EncryptedMySQLDbRealm</security-domain>
                    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
                    </exception-sorter-class-name>
                    <metadata>
                        <type-mapping>mySQL</type-mapping>
                    </metadata>
                </local-tx-datasource>
                <mbean code="org.jboss.security.plugins.JaasSecurityDomain"
                    name="jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword">
                    <constructor>
                        <arg type="java.lang.String" value="ServerMasterPassword" />
                    </constructor>
                    <attribute name="KeyStorePass">{CLASS}org.jboss.security.plugins.FilePassword:${jboss.server.home.dir}/conf/server.password
                    </attribute>
                    <attribute name="Salt">MyFancySaltValue</attribute>
                    <attribute name="IterationCount">67</attribute>
                </mbean>
            </datasources>
            

             

            My next step was to try what Mr. Sullivan has already done so that saves me the work.  Any guidance would be truly appreciated.

            • 3. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
              jaikiran pai Master

              Robert Sullivan wrote:

               

               

              When I test the datasource through the admin console I get the following exception:

               

              2010-03-26 11:14:22,377 WARN  [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (ResourceContainer.invoker.nonDaemon-1) Throwable while attempting to get a new connection: null: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: ORA-01017: invalid username/password; logon denied
              )
                  at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:225)
                  at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:195)
                  at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:643)
                  at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:267)
                  at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:659)
                  at org.jboss.resource.connectionmanager.JBossManagedConnectionPool.testConnection(JBossManagedConnectionPool.java:354)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)
                  at org.jboss.system.microcontainer.ServiceControllerContext.invoke(ServiceControllerContext.java:194)
                  at org.jboss.kernel.plugins.registry.basic.LifecycleAwareKernelBus$1.dispatch(LifecycleAwareKernelBus.java:61)
                  at org.jboss.kernel.plugins.registry.basic.LifecycleAwareKernelBus$1.dispatch(LifecycleAwareKernelBus.java:58)
                  at org.jboss.kernel.plugins.registry.basic.BasicKernelBus.execute(BasicKernelBus.java:71)
                  at org.jboss.kernel.plugins.registry.basic.LifecycleAwareKernelBus.invoke(LifecycleAwareKernelBus.java:57)
                  at org.jboss.profileservice.management.KernelBusRuntimeComponentDispatcher.invoke(KernelBusRuntimeComponentDispatcher.java:186)
                  at org.jboss.profileservice.management.DelegatingComponentDispatcherImpl.invoke(DelegatingComponentDispatcherImpl.java:103)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
                  at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
                  at org.jboss.profileservice.remoting.ProfileServiceInvocationHandler.invoke(ProfileServiceInvocationHandler.java:99)
                  at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:897)
                  at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)
                  at org.jboss.remoting.Client.invoke(Client.java:1927)
                  at org.jboss.remoting.Client.invoke(Client.java:770)
                  at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                  at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                  at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                  at org.jboss.aop.generatedproxies.AOPProxy$1.invoke(AOPProxy$1.java)
                  at org.jboss.profileservice.management.client.ManagedOperationDelegate.invoke(ManagedOperationDelegate.java:63)
                  at org.rhq.plugins.jbossas5.ManagedComponentComponent.invokeOperation(ManagedComponentComponent.java:218)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525)
                  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
                  at java.util.concurrent.FutureTask.run(FutureTask.java:138)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                  at java.lang.Thread.run(Thread.java:619)
              Caused by: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
              
                  at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
                  at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
                  at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
                  at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
                  at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:406)
                  at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
                  at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:799)
                  at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:368)
                  at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508)
                  at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)
                  at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
                  at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)
                  at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:207)
                  ... 51 more
              

               

               

              I did a quick check on this. And indeed in 6.0.0.M2 when the admin-console is used to "Test Connection" I see this WARN message being printed on the server console. However, the "Test Connection" result shows as successful. So I decided to keep out admin-console from the equation and tried a simple server side java code to test the getConnection:

               

              Context ctx = new InitialContext(); 
                      DataSource ds = (DataSource) ctx.lookup("java:PostgresDS"); 
                      conn = ds.getConnection(); 
                      System.out.println("Got conn: " + conn);

              Worked fine, with the datasource configured for encrypted password. So looks like it's the way the admin-console implements the "Test Connection" that might be the cause of the WARN messages. I haven't looked at the admin-console code yet, so can't say whether it's a bug in admin-console.

              • 4. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
                Tim Mercer Apprentice

                Jaikiran:

                 

                First, thank you for your reply.  Truly appreciated.

                 

                The "Test Connection" functionality in the admin-console shows "successful" in that the test was submitted successfully ...

                 

                Operation History

                Executed AtOperation NameStatusActions
                April 6, 2010 - 8:41 AMTest ConnectionSuccessful

                 

                However, this is not the result of the test.  That is below this pane as illustrated below.

                 

                 

                Selected  Operation History Item Parameters This operation does not  take any parameters. Results Name Unset Value Description Result Yes No Was a  connection obtained?

                 

                This clearly shows that the connection was not established.

                 

                In regards to the deployment of the siple EJB and the stack trace for the deployment, here is a version of that failure.

                 

                 

                2010-04-05 15:05:23,859 WARN  [org.jboss.dependency.spi.ControllerState] (HDScanner) Deprecated usage of 'new ControllerState', use getInstance, caller: org.jboss.ejb3.deployers.Ejb3DependenciesDeployer$1.deploy(Ejb3DependenciesDeployer.java:67)
                2010-04-05 15:05:23,875 WARN  [org.jboss.ejb3.interceptor.InterceptorInfoRepository] (HDScanner) EJBTHREE-1852: InterceptorInfoRepository is deprecated
                2010-04-05 15:05:24,125 INFO  [org.jboss.jpa.deployment.PersistenceUnitDeployment] (HDScanner) Starting persistence unit persistence.unit:unitName=#myPersistenceUnitName
                2010-04-05 15:05:24,250 INFO  [org.hibernate.cfg.annotations.Version] (HDScanner) Hibernate Annotations 3.5.0-CR-1
                2010-04-05 15:05:24,296 INFO  [org.hibernate.cfg.Environment] (HDScanner) Hibernate 3.5.0-CR-1
                2010-04-05 15:05:24,312 INFO  [org.hibernate.cfg.Environment] (HDScanner) hibernate.properties not found
                2010-04-05 15:05:24,312 INFO  [org.hibernate.cfg.Environment] (HDScanner) Bytecode provider name : javassist
                2010-04-05 15:05:24,328 INFO  [org.hibernate.cfg.Environment] (HDScanner) using JDK 1.4 java.sql.Timestamp handling
                2010-04-05 15:05:24,718 INFO  [org.hibernate.annotations.common.Version] (HDScanner) Hibernate Commons Annotations 3.2.0-SNAPSHOT
                2010-04-05 15:05:24,750 INFO  [org.hibernate.ejb.Version] (HDScanner) Hibernate EntityManager 3.5.0-CR-1
                2010-04-05 15:05:24,843 INFO  [org.hibernate.ejb.Ejb3Configuration] (HDScanner) Processing PersistenceUnitInfo [
                    name: myPersistenceUnitName
                    ...]
                2010-04-05 15:05:24,921 WARN  [org.hibernate.ejb.Ejb3Configuration] (HDScanner) Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
                2010-04-05 15:05:25,109 INFO  [org.hibernate.cfg.AnnotationBinder] (HDScanner) Binding entity from annotated class: com.test.Thing
                2010-04-05 15:05:25,265 INFO  [org.hibernate.cfg.annotations.EntityBinder] (HDScanner) Bind entity com.test.Thing on table THING
                2010-04-05 15:05:25,484 INFO  [org.hibernate.validator.Version] (HDScanner) Hibernate Validator 3.1.0.GA
                2010-04-05 15:05:25,609 INFO  [org.hibernate.validator.util.Version] (HDScanner) Hibernate Validator 4.0.2.GA
                2010-04-05 15:05:25,671 INFO  [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] (HDScanner) Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                2010-04-05 15:05:25,968 INFO  [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] (HDScanner) Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                2010-04-05 15:05:25,984 INFO  [org.hibernate.cfg.search.HibernateSearchEventListenerRegister] (HDScanner) Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
                2010-04-05 15:05:25,984 INFO  [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] (HDScanner) Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                2010-04-05 15:05:26,187 INFO  [org.hibernate.connection.ConnectionProviderFactory] (HDScanner) Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
                2010-04-05 15:05:26,203 INFO  [org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider] (HDScanner) Using provided datasource
                2010-04-05 15:05:26,281 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (HDScanner) Error installing to Start: name=persistence.unit:unitName=#myPersistenceUnitName state=Create: java.lang.SecurityException: Unauthenticated caller:null
                    at org.jboss.security.integration.JBossSecuritySubjectFactory.createSubject(JBossSecuritySubjectFactory.java:92)
                    at org.jboss.resource.connectionmanager.BaseConnectionManager2.getSubject(BaseConnectionManager2.java:688)
                    at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
                    at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:942)
                    at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
                    at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:71)
                    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:114)
                    at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2163)
                    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2159)
                    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1383)
                    at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:974)
                    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:850)
                    at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
                    at org.jboss.jpa.builder.DefaultCEMFBuilder.build(DefaultCEMFBuilder.java:47)
                    at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:316)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
                    at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:151)
                    at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
                    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257)
                    at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
                    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125)
                    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72)
                    at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202)
                    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
                    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
                    at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                    at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                    at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:378)
                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2029)
                    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1050)
                    at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1289)
                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1213)
                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1107)
                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:873)
                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:620)
                    at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:180)
                    at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58)
                    at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
                    at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)
                    at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1660)
                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1378)
                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1399)
                    at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1319)
                    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:378)
                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2029)
                    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1050)
                    at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1289)
                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1213)
                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1107)
                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:918)
                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:633)
                    at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:898)
                    at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:677)
                    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
                    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:409)
                    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:294)
                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
                    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
                    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                    at java.lang.Thread.run(Thread.java:619)
                
                2010-04-05 15:05:26,328 WARN  [org.jboss.system.server.profileservice.hotdeploy.HDScanner] (HDScanner) Failed to process changes: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
                
                DEPLOYMENTS IN ERROR:
                  Deployment "persistence.unit:unitName=#myPersistenceUnitName" is in error due to the following reason(s): java.lang.SecurityException: Unauthenticated caller:null
                
                    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1198)
                    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1144)
                    at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:848)
                    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
                    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:416)
                    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:294)
                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
                    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
                    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                    at java.lang.Thread.run(Thread.java:619)
                
                

                 

                I plan to try the setup in 5.1GA today, time being available, and then do a clean install of 6.0 M2 and see if I can provide steps to consistently reproduce.

                 

                I need this to work via deployment of persistence.xml and the reflection engine in JBoss - not via code I write :-)

                 

                Again, my thanks for your feedback on this.  Any further assistance will be truly appreciated.

                • 5. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
                  jaikiran pai Master

                  Tim Mercer wrote:

                   

                  Jaikiran:

                   

                  First, thank you for your reply.  Truly appreciated.

                   

                  The "Test Connection" functionality in the admin-console shows "successful" in that the test was submitted successfully ...

                   

                  Operation History

                  Executed AtOperation NameStatusActions
                  April 6, 2010 - 8:41 AMTest ConnectionSuccessful

                   

                  However, this is not the result of the test.  That is below this pane as illustrated below.

                   

                   

                  Selected  Operation History Item Parameters This operation does not  take any parameters. Results Name Unset Value Description Result Yes No Was a  connection obtained?

                   

                  This clearly shows that the connection was not established.

                   

                  I have to admit, that's a really confusing way to show the result!

                  • 6. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
                    jaikiran pai Master

                    Tim Mercer wrote:

                     


                     

                    In regards to the deployment of the siple EJB and the stack trace for the deployment, here is a version of that failure.

                     

                     

                    2010-04-05 15:05:26,281 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (HDScanner) Error installing to Start: name=persistence.unit:unitName=#myPersistenceUnitName state=Create: java.lang.SecurityException: Unauthenticated caller:null
                        at org.jboss.security.integration.JBossSecuritySubjectFactory.createSubject(JBossSecuritySubjectFactory.java:92)
                        at org.jboss.resource.connectionmanager.BaseConnectionManager2.getSubject(BaseConnectionManager2.java:688)
                        at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
                        at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:942)
                        at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
                        at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:71)
                        at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:114)
                        at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2163)
                        at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2159)
                        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1383)
                        at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:974)
                        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:850)
                        at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
                        at org.jboss.jpa.builder.DefaultCEMFBuilder.build(DefaultCEMFBuilder.java:47)
                        at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:316)
                        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        at java.lang.reflect.Method.invoke(Method.java:597)
                        at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
                        at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:151)
                        at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
                        at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257)
                        at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
                        at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125)
                        at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72)
                        at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202)
                        at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
                        at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
                        at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                        at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                        at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:378)
                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2029)
                        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1050)
                        at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1289)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1213)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1107)
                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:873)
                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:620)
                        at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:180)
                        at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58)
                        at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
                        at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)
                        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1660)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1378)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1399)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1319)
                        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:378)
                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2029)
                        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1050)
                        at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1289)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1213)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1107)
                        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:918)
                        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:633)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:898)
                        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:677)
                        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
                        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:409)
                        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:294)
                        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
                        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
                        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
                        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
                        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
                        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
                        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                        at java.lang.Thread.run(Thread.java:619)
                     
                     
                    2010-04-05 15:05:26,328 WARN  [org.jboss.system.server.profileservice.hotdeploy.HDScanner] (HDScanner) Failed to process changes: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
                     
                     
                    DEPLOYMENTS IN ERROR:
                      Deployment "persistence.unit:unitName=#myPersistenceUnitName" is in error due to the following reason(s): java.lang.SecurityException: Unauthenticated caller:null
                     
                     
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1198)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1144)
                        at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:848)
                        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
                        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:416)
                        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:294)
                        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
                        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
                        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
                        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
                        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
                        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
                        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                        at java.lang.Thread.run(Thread.java:619)
                     
                    

                     

                    Have you specified username and/or password in the persistence.xml (or hibernate.cfg.xml) of your application? If yes, then remove it from there.

                    • 7. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
                      Tim Mercer Apprentice

                      I just realized that the post I sent did not draw out the html properly for the Selected Operation History Item pane.  For another person reading this thread, this may be confusing.  In this pane, the results showed that

                       

                      Result     O Yes  * NO      Was a connection obtained?

                       

                      This indicated that the connection was not obtained.

                       

                      Yes, it is very confusing the first time as it took a number of times to look at it to actually see it :-) ... I kept trying to figure why it said I had success but it wasn't working ... then I realized it wasn't working as the result indicated that a connection was not obtained.

                       

                      Anyway, the investigation continues :-)

                      • 8. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
                        Tim Mercer Apprentice

                        The persistence.xml does not specify anything beyond the jta-datasource and a few hiberate properites.  Here is the code:

                         

                        persistence.xml

                        <?xml version="1.0" encoding="UTF-8"?>
                        <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                            xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                            version="1.0">
                            <persistence-unit name="titan">
                                <jta-data-source>java:/MySqlDS</jta-data-source>
                                <properties>
                                    <property name="hibernate.ejb.cfgfile" value="/META-INF/hibernate.cfg.xml" />
                                </properties>
                            </persistence-unit>
                        </persistence>
                        
                        

                         

                        hibernate.cfg.xml
                        <?xml version='1.0' encoding='UTF-8'?>
                        <!DOCTYPE hibernate-configuration PUBLIC
                                  "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                                  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
                        <hibernate-configuration>
                            <session-factory>
                                <property name="c3p0.min_size">5</property>
                                <property name="c3p0.max_size">20</property>
                                <property name="c3p0.timeout">300</property>
                                <property name="c3p0.max_statements">50</property>
                                <property name="c3p0.idle_test_period">3000</property>
                                <property name="show_sql">true</property>
                                <property name="hbm2ddl.auto">create-drop</property>
                                <property name="archive.autodetection">class, hbm</property>
                                <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
                                <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
                                <property name="current_session_context_class">thread</property>
                            </session-factory>
                        </hibernate-configuration>
                        

                         

                        This works without issue if I provide a username and password in the datasource like this:

                         

                         

                        <?xml version="1.0" encoding="UTF-8"?>
                        <datasources>
                            <local-tx-datasource>
                                <jndi-name>MySqlDS</jndi-name>
                                <connection-url>jdbc:mysql://127.0.0.1:3306/myDBName</connection-url>
                                <driver-class>com.mysql.jdbc.Driver</driver-class>
                                <user-name>myFancyUsername</user-name>
                                <password>myEverSoSecurePassword</password>
                                <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
                                </exception-sorter-class-name>
                                <metadata>
                                    <type-mapping>mySQL</type-mapping>
                                </metadata>
                            </local-tx-datasource>
                            <mbean code="org.jboss.security.plugins.JaasSecurityDomain"
                                name="jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword">
                                <constructor>
                                    <arg type="java.lang.String" value="ServerMasterPassword" />
                                </constructor>
                                <attribute name="KeyStorePass">{CLASS}org.jboss.security.plugins.FilePassword:${jboss.server.home.dir}/conf/server.password
                                </attribute>
                                <attribute name="Salt">MyReallyFancySalt</attribute>
                                <attribute name="IterationCount">67</attribute>
                            </mbean>
                        </datasources>
                        

                         

                        But as soon as I try to use a security-domain as previously listed, it throws exceptions as previous noted.

                         

                        :-(

                         

                        Again, my thanks for you assistance!

                        • 9. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
                          jaikiran pai Master

                          You seem to be using a keystore based login module JaasSecurityDomainIdentityLoginModule. When I try a similar application as the one you posted with a simple encryption based SecureIdentityLoginModule, it works fine. I haven't tried it with the keystore based one and am not sure whether there any changes/bugs in there.

                           

                          See if the  SecureIdentityLoginModule works for you. If it does, then the issue can be narrowed down to the keystore based login module.

                          • 10. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
                            Robert Sullivan Novice

                            Thank you all for the replies.  I used SecureIdentityLoginModule against an Oracle database.  It looks like me and Tim are seeing the exact same issue in that the user ID and password are not matched up with the datasource definition.  They're supposed to get linked up through the <security-domain> tag, but I think that is the part of the functionality that is failing. 

                             

                            If you look closely at Tim's error you'll see he gets

                            Access denied for user ' '@'localhost' (using password: NO)) against mySQL.  And I get invalid username/password; logon denied against Oracle.  Both errors indicate to me that a blank username/password combo is probably being sent to the database.  There are two likely spots for the error.  Either the login-config.xml isn't being properly loaded at start-up, or the <security-domain> tag isn't functioning correctly to match up to the login-config.  Is there and easy way to verify those two things?

                            • 11. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
                              Tim Mercer Apprentice

                              I have just tried using the following:

                               

                              login-config.xml snipet

                                   <policy>
                                      <!-- Example usage of the SecureIdentityLoginModule -->
                                      <application-policy name="EncryptMySQLDbPassword">
                                          <authentication>
                                              <login-module
                                                  code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
                                                  <module-option name="username">myUserName</module-option>
                                                  <module-option name="password">longfancyHashofNumbersandLetters</module-option>
                                                  <module-option name="managedConnectionFactoryName">jboss.jca:name=MySqlDS,service=LocalTxCM</module-option>
                                              </login-module>
                                          </authentication>
                                      </application-policy>
                                  </policy>
                              

                               

                              longfancyHashofNumbersandLetters was generated using the following command:

                              java -cp client/jboss-logging-spi.jar;common/lib/jbosssx.jar org.jboss.resource.security.SecureIdentityLoginModule MySecertPassword

                               

                              mysql-ds.xml snipet

                               

                                   <local-tx-datasource>
                                      <jndi-name>MySqlDS</jndi-name>
                                      <connection-url>jdbc:mysql://127.0.0.1:3306/MyDBName</connection-url>
                                      <driver-class>com.mysql.jdbc.Driver</driver-class>
                                      <security-domain>EncryptMySQLDbPassword</security-domain>        
                                      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
                                      </exception-sorter-class-name>
                                      <metadata>
                                          <type-mapping>mySQL</type-mapping>
                                      </metadata>
                                  </local-tx-datasource>
                              

                               

                              This gives the following stack trace as before - would like to know your config that worked for you.

                               

                               

                              12:52:12,531 INFO  [org.hibernate.validator.Version] Hibernate Validator 3.1.0.GA
                              12:52:12,562 INFO  [org.hibernate.annotations.common.Version] Hibernate Commons Annotations 3.2.0-SNAPSHOT
                              12:52:20,515 WARN  [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO))
                                  at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:225)
                                  at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:195)
                                  at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:643)
                                  at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:267)
                                  at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:659)
                                  at org.jboss.resource.connectionmanager.JBossManagedConnectionPool.testConnection(JBossManagedConnectionPool.java:354)
                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                  at java.lang.reflect.Method.invoke(Method.java:597)
                              
                              dot dot dot
                              
                              Caused by: java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO)
                                  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)
                                  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3562)
                                  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494)
                                  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:920)
                                  at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4000)
                                  at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1285)
                                  at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2186)
                                  at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:787)
                                  at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
                              

                               

                              So, I believe this is a problem - at least for me - with both SecureIdentityLoginModule and JaasSecurityDomainIdentityLoginModule on JBoss AS 6.0 M2.

                               

                              Like Robert, if you can point us in a direction to get a debug trace of the load of the login-config.xml that would be great.  I believe this is where the problem lies because when I have the username/password in the *-ds.xml file, there is no issue.

                               

                              Kind regards and sincere thanks for assistance provided!

                              • 12. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
                                jaikiran pai Master

                                Tim Mercer wrote:

                                 


                                Like Robert, if you can point us in a direction to get a debug trace of the load of the login-config.xml that would be great.  I believe this is where the problem lies because when I have the username/password in the *-ds.xml file, there is no issue.

                                 

                                 

                                Q4 here http://community.jboss.org/wiki/SecurityFAQ (those logging configs, maybe with small changes, have to be done in JBOSS_HOME/server/< servername>/deploy/jboss-logging.xml)

                                • 13. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
                                  Tim Mercer Apprentice

                                  Progress ... I can now get SecureIdentityLoginModule configuration working ... will come back to this in another post to show values ... but the logging TRACE changes have produced valuable feedback ...

                                   

                                   

                                  2010-04-06 14:36:19,828 TRACE [org.jboss.resource.security.AbstractPasswordCredentialLoginModule] (HDScanner) mcfname: jboss.jca:service=LocalTxCM,name=MySqlDS
                                  2010-04-06 14:36:19,828 TRACE [org.jboss.resource.security.JaasSecurityDomainIdentityLoginModule] (HDScanner) login called
                                  2010-04-06 14:36:19,828 TRACE [org.jboss.resource.security.JaasSecurityDomainIdentityLoginModule] (HDScanner) login
                                  

                                   

                                  dot dot dot

                                   

                                  2010-04-06 14:36:19,828 TRACE [org.jboss.resource.security.JaasSecurityDomainIdentityLoginModule] (HDScanner) Failed to decode password: javax.management.InstanceNotFoundException: jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword is not registered.
                                      at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:529)
                                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:664)
                                  

                                   

                                  dot dot dot

                                   

                                  2010-04-06 14:36:19,828 TRACE [org.jboss.security.plugins.auth.JaasSecurityManagerBase.EncryptedMySQLDbRealm] (HDScanner) Login failure: javax.security.auth.login.LoginException: Failed to decode password: jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword is not registered.
                                      at org.jboss.resource.security.JaasSecurityDomainIdentityLoginModule.commit(JaasSecurityDomainIdentityLoginModule.java:159)
                                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                  

                                   

                                  Now to find out why it failed to decode ... any help or pointer would be great ... off to search Google in the meantime.

                                  • 14. Re: Problem Encrypting Datasource Password for JBoss AS 6.0 M2
                                    Tim Mercer Apprentice

                                    Sorry ... just realized I had a config error ... fixing it ... will post TRACE results shortly.

                                    1 2 Previous Next