8 Replies Latest reply on May 1, 2002 8:21 AM by Staffan Sjölund

    Multiple connections to different Oracle DBs

    Georg Schmid Newbie


      I have the current JB3.1.0alpha CVS head compiled and run it
      on both Solaris and Windows, with the configuration
      adapted to the new format.

      In my app I use connections to different Oracle DBs.
      With the current version the second and any further
      connection receives the following InstanceAlreadyExists exception during startup:

      2002-04-24 20:10:32,719 WARN [org.jboss.system.ServiceController] jboss.jca:service=LocalTxDS,name=FabviewDB does not implement any Service methods
      2002-04-24 20:10:32,719 INFO [org.jboss.resource.connectionmanager.LocalTxConnectionManager] Creating
      2002-04-24 20:10:32,829 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] getObjectName(), name: jboss.management.single:J2EEServer=Single,j2eeType=JCAResource,name=JCA
      2002-04-24 20:10:32,829 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] postRegister(), parent: jboss.management.single:j2eeType=J2EEServer,name=Single
      2002-04-24 20:10:32,844 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] getObjectName(), name: jboss.management.single:J2EEServer=Single,JCAResource=JCA,j2eeType=JCAConnectionFactory,name=LocalTxCM
      2002-04-24 20:10:32,844 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] postRegister(), parent: jboss.management.single:J2EEServer=Single,j2eeType=JCAResource,name=JCA
      2002-04-24 20:10:32,938 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] getObjectName(), name: jboss.management.single:j2eeType=JCAManagedConnectionFactory,name=LocalTxDS
      2002-04-24 20:10:32,938 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] postRegister(), parent: jboss.management.single:J2EEServer=Single,JCAResource=JCA,j2eeType=JCAConnectionFactory,name=LocalTxCM
      2002-04-24 20:10:32,938 INFO [org.jboss.resource.connectionmanager.LocalTxConnectionManager] Created
      2002-04-24 20:10:32,938 WARN [org.jboss.system.ServiceController] jboss.jca:service=LocalTxDS,name=PMSystemDB does not implement any Service methods
      2002-04-24 20:10:32,938 INFO [org.jboss.resource.connectionmanager.LocalTxConnectionManager] Creating
      2002-04-24 20:10:32,938 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] getObjectName(), name: jboss.management.single:J2EEServer=Single,JCAResource=JCA,j2eeType=JCAConnectionFactory,name=LocalTxCM
      2002-04-24 20:10:32,938 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] postRegister(), parent: jboss.management.single:J2EEServer=Single,j2eeType=JCAResource,name=JCA
      2002-04-24 20:10:32,954 ERROR [org.jboss.management.j2ee.JCAConnectionFactory] Could not create JSR-77 JCAConnectionFactory: LocalTxCM
      javax.management.InstanceAlreadyExistsException: jboss.management.single:J2EEServer=Single,JCAResource=JCA,j2eeType=JCAConnectionFactory,name=LocalTxCM already registered.
      at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:677)
      at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:247)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.interceptor.ObjectReferenceInterceptor.invoke(ObjectReferenceInterceptor.java:64)
      at org.jboss.mx.interceptor.MBeanAttributeInterceptor.invoke(MBeanAttributeInterceptor.java:51)
      at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInterceptor.java:91)
      at org.jboss.mx.server.MBeanInvoker.invoke(MBeanInvoker.java:75)
      at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:141)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:934)
      at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:254)
      at org.jboss.management.j2ee.JCAConnectionFactory.create(JCAConnectionFactory.java:193)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.createService(BaseConnectionManager2.java:250)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:134)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
      at $Proxy0.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:271)
      at org.jboss.system.ServiceController.create(ServiceController.java:211)
      at org.jboss.system.ServiceController.create(ServiceController.java:283)
      at org.jboss.system.ServiceController.create(ServiceController.java:211)
      at org.jboss.system.ServiceController.create(ServiceController.java:283)
      at org.jboss.system.ServiceController.create(ServiceController.java:211)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy8.create(Unknown Source)
      at org.jboss.resource.RARDeployer.create(RARDeployer.java:181)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:626)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:506)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy4.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:405)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:586)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:465)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:237)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:162)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:341)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy3.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:281)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:665)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:507)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:452)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:320)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:218)
      at org.jboss.Main.boot(Main.java:142)
      at org.jboss.Main$1.run(Main.java:375)
      at java.lang.Thread.run(Thread.java:484)
      2002-04-24 20:10:32,954 ERROR [org.jboss.management.j2ee.JCAManagedConnectionFactory] Could not create JSR-77 JCAManagedConnectionFactory: LocalTxDS
      RuntimeMBeanException: org.jboss.management.j2ee.JCAManagedConnectionFactory constructor has thrown an exception: java.security.InvalidParameterException: Parent must be set
      Cause: java.security.InvalidParameterException: Parent must be set
      at org.jboss.mx.server.MBeanServerImpl.handleInstantiateExceptions(MBeanServerImpl.java:828)
      at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:790)
      at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:212)
      at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:253)
      at org.jboss.management.j2ee.JCAManagedConnectionFactory.create(JCAManagedConnectionFactory.java:117)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.createService(BaseConnectionManager2.java:256)

      (the second exception is caused by the first one, I guess, the embedded mbean is missing its parent).

      This happens on both platforms, both with J2SE1.4 and 1.3.1-02 (not tested yet with 1.3.1_03).

      As long as I use the Minerva adapter, my app works nonetheless, but when I switch to the new JDBC wrapper,
      the connections to the DBs fail with "Passing wrong credentials."

      It seems, JBoss tries to create the connection manager each time (instead of re-using the already existing one).

      Any help would be much appreciated.

      TIA.

      Georg

        • 1. Re: Multiple connections to different Oracle DBs
          Wellie Chao Newbie

          I'm having a similar problem with 3.1.0alpha CVS head (2002-04-24) and Postgres. I get two errors per datasource right on startup. Here are the errors I get:

          2002-04-24 16:17:22,563 ERROR [org.jboss.management.j2ee.JCAConnectionFactory] C
          ould not create JSR-77 JCAConnectionFactory: LocalTxCM
          javax.management.InstanceAlreadyExistsException: jboss.management.single:J2EESer
          ver=Single,JCAResource=JCA,j2eeType=JCAConnectionFactory,name=LocalTxCM already
          registered.
          at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistr
          y.java:677)
          at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMB
          eanRegistry.java:247)
          at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
          nDispatcher.java:284)
          at org.jboss.mx.interceptor.ObjectReferenceInterceptor.invoke(ObjectRefe
          renceInterceptor.java:64)
          at org.jboss.mx.interceptor.MBeanAttributeInterceptor.invoke(MBeanAttrib
          uteInterceptor.java:51)
          at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInt
          erceptor.java:91)
          at org.jboss.mx.server.MBeanInvoker.invoke(MBeanInvoker.java:75)
          at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMB
          ean.java:141)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.jav
          a:934)
          at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:
          254)
          at org.jboss.management.j2ee.JCAConnectionFactory.create(JCAConnectionFa
          ctory.java:97)
          at org.jboss.resource.connectionmanager.BaseConnectionManager2.createSer
          vice(BaseConnectionManager2.java:250)
          at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:
          134)
          at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
          nDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
          ler.java:867)
          at $Proxy0.create(Unknown Source)
          at org.jboss.system.ServiceController.create(ServiceController.java:271)
          at org.jboss.system.ServiceController.create(ServiceController.java:211)
          at org.jboss.system.ServiceController.create(ServiceController.java:283)
          at org.jboss.system.ServiceController.create(ServiceController.java:211)
          at org.jboss.system.ServiceController.create(ServiceController.java:283)
          at org.jboss.system.ServiceController.create(ServiceController.java:211)
          at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
          nDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
          at $Proxy8.create(Unknown Source)
          at org.jboss.resource.RARDeployer.create(RARDeployer.java:181)
          at org.jboss.deployment.MainDeployer.create(MainDeployer.java:649)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:524)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:488)
          at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
          nDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
          at $Proxy4.deploy(Unknown Source)
          at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
          tScanner.java:405)
          at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDe
          ploymentScanner.java:586)
          at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
          canner.java:465)
          at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
          bstractDeploymentScanner.java:237)
          at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
          62)
          at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
          nDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
          ler.java:867)
          at $Proxy0.start(Unknown Source)
          at org.jboss.system.ServiceController.start(ServiceController.java:341)
          at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
          nDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
          at $Proxy3.start(Unknown Source)
          at org.jboss.deployment.SARDeployer.start(SARDeployer.java:281)
          at org.jboss.deployment.MainDeployer.start(MainDeployer.java:690)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:525)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:488)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
          java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
          nDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:320)
          at org.jboss.system.server.ServerImpl.start(ServerImpl.java:218)
          at org.jboss.Main.boot(Main.java:142)
          at org.jboss.Main$1.run(Main.java:375)
          at java.lang.Thread.run(Thread.java:536)
          2002-04-24 16:17:22,593 ERROR [org.jboss.management.j2ee.JCAManagedConnectionFac
          tory] Could not create JSR-77 JCAManagedConnectionFactory: LocalTxDS
          RuntimeMBeanException: org.jboss.management.j2ee.JCAManagedConnectionFactory con
          structor has thrown an exception: java.security.InvalidParameterException: Paren
          t must be set
          Cause: java.security.InvalidParameterException: Parent must be set
          at org.jboss.mx.server.MBeanServerImpl.handleInstantiateExceptions(MBean
          ServerImpl.java:828)
          at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:
          790)
          at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:
          212)
          at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:
          253)
          at org.jboss.management.j2ee.JCAManagedConnectionFactory.create(JCAManag
          edConnectionFactory.java:59)
          at org.jboss.resource.connectionmanager.BaseConnectionManager2.createSer
          vice(BaseConnectionManager2.java:256)
          at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:
          134)
          at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
          nDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
          ler.java:867)
          at $Proxy0.create(Unknown Source)
          at org.jboss.system.ServiceController.create(ServiceController.java:271)
          at org.jboss.system.ServiceController.create(ServiceController.java:211)
          at org.jboss.system.ServiceController.create(ServiceController.java:283)
          at org.jboss.system.ServiceController.create(ServiceController.java:211)
          at org.jboss.system.ServiceController.create(ServiceController.java:283)
          at org.jboss.system.ServiceController.create(ServiceController.java:211)
          at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
          nDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
          at $Proxy8.create(Unknown Source)
          at org.jboss.resource.RARDeployer.create(RARDeployer.java:181)
          at org.jboss.deployment.MainDeployer.create(MainDeployer.java:649)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:524)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:488)
          at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
          nDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
          at $Proxy4.deploy(Unknown Source)
          at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
          tScanner.java:405)
          at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDe
          ploymentScanner.java:586)
          at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
          canner.java:465)
          at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
          bstractDeploymentScanner.java:237)
          at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
          62)
          at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
          nDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
          ler.java:867)
          at $Proxy0.start(Unknown Source)
          at org.jboss.system.ServiceController.start(ServiceController.java:341)
          at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
          nDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
          at $Proxy3.start(Unknown Source)
          at org.jboss.deployment.SARDeployer.start(SARDeployer.java:281)
          at org.jboss.deployment.MainDeployer.start(MainDeployer.java:690)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:525)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:488)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
          java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
          sorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
          nDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
          at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:320)
          at org.jboss.system.server.ServerImpl.start(ServerImpl.java:218)
          at org.jboss.Main.boot(Main.java:142)
          at org.jboss.Main$1.run(Main.java:375)
          at java.lang.Thread.run(Thread.java:536)

          • 2.
            Wellie Chao Newbie

             

            • 3. Re: Multiple connections to different Oracle DBs
              Wellie Chao Newbie

              The weird thing is that I can still access the datasources. The error doesn't seem to affect my application's ability to interact with the database through the datasources.

              • 4. Re: Multiple connections to different Oracle DBs
                David Jencks Master

                giorgio42-- The exceptions are caused by a bad naming convention by the jsr 77 guys, but should not affect anything. The actual securtiy problem is caused by your not setting up login-conf.xml realms properly for each Connectionmanager. Please see the instructions at http://main.jboss.org/forums/thread.jsp?forum=67&thread=13366

                You will need 3 realms, one for each datasource.

                There is one ConnectionManager per datasource/database.

                If you are using more than one db in a transaction, you need to be using xa. When you have an example for the new connection managers please contribute it.

                • 5. Re: Multiple connections to different Oracle DBs
                  David Jencks Master

                  wchao-- the problems are caused by a bad naming convention by the jsr-77 guys. It should not affect anything except the size of your log file and ability to see your mbeans from the jsr-77 point of view.

                  • 6. Re: Multiple connections to different Oracle DBs
                    Georg Schmid Newbie


                    Two remarks:
                    1) I have setup a realm for each of them (see below).
                    2) The same setup is working when I use the Minerva connection pool. Hmmm.

                    Two sample realms (Oracle8):

                    <application-policy name = "FirstDBRealm">

                    <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
                    flag = "required">
                    <module-option name = "principal">firstPrincipal</module-option>
                    <module-option name = "userName">firstUserName</module-option>
                    <module-option name = "password">firstPassword</module-option>
                    <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=FirstDB</module-option>
                    </login-module>

                    </application-policy>

                    <application-policy name = "SecondDBRealm">

                    <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
                    flag = "required">
                    <module-option name = "principal">secondPrincipal</module-option>
                    <module-option name = "userName">secondUserName</module-option>
                    <module-option name = "password">secondPassword</module-option>
                    <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=SecondDB</module-option>
                    </login-module>

                    </application-policy>

                    ... and so on, as there are more to come.

                    Currently I don't need XA, because I do not use
                    more than one DB in one transaction.

                    Of course I may be missing something...

                    Switching from Minerva to the new wrapper
                    amounts to changing
                    <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter

                    to

                    <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper

                    Is this correct?

                    By default JBoss comes with both jboss-jdbc.rar and
                    jboss-local-jdbc.rar. If I use the new wrapper exclusively, can I remove the jboss-jdbc.rar?

                    I just verified again (on WinNT, JDK1.3.1_02), that
                    the "Wrong credentials" exception happens only with the
                    new wrapper (no changes to login-config.xml, just switching adapters):

                    09:04:09,455 ERROR [EntityContainer] Exception in service lifecyle operation: create
                    09:04:09,470 ERROR [STDERR] java.sql.SQLException: ResourceException javax.resource.ResourceException: Wrong credentials passed to getConnection
                    !
                    09:04:09,470 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(LocalDataSource.java:105)


                    Georg

                    P.S.: Here's the connection factory configuration:
                    <?xml version="1.0" encoding="UTF-8"?>

                    <!-- ===================================================================== -->
                    <!-- -->
                    <!-- JBoss Server Configuration -->
                    <!-- -->
                    <!-- ===================================================================== -->



                    <!-- ==================================================================== -->
                    <!-- ConnectionManager setup for Oracle dbs -->
                    <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
                    <!-- Thanks to Steven Coy -->
                    <!-- ==================================================================== -->


                    <!--make the rar deploy! hack till better deployment-->
                    jboss.jca:service=RARDeployer


                    <depends optional-attribute-name="ManagedConnectionFactoryName">
                    <!--embedded mbean-->

                    <!--hack-->
                    <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter
                    <!-- This fails with Wrong credentials passed...
                    <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
                    -->

                    <!--real attributes-->


                    <config-property>
                    <config-property-name>ConnectionURL</config-property-name>
                    <config-property-type>java.lang.String</config-property-type>
                    <config-property-value>jdbc:oracle:thin:@theHost:1521:theSID</config-property-value>
                    </config-property>
                    <config-property>
                    <config-property-name>DriverClass</config-property-name>
                    <config-property-type>java.lang.String</config-property-type>
                    <config-property-value>oracle.jdbc.driver.OracleDriver</config-property-value>
                    </config-property>



                    SecondDB



                    <depends optional-attribute-name="ManagedConnectionPool">
                    <!--embedded mbean-->


                    0
                    50
                    5000
                    15
                    <!--criteria indicates if Subject (from security domain) or app supplied
                    parameters (such as from getConnection(user, pw)) are used to distinguish
                    connections in the pool. Choices are
                    ByContainerAndApplication (use both),
                    ByContainer (use Subject),
                    ByApplication (use app supplied params only),
                    ByNothing (all connections are equivalent, usually if adapter supports
                    reauthentication)-->
                    ByContainer



                    <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager

                    <!--Be sure to set up an OracleDbRealm (similar to DefaultDbRealm)
                    in the auth.conf file if you want to use container managed security -->
                    <!--comment out this line if you want component managed security or want
                    to use the default values in the ManagedConnectionFactoryProperties -->
                    java:/jaas/SecondDBRealm

                    java:/TransactionManager





                    • 7. Re: Multiple connections to different Oracle DBs
                      David Jencks Master

                      Is there any chance you are using getConnection(user,pw)?

                      If so, and perhaps in any case, try changing the Criteria property to ByContainerAndApplication.

                      If not or if this doesn't help, could you modify the end of LocalManagedConnection checkIdentity to print out what private void checkIdentity(Subject subject, ConnectionRequestInfo cri)
                      throws ResourceException
                      {
                      Properties newProps = mcf.getConnectionProperties(subject, cri);
                      if (!props.equals(newProps))
                      {
                      System.out.println("Existing props: " + props);
                      System.out.println("New props: " + newProps);
                      throw new ResourceException("Wrong credentials passed to getConnection!");
                      } // end of if ()
                      }

                      Please send me what you find out.

                      thanks
                      david jencks

                      • 8. Re: Multiple connections to different Oracle DBs
                        Staffan Sjölund Newbie

                        I have a similar problem with credentials but with Ms Sql Server with sprinta jdbc-driver.

                        JBoss 3.1 alpha
                        Win2000 (Swedish)
                        jdk1.4

                        When I modified LocalManagedConnection.java I get the following output:
                        11:42:59,983 INFO [STDOUT] Existing props: {user=myuser, url=jdbc:inetdae7:local
                        Host?database=pwf, password=mypassword}
                        11:42:59,983 INFO [STDOUT] New props: {user=myuser, password=mypassword}

                        The url-property is the connection string to the jdbcdriver.

                        I also removed the throwing of the ResourceException in LocalManagedConnection.java just to see what happened.

                        JBoss then throws another exception which I think is "interesting". It seems that JBoss uses a translation property to the local language (swedish in this case) somewhere and subject is translated into "ärende" and so on. I don't know if this is wrong but it seems strange to me.


                        2002-05-01 11:43:07,784 ERROR [STDERR] java.sql.SQLException: ResourceException javax.resource.ResourceException: Error in use of ManagedConnectionPool: matchManagedConnection failed with subject: Ärende:
                        Principal: dummy
                        Privata kreditiv: javax.resource.spi.security.PasswordCredential@950000
                        and ConnectionRequestInfo: null
                        2002-05-01 11:43:07,834 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(LocalDataSource.java:105)
                        2002-05-01 11:43:07,844 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.SQLUtil.fixTableName(SQLUtil.java:38)
                        2002-05-01 11:43:07,854 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.(JDBCEntityBridge.java:103)
                        2002-05-01 11:43:07,864 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.create(JDBCStoreManager.java:333)
                        2002-05-01 11:43:07,864 ERROR [STDERR] at org.jboss.ejb.plugins.CMPPersistenceManager.create(CMPPersistenceManager.java:155)
                        2002-05-01 11:43:07,874 ERROR [STDERR] at org.jboss.ejb.EntityContainer.create(EntityContainer.java:324)
                        2002-05-01 11:43:07,884 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:818)

                        Keep up the good work!
                        /Staffan