4 Replies Latest reply on Feb 11, 2016 9:59 AM by wadmin78

    Wildfly 10 exploded deployment not finding classes

    wadmin78 Newbie

      Hello,

       

      We are trying to deploy an unmanaged and exploded app to Wildfly and are having trouble getting our libraries to be seen where our jsp pages are being compiled by jasper.   This is a legacy app where the jsp pages pages are exposed outside of the app.war which is structure we would like to continue with.  Our deployment system is CentOS 7, Wildfly 10 Final.  We are building our jars using eclipse using JDK 1.8 and Wildfly 10 libraries.  The test jars are error and warning free.  CentOS and java all set to UTF-8, iptables and Selinux temporarily disabled for testing.  Deployment is standalone.

       

      We have stripped down a test page and and small app library (jar) for testing, but must be missing something basic in the implementation.  We have tried placing a dependancy in MANIFEST.MF and also WEB-INF/jboss-deployment-structure.xml.  Jsp pages not requiring our libraries compile without error or warnings. 

       

      Unmanaged and exploded APP resides in a directory outside of /opt/wildfly/standalone/deployments.

       

      /APP

        | ----/jsp

        | ---- /APP.war

          |

          | --- /WEB-INF

                 |

                 | ---- /classes

                 | ---- /lib

       

      Server log messages show various attempts on finding the library:

       

      "TRACE [org.jboss.modules] (default task-2) Attempting to find resource {ourclass}.class in Module "deployment.APP.war:main" from Service Module Loader"

       

      Jasper Compile Messages

       

      BWEB004060: An error occurred at line: 4 in the jsp file: /jsp/test3.jsp testpkg.util.OLNK.getURI cannot be resolved to a type

       

      Our test jsp page is not not ideal jsp design in that it contains java code,  but represents some of the legacy pages that we will be migrating and upgrading.

       

      <%@ page contentType="text/html; charset=UTF-8" language="java" import="javax.servlet.*, testpkg.util.* " %>

      <%

       

      String request = "testdata";

       

      OLNK actionLink = new testpkg.util.OLNK.getURI(request);

       

      %>

       

      We have tried many variations the above example but are stumped.

       

      Any ideas?

       

      Thanks



        • 1. Re: Wildfly 10 exploded deployment not finding classes
          Tomaz Cerar Master

          so jsps are packed outside war?

          • 2. Re: Wildfly 10 exploded deployment not finding classes
            wadmin78 Newbie

            Thanks for the reply.  Yes, the jsps are outside of the APP.war, but inside the /APP directory.

            • 3. Re: Wildfly 10 exploded deployment not finding classes
              jaikiran pai Master

              wadmin78 wrote:

               

              Thanks for the reply.  Yes, the jsps are outside of the APP.war, but inside the /APP directory.

               

               

              This is the first time I'm seeing such deployment and I'm not even sure how the JSP will be accessible in such cases since it's not bound to a web context (unless of course your deployment has some other configurations that haven't been posted here). Anyway, what's the reason for putting those jsps outside of the .war instead of within the .war?

              • 4. Re: Wildfly 10 exploded deployment not finding classes
                wadmin78 Newbie

                In the existing legacy implementation the jsps are in this same structure outside the WEB-INF but inside the  APP directory tree. We know there is different opinions on exposing jsp URLs, but this is how the implementation is currently structured. Best case would be to migrate in a similar structure if possible.

                 

                With regards to the file hierarchy and placement of the jsps , from what we can tell, having the jsp outside of WEB-INF is consistent with the servlet 3.1 specifications for directory structure in section 10.5, and the example provided in 10.5.1 (JSR-000340 Java Servlet 3.1 Final Release for Evaluation )

                 

                10.5.1 example in servlet 3.1 doc:

                /index.html

                /howto.jsp

                /feedback.jsp

                /images/banner.gif

                /images/jumping.gif

                /WEB-INF/web.xml

                /WEB-INF/lib/jspbean.jar

                /WEB-INF/lib/catalog.jar

                !/METAINF/resources/catalog/moreOffers/books.html

                /WEB-INF/classes/com/mycorp/servlets/MyServlet.class

                /WEB-INF/classes/com/mycorp/util/MyUtils.class

                 

                Some additional set-up information,

                 

                standalone.xml

                <deployments>

                        <deployment name="APP.war" runtime-name="APP.war">

                            <fs-exploded path="/user/xxxx/APP"/>

                        </deployment>

                    </deployments>

                 

                jboss-web.xml:

                <jboss-web>

                   <context-root>/</context-root>

                </jboss-web>

                 

                no web.xml (seems to not be required per servlet 3.1)

                 

                Certainly open to input either way

                 

                Thanks..  John