[jboss-jira] [JBoss JIRA] (WFLY-3189) Error validating jboss-ejb3.xml.

Michael Hauke (JIRA) issues at jboss.org
Tue Sep 2 10:31:00 EDT 2014


    [ https://issues.jboss.org/browse/WFLY-3189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997860#comment-12997860 ] 

Michael Hauke commented on WFLY-3189:
-------------------------------------

I managed to get Eclipse validate an instance of "jboss-ejb3.xml" by modifying the JBoss Tools Eclipse plugin "org.jboss.tools.as.catalog_3.0.0.Beta3-v20140718-1832-B70.jar". I'll try to attach a patch containing the changes.

I added entries to "plugin.xml" for "http://www.jboss.com/xml/ns/javaee" and "urn:clustering:1.0" (we use the "clustering" element; I did not find a XSD for that in the plugin or the JBoss distribution), removed all schema locations in "schema" and "import" elements from "jboss-ejb3-2_0.xsd", "jboss-ejb3-spec-2_0.xsd", "jboss-ejb-security_1_0.xsd" (and "jboss-ejb-security_1_1.xsd) (all in schema/xsd) and added a "jboss-ejb-clustering_1_0.xsd" modeled after "jboss-ejb-security_1_0.xsd".

With that plugin Eclipse can validate a "jboss-ejb3.xml" instance but it still gets confused by "clustering" and "security" both being a "assembly-descriptor-entry". Whichever comes first is ok, whichever comes second is not.

I get around that with the "jboss-ejb3.xml" instance using another XSD which pulls in the others.

This XSD looks like:

{quote}
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.jboss.com/xml/ns/javaee" xmlns="http://www.jboss.com/xml/ns/javaee"
    xmlns:javaee="http://java.sun.com/xml/ns/javaee" elementFormDefault="qualified"
    attributeFormDefault="unqualified" version="2.0">
    <xs:include schemaLocation="http://www.jboss.com/xml/ns/javaee" />
    <xs:import namespace="http://java.sun.com/xml/ns/javaee" />
    <xs:import namespace="urn:clustering:1.0" />
    <xs:import namespace="urn:security" />
</xs:schema>
{quote]

My "jboss-ejb3.xml" instance looks like:

{quote}
<?xml version="1.0" encoding="UTF-8"?>
<jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:c="urn:clustering:1.0"
    xmlns:s="urn:security" version="3.1" impl-version="2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee jboss-ejb-jar.xsd">
    <assembly-descriptor>
        <s:security>
            <ejb-name>*</ejb-name>
            <s:security-domain>someDomain</s:security-domain>
            <s:run-as-principal>somePrincipal</s:run-as-principal>
        </s:security>
        <c:clustering>
            <ejb-name>SomeBean</ejb-name>
            <c:clustered>true</c:clustered>
        </c:clustering>
    </assembly-descriptor>
</jboss:ejb-jar>
{quote}

> Error validating jboss-ejb3.xml.
> --------------------------------
>
>                 Key: WFLY-3189
>                 URL: https://issues.jboss.org/browse/WFLY-3189
>             Project: WildFly
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: EJB
>    Affects Versions: 8.0.0.Final
>         Environment: WildFly 8.0.0.Final
>            Reporter: shinzey shinzey
>            Assignee: David Lloyd
>
> I'm trying to configure code completion for jboss-ejb3.xml with schema, but fail to do that due to the following validation error:
> {noformat}
> src-resolve: Cannot resolve the name 'javaee:jboss-ejb-beanType' to a(n) 'type definition' component. [33]
> src-resolve: Cannot resolve the name 'javaee:jboss-ejb-jarType' to a(n) 'type definition' component. [35]
> src-resolve: Cannot resolve the name 'javaee:jboss-enterprise-beansType' to a(n) 'type definition' component. [37]
> src-resolve: Cannot resolve the name 'javaee:assembly-descriptor-entry' to a(n) 'element declaration' component. [35]
> src-resolve: Cannot resolve the name 'javaee:jboss-assembly-descriptor-bean-entryType' to a(n) 'type definition' component. [39]
> {noformat}
> The jboss-ejb3.xml is quite simple:
> {code:xml}
> <?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:s="urn:security:1.1"
>                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd
>                                    http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd">
>     <assembly-descriptor>
>         <s:security>
>             <ejb-name>*</ejb-name>
>             <s:security-domain>testsd</s:security-domain>
>         </s:security>
>     </assembly-descriptor>
> </jboss:ejb-jar>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the jboss-jira mailing list