2 Replies Latest reply on Jun 18, 2007 2:13 AM by raorama

    EAR Deployment, Third-party libraries and Struts

    kookoolen

      Hello everybody,

      I'm currently developing a J2EE software which uses EJB3 for the business layer and a web front-end to access and input data.
      I started developping the two modules separately and deploying them separately. It worked fine.

      Now, I want to package them in a single EAR file. Since they share third-party libraries, I put those libraries in the lib directory at the root of my EAR archive and declared those JARs int the MANIFEST of both the web module and the EJB module (but not in the EAR MANIFEST, should I ?).

      When deploying th EAR, the deployment goes well (no errors). That means third-party libraries are taken into account by the EJB module since it needs some of them at startup.

      The problem arises when accessing the web front-end. My web module uses the Struts framework. I tried two different packaging:

      - struts-core.jar and struts-taglibs.jar are in the WEB-INF/lib directory of my web module.
      Jasper throws a compilation exception with the following message:

      org.apache.jasper.JasperException: Unable to compile class for JSP
      
      Generated servlet error:
      The method _jspx_meth_bean_message_0(JspTag, PageContext) in the type index_jsp is not applicable for the arguments (HtmlTag, PageContext)
      
      Generated servlet error:
      The method _jspx_meth_html_base_0(JspTag, PageContext) in the type index_jsp is not applicable for the arguments (HtmlTag, PageContext)
      
      Generated servlet error:
      The method _jspx_meth_html_rewrite_0(JspTag, PageContext) in the type index_jsp is not applicable for the arguments (HtmlTag, PageContext)
      
      Generated servlet error:
      The method _jspx_meth_bean_message_1(JspTag, PageContext) in the type index_jsp is not applicable for the arguments (HtmlTag, PageContext)
      
      Generated servlet error:
      The method _jspx_meth_bean_write_0(JspTag, PageContext) in the type index_jsp is not applicable for the arguments (MessagesTag, PageContext)
      
      Generated servlet error:
      javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN cannot be resolved
      
      Generated servlet error:
      The method doAfterBody() is undefined for the type MessagesPresentTag
      
      Generated servlet error:
      javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN cannot be resolved
      

      The message is longer but they are all similar to the preceding.

      - struts-core.jar and struts-taglibs.jar are in the lib directory of the EAR archive and referenced in the classpath entry of the MANIFEST for the web module
      The web container throws an exception saying it can't find Struts TLDs nor in the web.xml, nor in the JARs packaged in the application.
      So I tried to extract Struts TLDs, put them in my WEB-INF and referencing them in my web.xml and then I get the same error than the first packaging solution I tried.

      I also tried to isolate the EAR classloading by setting true in the EAR deployer configuration but that way it can not even deploy my EAR.

      Thanks for your answers and for the great job you do,
      Sylvain

        • 1. Re: EAR Deployment, Third-party libraries and Struts
          jaikiran

           

          Now, I want to package them in a single EAR file. Since they share third-party libraries, I put those libraries in the lib directory at the root of my EAR archive and declared those JARs int the MANIFEST of both the web module and the EJB module (but not in the EAR MANIFEST, should I ?).


          The way i usually do this is by mentioning those jars in the application.xml (present in the META-INF of the ear file) files as follows:


          <module >
           <java>struts-taglibs.jar</java>
           </module>
          
           <module >
           <java>struts-core.jar</java>
           </module>
          


          and place these jar files directly inside the ear


          • 2. Re: EAR Deployment, Third-party libraries and Struts
            raorama

            The method _jspx_meth_bean_message_0(JspTag, PageContext) in the type OrderStatus_jsp is not applicable for the arguments (HtmlTag, PageContext)

            Dear friends,
            I too got the error message like the above. For me the servlet.jar file in web-inf/lib conflicted with the one used by JBoss. When i removed the servlet.jar from web-inf/lib it worked fine.

            Regards,
            Rama.