Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-21943

Errors validating jboss-ejb3.xml

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • 4.3.1.CR1
    • 4.3.0.Final
    • upstream
    • None

      Trying to include urn:trans-timeout element in jboss-ejb3.xml leads to a validation failure:

      cvc-complex-type.2.4.a: Invalid content was found starting with element 'tx:trans-timeout'. One of '{"http://java.sun.com/xml/ns/javaee":container-transaction-entry}' is expected.
      

      and a warning:

      cvc-complex-type.2.4.a: Invalid content was found starting with element 'tx:trans-timeout'. One of '{"http://java.sun.com/xml/ns/javaee":container-transaction-entry}' is expected.
      

      Example jboss-ejb3.xml file:

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss:ejb-jar version="3.1" impl-version="2.0"
                     xmlns="http://java.sun.com/xml/ns/javaee"
                     xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
                     xmlns:tx="urn:trans-timeout"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="
                      http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd
                      http://java.sun.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-spec-2_0.xsd
                      urn:trans-timeout http://www.jboss.org/j2ee/schema/trans-timeout-1_0.xsd
                      " >
          <assembly-descriptor>
          <container-transaction>
          	<description>foobar</description>
          	<method>
          		<ejb-name>foobar</ejb-name>
          		<method-name>foobar</method-name>
          	</method>
          	<trans-attribute>Supports</trans-attribute>
              <tx:trans-timeout>
              	<tx:timeout>100</tx:timeout>
              	<tx:unit>Seconds</tx:unit>
              </tx:trans-timeout>
          </container-transaction>
          </assembly-descriptor>
      </jboss:ejb-jar>
      

      I think the issue might be related to how Eclipse matches the entries in XML Catalog - giving priority to schemaLocation over namespace match [1]. Since the trans-transactions schema is only referenced via urn:trans-timeout namespace in the catalog, Eclipse tries to download it from jboss.org, fails and never uses the version shipped with Tools.

      [1] https://wiki.eclipse.org/Using_the_XML_Catalog#FAQ

            rob.stryker Rob Stryker (Inactive)
            spyrkob Bartosz Spyrko-Smietanko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: