Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-20529 Master JIRA for XML Validation Problems
  3. JBIDE-20701

[eap7 quickstarts] Eclipse Errors validating jboss-ejb-security-interceptors quickstart

    XMLWordPrintable

Details

    Description

      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:

          <jee:assembly-descriptor>
              <ci:container-interceptors>
                  <jee:interceptor-binding>
                      <ejb-name>IntermediateEJB</ejb-name>
                      <interceptor-class&gt;org.jboss.as.quickstarts.ejb_security_interceptors.ServerSecurityInterceptor</interceptor-class&gt;
                  </jee:interceptor-binding>
                 // removed 2nd for brevity
              </ci:container-interceptors>
          </jee:assembly-descriptor>
      

      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:

      	    <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&gt;org.jboss.as.quickstarts.ejb_security_interceptors.ServerSecurityInterceptor</jee:interceptor-class&gt;
      	            </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&gt;org.jboss.as.quickstarts.ejb_security_interceptors.ServerSecurityInterceptor</jee:interceptor-class&gt;
      	            </ci:interceptor-binding>
      	        </ci:container-interceptors>
      	    </jee:assembly-descriptor>
      

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rob.stryker Rob Stryker (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: