Errors validating jboss-ejb3.xml
--------------------------------
Key: JBIDE-21943
URL:
https://issues.jboss.org/browse/JBIDE-21943
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: upstream
Affects Versions: 4.3.0.Final
Reporter: Bartosz Spyrko-Ĺmietanko
Assignee: Rob Stryker
Priority: Minor
Fix For: 4.3.1.CR1
Trying to include urn:trans-timeout element in jboss-ejb3.xml leads to a validation
failure:
{noformat}
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.
{noformat}
and a warning:
{noformat}
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.
{noformat}
Example jboss-ejb3.xml file:
{noformat}
<?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>
{noformat}
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