Created attachment 1119041 [details] Screen shot of this issue. Description of problem: Create "jboss-ejb3.xml" in JBDS 8.0.0 based on document: ~~~ https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Development_Guide/sect-Reference2.html#jboss-ejb3xml_Deployment_Descriptor_Reference ~~~ After that, validation errors shows, see attachment "jbossejb3ValidationError.jpg". Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Validation errors. Expected results: No errors. Additional info: We found solution to safely ignoring this error, but customer is working on a large application, he need this function work and the document above isn't actually a complete reference for jboss-ejb3.xml to be a instruction guide.
This is a documentation issue. The jboss:ejb-jar does not support enterprise-beans from the http://java.sun.com/xml/ns/javaee namespace. See also https://github.com/jboss/metadata/blob/master/ejb/src/test/resources/org/jboss/metadata/ejb/test/ejbthree936/jboss-ejb3.xml
Carlo: You say "The jboss:ejb-jar does not support enterprise-beans from the http://java.sun.com/xml/ns/javaee namespace." What namespace should they use? When I look through the JBoss EAP source testsuite, I see lots of jboss-ejb3.xml files containing that namespace, for example: <?xml version="1.0"?> <jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee" xmlns="http://java.sun.com/xml/ns/javaee" 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://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" version="3.1" impl-version="2.0"> <enterprise-beans> ... </enterprise-beans> </jboss:ejb-jar> $ grep 'xmlns="http://java.sun.com/xml/ns/javaee"' `find . -name 'jboss-ejb3.xml'` ./testsuite/integration/iiop/src/test/java/org/jboss/as/test/iiop/transaction/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/iiop/src/test/java/org/jboss/as/test/iiop/basic/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/iiop/src/test/java/org/jboss/as/test/iiop/security/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ws/serviceref/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/security/xacml/testobjects/config/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" xmlns:s="urn:security" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/stateless/pooling/ejb2/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/descriptor/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/iiop/naming/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/timerservice/database/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/management/deployments/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/transaction/cmt/timeout/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/security/jbossappxml/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/security/callerprincipal/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/security/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/security/rolelink/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/security/runas/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/security/runas/mdb/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/mdb/deliveryactive/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/mdb/ejb2x/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/mdb/messagedestination/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/servlet/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/pool/override/jboss-ejb3.xml:<jboss xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/ejb2/reference/annotation/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee" ./testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ee/injection/resource/resourceref/jboss-ejb3.xml: xmlns="http://java.sun.com/xml/ns/javaee"
Actually I'm wrong. The jboss:ejb-jar element supports both javaee:enterprise-beans and jboss:enterprise-beans. So this is a bug in JBDS. As a work-around you can keep using jboss:enterprise-beans element.
Carlo, In chat, you mentioned that IDEA shows the same error, so I am not convince that this is a JBDS issue. This is not a documentation issue. Where does it belong?
To avoid confusion with the doc team, I am moving this issue back to the EJB component until the correct location is decided.
Looks like it's problem with jboss-ejb3-2_0.xsd as described here https://issues.jboss.org/browse/WFLY-3189 Fix is already pushed to jboss/metadata repo but did not make it to public web location https://issues.jboss.org/browse/WFLY-3891 It's not problem of JBDS the same issue is with plain Eclise. As workarround user can remove "http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd" entry from xsi:schemaLocation attribute If it's not ok for user I can try to find how to make it working with Eclipse probably altering Eclipse xml catalogue I would guess.
1. Schema changes should not be made after a release. 2. JBDS should use schema's from the release. The schema location is only a hint.
My comment here https://issues.jboss.org/browse/JBIDE-18316?focusedCommentId=13163713&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13163713 describe the issue. I deployed updated jboss-ejb3.xml to EAP and there were no errors. But new error has appeared in JBDS after jboss-ejb3.xml is changed: cvc-complex-type.2.4.a: Invalid content was found starting with element 'c:clustering'. One of '{"http://java.sun.com/xml/ns/javaee":security-role, "http://java.sun.com/xml/ns/javaee":method-permission, "http://java.sun.com/xml/ns/javaee":container-transaction, "http://java.sun.com/xml/ns/javaee":interceptor-binding, "http://java.sun.com/xml/ns/javaee":message-destination, "http://java.sun.com/xml/ns/javaee":exclude-list, "http://java.sun.com/xml/ns/javaee":application-exception, "http://java.sun.com/xml/ns/javaee":assembly-descriptor-entry}' is expected. Reason for this is missing XSD file for "urn:clustering:1.0" namespace. There was already PR to add this file to wildfly but was rejected because wildfly uses newer version of clustering "urn:clustering:1.1" as discussed here https://github.com/wildfly/wildfly/pull/6720. Once I added xsd file from this PR to JBDS XML catalog jboss-ejb3.xml file has no validation errors. EAP is not validating "urn:clustering:1.0" namespace via XSD file but using own parser https://github.com/wildfly/wildfly/blob/master/ejb3/src/main/java/org/jboss/as/ejb3/clustering/EJBBoundClusteringMetaDataParser.java#L64 Should I create PR adding xsd file for "urn:clustering:1.0" namespace to EAP 6.4.z, EAP 7 and Wildfly and BZ to update documentation or we should solve it different way? I will search a bit if this "schemaLocation" override in Eclipse is bug or standard XSD schema procesing
Since XSD for "urn:clustering:1.0" namespace is not actually used within EAP it's also possible to only add this XSD to JBDS catalog and update documentation without impact to EAP but It will mean validation for jboss-ejb3.xml will work only in JBDS without easy way to validate it in other IDE or CLI validator
Jira for JBDS created https://issues.jboss.org/browse/JBIDE-21717 together with PR fixing it
PR for JBDS is pushed please update documentation to contain jboss-ejb3.xml with this content without http://java.sun.com/xml/ns/javaee namespace schema location definition: <?xml version="1.1" encoding="UTF-8"?> <jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="urn:clustering:1.0" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd" version="3.1" impl-version="2.0"> <enterprise-beans> <message-driven> <ejb-name>ReplyingMDB</ejb-name> <ejb-class>org.jboss.as.test.integration.ejb.mdb.messagedestination.ReplyingMDB</ejb-class> <activation-config> <activation-config-property> <activation-config-property-name>destination</activation-config-property-name> <activation-config-property-value>java:jboss/mdbtest/messageDestinationQueue </activation-config-property-value> </activation-config-property> </activation-config> </message-driven> </enterprise-beans> <assembly-descriptor> <c:clustering> <ejb-name>DDBasedClusteredSFSB</ejb-name> <c:clustered>true</c:clustered> </c:clustering> </assembly-descriptor> </jboss:ejb-jar>
dmichael could you please update documentation as I described in commment #13
I can take this one.
This update is to the Development Guide.
Content is updated on the portal here: https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html-single/Development_Guide/index.html#jboss-ejb3xml_Deployment_Descriptor_Reference