9 Replies Latest reply on Mar 10, 2006 5:10 AM by henkomannen

    Problems with JSP and Tag Libraries in JBoss using Tomcat 5.

    henkomannen

      Hi,

      I am experiencing a really weird situation here. When running a deployed EJB3 ear application in a JBoss 4.0.3sp1 application using Tomcat service 5.5.9, Jasper is unable to compile any JSP file using Tag Libraries. To be more precise, when generating the Java source file (looking in the 'work' directory) everything in the file after the first occurance of a Tag Library usage is commented out (with "//"), causing the Java source to be invalid and outputs an error when accessing the page via a browser saying:

      "org.apache.jasper.JasperException: Unable to compile class for JSP

      Generated servlet error:
      Syntax error, insert "}" to complete ClassBody

      Generated servlet error:
      Syntax error, insert "}" to complete Block

      Generated servlet error:
      Syntax error, insert "finally" to complete TryStatement

      Generated servlet error:
      Syntax error, insert "}" to complete MethodBody"

      etc... where every error row is a suggestion of steps to take to make the source file valid. (of course).

      The Tag Library jar files are located in the web application WEB-INF/lib folder as they should be. The descriptive Tag Library Definition files (tld:s) are located in the WEB-INF folder and every JSP file references these tld files directly via this path (WEB-INF/).

      Any hints are most appreciated!!

      Cheers!
      /Henrik

        • 1. Re: Problems with JSP and Tag Libraries in JBoss using Tomca
          j2ee_junkie

          Good day Henrik,

          It has been a long while since I messed with tag libraries, but I recall two options. If your tag lib jar was stored in WEB-INF/lib and if this jar contained the tlds for thos tags, then the war deployer would automatically make the tags available to your JSP's. However, if your jars do not have the tlds packaged(supplying them outside the jar such as your case), then you must declare the tag libraries in the web.xml file for your app before you can use them. Have you done this?

          cgriffith

          • 2. Re: Problems with JSP and Tag Libraries in JBoss using Tomca
            henkomannen

             

            "j2ee_junkie" wrote:
            Good day Henrik,

            It has been a long while since I messed with tag libraries, but I recall two options. If your tag lib jar was stored in WEB-INF/lib and if this jar contained the tlds for thos tags, then the war deployer would automatically make the tags available to your JSP's. However, if your jars do not have the tlds packaged(supplying them outside the jar such as your case), then you must declare the tag libraries in the web.xml file for your app before you can use them. Have you done this?

            cgriffith


            Thank you for your answer, Junkie! :)

            Yes, in fact, the tld:s are residing _both_ in the .jar files and in the /WEB-INF/ folder. And yes, they are declared in the web.xml pointing at those tlds in the /WEB-INF/ folder. Perhaps this is not the way to do it, to have them in both locations?

            • 3. Re: Problems with JSP and Tag Libraries in JBoss using Tomca
              j2ee_junkie

              After looking into this a bit further, If the tlds are in the jars, as in your case, then do not include the tlds in WEB-INF/ directory and do not use the tag-lib element in your web.xml. However, in each jsp page, use the taglib element where the uri is exactly the same as the uri delcared in the tld.

              Hope this helps, cgriffith

              • 4. Re: Problems with JSP and Tag Libraries in JBoss using Tomca
                henkomannen

                Thank you, cgriffith!

                I have too read about this and I'll try it and get back with a result.

                • 5. Re: Problems with JSP and Tag Libraries in JBoss using Tomca
                  henkomannen

                  Modified all jsp pages to contain uri's exactly matching the uri's in the bundled jar's tlds. Removed the tlds in the /WEB-INF/ folder and also commented the tld declarations in the web.xml file.

                  Still, the same problem occurs. :-/

                  Here is the stacktrace:

                  14:32:56,062 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
                  org.apache.jasper.JasperException: Unable to compile class for JSP

                  Generated servlet error:
                  Syntax error, insert "}" to complete ClassBody

                  Generated servlet error:
                  Syntax error, insert "}" to complete Block

                  Generated servlet error:
                  Syntax error, insert "Finally" to complete TryStatement

                  Generated servlet error:
                  Syntax error, insert "}" to complete MethodBody


                  at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
                  at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
                  at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
                  at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
                  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
                  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
                  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
                  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
                  at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
                  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
                  at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
                  at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
                  at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
                  at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:302)
                  at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
                  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
                  at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
                  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
                  at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
                  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
                  at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
                  at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
                  at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
                  at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
                  at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
                  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
                  at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at se.infogate.axessity.web.filters.UTF8EncodingFilter.doFilter(UTF8EncodingFilter.java:35)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                  at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
                  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
                  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
                  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
                  at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                  at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                  at java.lang.Thread.run(Thread.java:595)
                  14:32:56,066 ERROR [[action]] Servlet.service() for servlet action threw exception
                  org.apache.jasper.JasperException: Unable to compile class for JSP

                  Generated servlet error:
                  Syntax error, insert "}" to complete ClassBody

                  Generated servlet error:
                  Syntax error, insert "}" to complete Block

                  Generated servlet error:
                  Syntax error, insert "Finally" to complete TryStatement

                  Generated servlet error:
                  Syntax error, insert "}" to complete MethodBody


                  at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
                  at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
                  at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
                  at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
                  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
                  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
                  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
                  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
                  at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
                  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
                  at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
                  at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
                  at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
                  at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:302)
                  at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
                  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
                  at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
                  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
                  at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
                  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
                  at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
                  at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
                  at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
                  at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
                  at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
                  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
                  at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at se.infogate.axessity.web.filters.UTF8EncodingFilter.doFilter(UTF8EncodingFilter.java:35)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                  at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
                  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
                  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
                  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
                  at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                  at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                  at java.lang.Thread.run(Thread.java:595)
                  14:32:56,069 ERROR [[action]] Servlet.service() for servlet action threw exception
                  org.apache.jasper.JasperException: Unable to compile class for JSP

                  Generated servlet error:
                  Syntax error, insert "}" to complete ClassBody

                  Generated servlet error:
                  Syntax error, insert "}" to complete Block

                  Generated servlet error:
                  Syntax error, insert "Finally" to complete TryStatement

                  Generated servlet error:
                  Syntax error, insert "}" to complete MethodBody


                  at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
                  at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
                  at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
                  at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
                  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
                  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
                  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
                  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
                  at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
                  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
                  at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
                  at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
                  at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
                  at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:302)
                  at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
                  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
                  at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
                  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
                  at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
                  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
                  at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
                  at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
                  at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
                  at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
                  at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
                  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
                  at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at se.infogate.axessity.web.filters.UTF8EncodingFilter.doFilter(UTF8EncodingFilter.java:35)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                  at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
                  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
                  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
                  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
                  at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                  at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                  at java.lang.Thread.run(Thread.java:595)

                  Confused on a quite high level. :-S

                  Cheers
                  /Henrik

                  • 6. Re: Problems with JSP and Tag Libraries in JBoss using Tomca
                    j2ee_junkie

                    I probably won't be much more help to you after this, but I notice you are using Tiles. Double check your tiles conf file(s) and your use of tiles tags.

                    Sorry, I can't be of more help, cgriffith

                    • 7. Re: Problems with JSP and Tag Libraries in JBoss using Tomca
                      henkomannen

                      Thanks for your ideas anyway, cgriffith.

                      I have checked my tiles configuration file and the usage of the tiles tags are correct.

                      The thing is... In the scenes behind the web application I have a business tier written using EJB3 that is contacting a product from Juniper called SDX (the 6.2.1 version of this product). The contact with this SDX software can either be configured to be done in a "local" or a "distributed" way, where the distributed configuration works through a so called nic proxy to reach a Service Engine and the local configuration works directly against this Engine through CORBA.

                      When using the local configuration the web application works like a charm and compiles the JSP pages correctly, but when working with a distributed configuration the same JSP pages won't compile. It is really no problem with the proxy contact when using any of the configuration types as we can read data from the SDX system without any problem.

                      It feels really weird that something like this should cause any JSP compilation errors... but maybe there is a connection that I can't see, after all.

                      I'm thinking of going for JSP precompilation in JBoss IDE 1.5? Does anyone know if this is possible today?

                      /Henrik

                      • 8. Re: Problems with JSP and Tag Libraries in JBoss using Tomca
                        henkomannen

                         

                        "HenkoMannen" wrote:

                        The thing is... In the scenes behind the web application ...


                        Well... behind the scenes, anyway. :D

                        • 9. Re: Problems with JSP and Tag Libraries in JBoss using Tomca
                          henkomannen

                          I have still got problems with compiling java source files from my jsp pages, still trying to track down the root causing the problem.

                          When translating jsp files including tag libraries, the java source files will contain a line with the tag in question being commented out - clarification reason, I suppose - like this: (notice the // c:forEarch)

                          ...
                          private boolean _jspx_meth_c_forEach_0(javax.servlet.jsp.tagext.JspTag _jspx_th_html_select_0, PageContext _jspx_page_context)
                          throws Throwable {
                          PageContext pageContext = _jspx_page_context;
                          JspWriter out = _jspx_page_context.getOut();
                          // c:forEach
                          org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_forEach_0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _jspx_tagPool_c_forEach_var_items.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
                          _jspx_th_c_forEach_0.setPageContext(_jspx_page_context);
                          _jspx_th_c_forEach_0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_html_select_0);
                          _jspx_th_c_forEach_0.setVar("isp");
                          ...

                          This is a correct behavior. BUT, something strange happens when translating my jsp files. The code is not very nicely formatted but put on just a few lines which will cause more than just that tag line to be commented out, which in turn will cause the java source file to be incompilable.

                          Does anyone have any explanation to why there is no line breaks in my translated jsp files?

                          Here is an few snippets taken from an incorrectly translated file.

                          ***Beginning of file: (everything is on one line)***
                          package org.apache.jsp.templates;import javax.servlet.*;import javax.servlet.http.*;import javax.servlet.jsp.*;

                          ***Snippet from the content***
                          out.write(" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n"); out.write("\r\n"); // tiles:useAttribute org.apache.struts.taglib.tiles.UseAttributeTag _jspx_th_tiles_useAttribute_0 = (org.apache.struts.taglib.tiles.UseAttributeTag) _jspx_tagPool_tiles_useAttribute_scope_name_nobody.get(org.apache.struts.taglib.tiles.UseAttributeTag.class);

                          Thanks in advance!
                          /Henrik