6 Replies Latest reply on Nov 18, 2004 7:02 PM by adrian.brock

    Propertes get not set on ManagedConnectionFactory

    ralf.siedow

      Hello,

      my ra.xml containts two properties for my ManagedConnectionFactory, but these properties get not set while deploying the RA. It works well with properties for the ResourceAdapter class defined via config-properties within the resourceadapter element.

      <outbound-resourceadapter>
      <connection-definition>
      <managedconnectionfactory-class>
      test.adapter.MyManagedConnectionFactory
      </managedconnectionfactory-class>
      <config-property>
      <config-property-name>QueueName</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>queue/test</config-property-value>
      </config-property>
      <config-property>
      <config-property-name>ConnectionFactory</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>ConnectionFactory</config-property-value>
      </config-property>
      ... cut ...
      </connection-definition>
      ... cut ...
      </outbound-resourceadapter>

      The Properties in the ManagedConnectionFactory class are normal bean getters/setters with a private attribute.

      Did I miss anything?

      Has the setResourceAdapter method be invoked manually or does the container do this. It doesn't get called as well.

      My JBoss is Version 4.0.0RC1.

      Thanks,
      Ralf

        • 1. Re: Propertes get not set on ManagedConnectionFactory
          sandeep_rajpathak

          For the query on setResourceAdapter not getting called, the ManagedConnectionFactory implementation class should implement ResourceAdapterAssociation interface. Only then does the container call the setResourceAdapter method.

          • 2. Re: Propertes get not set on ManagedConnectionFactory
            ralf.siedow

             

            "sandeep_rajpathak" wrote:
            For the query on setResourceAdapter not getting called, the ManagedConnectionFactory implementation class should implement ResourceAdapterAssociation interface. Only then does the container call the setResourceAdapter method.

            MyMCF implements the MCF-Iface as well as the ResourceAdapterAssociation.

            • 3. Re: Propertes get not set on ManagedConnectionFactory
              aonnen

              Hello,

              I've got the same problem with jboss-4.0.0RC1.

              ra.xml :


              <resourceadapter-class>
              net.java.bdbadapter.jca.BerkeleyDBResourceAdapter
              </resourceadapter-class>

              <outbound-resourceadapter>
              <connection-definition>
              <managedconnectionfactory-class>
              net.java.bdbxmladapter.jca.BerkeleyDBXMLManagedConnectionFactory
              </managedconnectionfactory-class>

              <config-property>
              The db environment home directory
              <config-property-name>dbEnvHome</config-property-name>
              <config-property-type>java.lang.String</config-property-type>
              </config-property>

              <config-property>

              The db environment encryption password; the db environment is
              encrypted via the Berkeley DB environment encryption mechanism if
              and only if a non-empty encryption password is given.

              <config-property-name>dbEnvPassword</config-property-name>
              <config-property-type>java.lang.String</config-property-type>
              </config-property>

              <connectionfactory-interface>
              net.java.bdbxmladapter.BerkeleyDBXMLConnectionFactory
              </connectionfactory-interface>
              <connectionfactory-impl-class>
              net.java.bdbxmladapter.jca.JCABerkeleyDBXMLConnectionFactory
              </connectionfactory-impl-class>

              <connection-interface>
              net.java.bdbadapter.BerkeleyDBConnection
              </connection-interface>
              <connection-impl-class>
              net.java.bdbadapter.jca.JCABerkeleyDBConnection
              </connection-impl-class>
              </connection-definition>
              <transaction-support>XATransaction</transaction-support>
              <authentication-mechanism>
              <authentication-mechanism-type>
              BasicPassword
              </authentication-mechanism-type>
              <credential-interface>
              javax.resource.spi.security.PasswordCredential
              </credential-interface>
              </authentication-mechanism>
              <reauthentication-support>true</reauthentication-support>
              </outbound-resourceadapter>

              <security-permission>
              <security-permission-spec>
              grant {
              permission java.lang.RuntimePermission "getClassLoader";
              };
              </security-permission-spec>
              </security-permission>


              setter/getter of dbEnvPassword and dbEnvHome exists in BerkeleyDBXMLManagedConnectionFactory. This exception is ever launched :

              java.lang.IllegalArgumentException: The class 'class net.java.bdbxmladapter.jca.BerkeleyDBXMLManagedConnectionFactory' has no setter for config property 'dbEnvHome'
              at org.jboss.resource.connectionmanager.RARDeployment.setManagedConnectionFactoryAttribute(RARDeployment.java:617)
              at org.jboss.resource.connectionmanager.RARDeployment.setMcfProperties(RARDeployment.java:732)
              at org.jboss.resource.connectionmanager.RARDeployment.startService(RARDeployment.java:566)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)


              any idea?

              • 4. Re: Propertes get not set on ManagedConnectionFactory

                The problem is caused by your property names beginning with a lower case letter.
                The -ds.xml deployer does not convert aProperty to setAProperty.

                If you use AProperty rather than aProperty it will work.

                Please report a bug at www.sf.net/projects/jboss to remind me to fix
                the conversion of the first letter to upper case when accessing the setter
                as per the JavaBean standard.

                This problem also exists in jboss-3.2

                • 5. Re: Propertes get not set on ManagedConnectionFactory

                  Hello

                  I'm currently using JBoss 3.2.6 and this problem still exist.
                  Any hint when it will be fixed?

                  Regards
                  Janusz

                  • 6. Re: Propertes get not set on ManagedConnectionFactory

                    Fixed for 3.2.7