]
Rob Stryker updated JBIDE-20701:
--------------------------------
Fix Version/s: LATER
(was: 4.4.x)
Bulk move all schema issues to 'LATER' because they take a lot of time to
re-verify and they rarely make any progress. :|
[eap7 quickstarts] Eclipse Errors validating
jboss-ejb-security-interceptors quickstart
---------------------------------------------------------------------------------------
Key: JBIDE-20701
URL:
https://issues.jboss.org/browse/JBIDE-20701
Project: Tools (JBoss Tools)
Issue Type: Sub-task
Components: server, upstream
Affects Versions: 4.3.0.CR1
Reporter: Rob Stryker
Labels: xml_validation_quickstart_content, xml_validation_quickstarts_eap7,
xml_validation_schema_error
Fix For: LATER
Attachments: 20529_security_interceptors_1.png
The above quickstart's file jboss-ejb3.xml indicates two errors. The first error
seems to be a problem with the upstream / online schema, and I'm not sure if this is
fixable in the quickstart or not. The second error may either be an error in the
quickstart, or an error in the xsds, or, possibly, an error in eclipse validation. I am
having trouble figuring out which.
*Error 1:*
Referenced file contains errors
(jar:file:/home/rob/apps/eclipse/builds/mars_sr1_w_jbt/eclipse/plugins/
org.jboss.tools.as.catalog_3.1.0.CR1-v20150911-0311-B31.jar!/schema/xsd/jboss-ejb3-spec-2_0.xsd).
Further details can be seen in attachment "20529_security_interceptors_1.png",
*Error 2:*
The current file in the quicksttarts has the following content:
{code}
<jee:assembly-descriptor>
<ci:container-interceptors>
<jee:interceptor-binding>
<ejb-name>IntermediateEJB</ejb-name>
<interceptor-class>org.jboss.as.quickstarts.ejb_security_interceptors.ServerSecurityInterceptor</interceptor-class>
</jee:interceptor-binding>
// removed 2nd for brevity
</ci:container-interceptors>
</jee:assembly-descriptor>
{code}
There are a few noted problems here.
1) Validation insists that one jee:ejb-name element must live inside the
container-interceptors but before the interceptor-binding. This basically means that that
set of container-interceptors is only valid for one ejb.
2) Validation also insists that ANOTHER jee:ejb-name ALSO live INSIDE the
interceptor-binding
3) If you have multiple interceptor bindings, only the first must have a jee:ejb-name
OUTSIDE of it.
After a lot of spit-balling, the only valid xml I've managed to come up with that
validates properly is:
{code}
<jee:assembly-descriptor>
<ci:container-interceptors>
<jee:ejb-name>IntermediateEJB</jee:ejb-name>
<ci:interceptor-binding>
<jee:ejb-name>IntermediateEJB</jee:ejb-name>
<jee:interceptor-class>org.jboss.as.quickstarts.ejb_security_interceptors.ServerSecurityInterceptor</jee:interceptor-class>
</ci:interceptor-binding>
</ci:container-interceptors>
<ci:container-interceptors>
<jee:ejb-name>SecuredEJB</jee:ejb-name>
<ci:interceptor-binding>
<jee:ejb-name>SecuredEJB</jee:ejb-name>
<jee:interceptor-class>org.jboss.as.quickstarts.ejb_security_interceptors.ServerSecurityInterceptor</jee:interceptor-class>
</ci:interceptor-binding>
</ci:container-interceptors>
</jee:assembly-descriptor>
{code}
You'll note there's a lot more namespacing going on in the elements, and that we
now have two container-interceptors as opposed to one, because both are for different
EJBs. You'll also note that the ejb-name must be declared twice, or else validation
fails. This is most likely an error in the heirarchy / nesting of the xsd's, but I am
not an expert in that regard.
So the above xml would be a good workaround for the quickstarts. Any other fix would
require investigation of the xsd's by someone more qualified than I am.