Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-8831

hsqldb-ds.xml connection-url configuration for server mode results in null connection-url

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • No Release
    • 6.0.0.Final
    • None
    • None

      The hsqldb-ds.xml has sections which need to be uncommented (and some commented) to enable server mode HSQL DB server. Additionally, a section in the bindings-jboss-beans.xml in JBOSS_HOME/server/<servername>/conf/bindingservice.beans needs to be uncommented too.

      The part which fails is:

      <connection-url>
      <value-factory bean="ServiceBindingManager" method="getStringBinding">
      <parameter>jboss:service=Hypersonic</parameter>
      <parameter>jdbc:hsqldb:hsql://${hostforurl}:${port}</parameter>
      </value-factory>
      </connection-url>

      The exception is:

      Caused by: org.jboss.resource.JBossResourceException: connectionURL is null
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createConnectionFactory(LocalManagedConnectionFactory.java:90) [:6.0.0.Final]
      at org.jboss.resource.connectionmanager.ConnectionFactoryBindingService.createConnectionFactory(ConnectionFactoryBindingService.java:141) [:6.0.0.Final]
      ... 79 more

      The root cause is that the code ends up calling the wrong method on ServiceBindingManger. Instead of calling the getStringBinding with 2 parameters, it ends up calling the getStringBinding with just the single (service name) parameter.

      The code which parses the parameters, is in org.jboss.system.metadata.ServiceMetaDataParser:

      private ServiceValueMetaData parseValueFactory(Element el) throws Exception
      {
      ...
      List<ServiceValueFactoryParameterMetaData> parameters = new ArrayList<ServiceValueFactoryParameterMetaData>();
      attr = el.getAttributeNode("parameter");
      if (attr != null)

      { parameters.add(new ServiceValueFactoryParameterMetaData(attr.getValue())); }

      else
      {
      NodeList children = el.getChildNodes();
      for (int j = 0; j < children.getLength(); j++)
      {
      // skip over non-element nodes
      if (children.item(j).getNodeType() != Node.ELEMENT_NODE)
      continue;

      Element child = (Element) children.item(j);
      if ("parameter".equals(child.getTagName()))

      { parameters.add(parseValueFactoryParameter(child)); }

      }
      }
      ....

      The code never enters the else part for that above xml configuration. I haven't looked into the details of that getAttributeNode API, but it appears like a bug to me in the xerces impl (i might be wrong), since "parameter" isn't really an attribute.

      Assigning this to Ales for now, since that class lies within jboss-jmx-mc-int project.

              ajustin@redhat.com Ales Justin
              jaikiran Jaikiran Pai (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: