4 Replies Latest reply on Oct 16, 2017 12:49 PM by nihag

    JBoss + Struts 2 TLD issue

    davehz

      Hi,

      I'm trying to deploy Struts 2 on JBoss but I would like to keep the struts2 jar inside the server lib directory instead of WEB-INF/lib so that many apps can share it . . .
      When I do this, the struts2 JAR's classes are loaded and my application deploys successfully. The action servlet is called and runs successfully and forwards to a JSP. However, the JSP cannot be loaded because the struts TLD file cannot be found (see log below). The struts TLD is in the Struts 2 Core jar. How can I have my app search in the JAR for the TLD?

      Thanks in Advance,

      Dave

      LOG:
      > ....
      > 2008-06-23 17:12:49,085 DEBUG
      > [com.opensymphony.xwork2.util.InstantiatingNullHandler] Entering
      > nullPropertyValue
      >[target=[com.lehman.corpsec.web.UpdateDailyCheckoutStatusXMLServlet@15
      > 0b 99d, com.opensymphony.xwork2.DefaultTextProvider@162ac83],
      > property=org]
      > 2008-06-23 17:12:49,280 DEBUG
      > [org.jboss.web.tomcat.service.jasper.TagLibCache] Scanning for tlds in:
      > file:/home/nycco2q/jboss/eap4.2/deploy/jboss-web.deployer/jsf-libs/jsf
      > -i
      > mpl.jar
      > 2008-06-23 17:12:49,420 DEBUG
      > [org.jboss.web.tomcat.service.jasper.TagLibCache] Scanning for tlds in:
      > file:/home/nycco2q/jboss/eap4.2/deploy/jboss-web.deployer/jstl.jar
      > 2008-06-23 17:12:49,513 ERROR
      > [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/CO2/
      > Da ilyCheckout].[jsp]] Servlet.service() for servlet jsp threw
      > exception
      > org.apache.jasper.JasperException: File "/struts-tags" not found
      > at
      > org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHa
      > nd
      > ler.java:51)

        • 1. Re: JBoss + Struts 2 TLD issue
          peterj

          Not sure if this would work, but try placing the struts2 jar file in jboss-web.deployer or jboss-web.deployer/jsf-libs (possibly in addition to having it at server/xxx/lib).

          If that doesn't work, looks like you will be stuck placing it into web-inf/lib.

          • 2. Re: JBoss + Struts 2 TLD issue
            davehz

            Thanks for the reply, Peter.

            I'm working in an enterprise environment, so we're not supposed to be touching the jboss-web.deployer directory.

            What I'm trying to get a feel for is, what determines where JBoss will search for the TLD file. Is there a setting for the server, something for web.xml, an environment variable (CLASSPATH?) that determines where it will look, or is it just always looking in the jboss-web.deployer directory and nowhere else?

            • 3. Re: JBoss + Struts 2 TLD issue
              peterj

              As far as I know, the only place where TLDs are looked for is WEB-INF/lib. Because the log entries you posted showed that the jboss-web.deployer was also being scanned (which makes sense because that is where the JSP-related TLDs reside) I suggested placing the JARs there. I know of no setting where you could specify a "tldpath". Obviously the standard class locations are not checked of it would have found the TLD in the jar in the server/xxx/lib directory.

              • 4. Re: JBoss + Struts 2 TLD issue
                nihag

                Have you fixed this issue?...please let me know. Thanks