0 Replies Latest reply on Mar 10, 2015 5:03 PM by Amit Naik

    metadata-complete=true not respected. How to prevent jar scanning in JBoss EAP 6.2/6.3?

    Amit Naik Newbie

      There seem to have been a few previous threads about this issue that are NOT answered:

      e.g.

      @https://developer.jboss.org/message/738126#738126@@

       

      setting a metadata-complete=true in the web.xml of your application with the version set to 2.5 should ensure that your application jars are NOT scanned by the JEE server environment for annotations.

      so the web.xml contains:

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app xmlns="http://java.sun.com/xml/ns/javaee" 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/web-app_2_5.xsd" version="2.5"

               id="WebApp_ID" metadata-complete="true">

       

      However JBoss AS 7.2 (and 7.3) still scans the WEB-INF/lib folder jars for annotations & complains when it cannot load some items etc.

       

      This leads to two issues:

      1) Slow downs due to large number of Jars

      2) Unnecessary errors due to annottaion scanning of Jars whose source we may not modify

       

      I am looking for a targeted way to suppress certain jars from the Scanning process.

       

      Things I have tried:

      metadata-complete=true in web.xml (ignored)

       

      Adding the following to the Web.xml

       

      <context-param> 

          <param-name>resteasy.scan</param-name>

          <param-value>false</param-value>

      </context-param> 

      <context-param>

          <param-name>resteasy.scan.providers</param-name>

          <param-value>false</param-value>

      </context-param> 

        <context-param>

          <param-name>resteasy.scan.resources</param-name>

          <param-value>false</param-value>

        </context-param>

       

      Also ignored

       

      using a jboss-scanning.xml file

      <?xml version="1.0" encoding="UTF-8"?>

      <scanning xmlns="urn:jboss:scanning:1.0">

          <path name="WEB-INF/lib/<name of my>.jar">

              <exclude name="" recurse="true" />

          </path>

      </scanning>

      (ignored)

       

      What does work in this context: jboss-deployment-structure.xml:

      <?xml version="1.0" encoding="UTF-8"?>

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">

        <deployment>

          <exclusions>

            <module name="webservices" />

          </exclusions>

        </deployment>

      </jboss-deployment-structure>

       

      However this will completely shutdown the JBoss Webservice stack and turn it into a servlet container. This is not the desired behavior.

       

      What is the official way to acheive the following is JBoss EAP 6.2/6.3 (JBoss AS 7.2 +):
      Have a bunch of jars in the Web-inf of a WAR file that are not processed by the annotation scanner?