jboss-app:moduleType should use jee:moduleType as a base
--------------------------------------------------------
Key: JBMETA-395
URL:
https://issues.jboss.org/browse/JBMETA-395
Project: JBoss Metadata
Issue Type: Bug
Components: ear
Reporter: Rob Stryker
Priority: Major
Fix For: 12.0.0.Final
While attempting to make a simple ear with a war and a service inside, we run into
several validation errors continuously. The following xml, for example, fails to
validate:
{code}
<?xml version="1.1" encoding="UTF-8"?>
<jboss-app version="6"
xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jbee="http://www.jboss.com/xml/ns/javaee"
xmlns:jee="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="
http://www.jboss.com/xml/ns/javaee
http://www.jboss.org/schema/jbossas/jboss-app_7_0.xsd">
<jee:display-name>Test</jee:display-name>
<jee:module>
<jee:web>
<jee:web-uri>myweb.war</jee:web-uri>
<jee:context-root>SomeRoot</jee:context-root>
</jee:web>
<jbee:service>bundled.sar</jbee:service>
</jee:module>
<jbee:distinct-name>MyDistinct</jbee:distinct-name>
</jboss-app>
{code}
The error is: cvc-complex-type.2.4.a: Invalid content was found starting with element
'jbee:service'. One of '{"http://
java.sun.com/xml/ns/javaee":alt-dd}' is expected.
Basically, a jbee:service does not belong inside a jee:module. However, trying to
declare jbee:module rather than jee:module fails because: cvc-complex-type.2.4.a:
Invalid content was found starting with element 'jbee:module'. One of
'{"http://
java.sun.com/xml/ns/javaee":display-name,
"http://java.sun.com/xml/ns/javaee":icon, "http://java.sun.com/
xml/ns/javaee":initialize-in-order,
"http://java.sun.com/xml/ns/javaee":module}' is expected.
In short, jbee:moduleType should probably be using jee:moduleType as a base.