Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-3677

MBean operation JBossManagedConnectionPool.testConnection results in a failed connection when using a security-domain

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Major
    • EAP_EWP 5.1.0
    • EAP 5.0.0
    • System
    • None
    • EAP 5.0.0 GA
      Oracle datasource descriptor using Oracle 10g database and a security-domain for encrypted password

    Description

      After configuring an Oracle datasource descriptor using a security-domain as described by http://community.jboss.org/wiki/EncryptingDataSourcePasswords and then attempting to invoke the org.jboss.resource.connectionmanager.JBossManagedConnectionPool.testConnection MBean operation via jmx-console, the following exception is generated in server.log:

      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: invalid arguments in call)
      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:633)
      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:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      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:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.jboss.system.microcontainer.ServiceControllerContext.invoke(ServiceControllerContext.java:190)
      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:65)
      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:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      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:1917)
      at org.jboss.remoting.Client.invoke(Client.java:768)
      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:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:636)
      Caused by: java.sql.SQLException: invalid arguments in call
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:190)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:286)
      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:250)
      at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
      at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:839)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:207)
      ... 51 more

      This appears to be because getLocalManagedConnection() is using the raw properties of the datasource and is expecting username and password to be filled in. If not, an empty properties object is sent directly to Driver.getConnection(url, props) resulting in the Oracle error.

      This issue has also been seen with DB2 and PostgreSQL and I am guessing would affect any data source that actually requires a username and password to be passed to getConnection().

      It seems that the testConnection operation should take into account that a security-domain may be in use.

      This issue directly impacts the use of the testConnection MBean operation and the admin-console's Test Connection feature for datasources when using an encrypted password.

      Attachments

        Activity

          People

            smarlow1@redhat.com Scott Marlow
            rhn-support-loleary Larry O'Leary
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: