Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-24391

[GSS](7.4.z) XAManagedConnectionFactory screws up Datasource urls containing ;

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.4.9.CR1, 7.4.9.GA
    • 7.4.8.GA
    • JCA
    • None

      While trying to adjust settings on the H2 data source we use for a corner of our system during testing, I ran into problems.

      H2 accepts parameters appended to the url on the form ";<name>=<value>" for example:
      "jdbc:h2:mem:unit-test;MODE=Oracle"

      I was unable to deploy the datasource using:

      <xa-datasource-property name="url">jdbc:h2:mem:unit-test;MODE=Oracle</xa-datasource-property>

      Ironjacamar keeps complaining about:
      Caused by: java.lang.NoSuchMethodException: Method setMODE not found some setter not being found.

      My initial thought was that <url-delimiter> was the cause, but no dice.

      Following the trace into the sources, I guess the offending line is:

      xaDataSourceProperties = xaDataSourceProperties.replace(';', '\n');
      

      In XAManagedConnectionFactory around line: 174 (see following snippet)

         public void setXADataSourceProperties(String xaDataSourceProperties) throws ResourceException
         {
            this.xaDataSourceProperties = xaDataSourceProperties;
            xaProps.clear();
      
            if (xaDataSourceProperties != null)
            {
               // Map any \ to \\
               xaDataSourceProperties = xaDataSourceProperties.replaceAll("\\\\", "\\\\\\\\");
               // Map any ; to \n
               xaDataSourceProperties = xaDataSourceProperties.replace(';', '\n');
      
               InputStream is = new ByteArrayInputStream(xaDataSourceProperties.getBytes());
               try
               {
                  Properties p = new Properties();
                  p.load(is);
      
                  for (Map.Entry<Object, Object> entry : p.entrySet())
                  {
                     xaProps.put((String)entry.getKey(), (String)entry.getValue());
                  }
               }
      

            istudens@redhat.com Ivo Studensky
            istudens@redhat.com Ivo Studensky
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: