1 2 Previous Next 15 Replies Latest reply on Apr 1, 2015 4:09 AM by chaitanyacsk

    JBAS-8579 not (completely) solved?

    feijtel

      Hello,

       

      This morning I've downloaded the new JBoss AS 6.0.0 final.

       

      In this version the bug JBAS-8579 is supposed to be resolved. However, running my Struts application still gives the same NPE on the html:link tag, which is part of the Struts framework. For reference, this is a link to JBAS-8579:

       

      https://issues.jboss.org/browse/JBAS-8579?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aworklog-tabpanel

       

      The only difference I can see is that our html:link tag that gives the NPE does contain a body:

       

      <html:link page="/MenuAction.do" paramName="menuItem" paramId="id" paramProperty="id" styleClass="smallDBlue">
          <bean:write name="menuItem" property="label"/>
      </html:link>

       

      Here's the stacktrace:

       

      [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/CiVMK].[jsp]] Servlet.service() for servlet jsp threw exception: java.lang.NullPointerException
          at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1598) [:6.0.0.Final]
          at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:976) [:6.0.0.Final]
          at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1247) [:6.0.0.Final]
          at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1421) [:6.0.0.Final]
          at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1633) [:6.0.0.Final]
          at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:976) [:6.0.0.Final]
          at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1247) [:6.0.0.Final]
          at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1421) [:6.0.0.Final]
          at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1633) [:6.0.0.Final]
          at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:976) [:6.0.0.Final]
          at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1247) [:6.0.0.Final]
          at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1421) [:6.0.0.Final]
          at org.apache.jasper.compiler.Parser.parse(Parser.java:130) [:6.0.0.Final]
          at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255) [:6.0.0.Final]
          at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103) [:6.0.0.Final]
          at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:196) [:6.0.0.Final]
          at org.apache.jasper.compiler.Compiler.compile(Compiler.java:358) [:6.0.0.Final]
          at org.apache.jasper.compiler.Compiler.compile(Compiler.java:338) [:6.0.0.Final]
          at org.apache.jasper.compiler.Compiler.compile(Compiler.java:325) [:6.0.0.Final]
          at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:607) [:6.0.0.Final]
          at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312) [:6.0.0.Final]
          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [:6.0.0.Final]
          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [:6.0.0.Final]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
          at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [:6.0.0.Final]
          at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:639) [:6.0.0.Final]
          at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:576) [:6.0.0.Final]

       

      Checking the source code, it appears to be this line of code causing the NPE. The bodyType seems to be null:

       

      if (bodyType.equalsIgnoreCase(TagInfo.BODY_CONTENT_TAG_DEPENDENT)) {

       

       

      Hopefully someone can give me confirmation this bug isn't completely solved or tell me where I'm doing something wrong.

       

      We are trying to port a Struts 1.2 application that has been running on JBoss 4 to the new JBoss 6.0.0 final.

       

      Regards

       

      Leon Feijtel

        • 1. Re: JBAS-8579 not (completely) solved?
          feijtel

          I've found the problem that was causing this issue.

           

          As stated in my first post, we are using Struts 1.2. And the problem occurs due to a taglib definition problem in Struts.

           

          In the tablib definition file struts-html.tld, there is no <bodycontent> tag for the html:link tag. This causes the NPE in the Jasper Parser class.

          • 2. Re: JBAS-8579 not (completely) solved?
            dthompsn

            I have to concur that this is still an issue. I have a Struts 1.2 app that when the struts.tld file is loaded, I get the exact same parse error running 6.0.0 Final.

            • 3. Re: JBAS-8579 not (completely) solved?
              jaikiran
              1 of 1 people found this helpful
              • 4. Re: JBAS-8579 not (completely) solved?
                dthompsn

                Could you change the status of the bug 8579 to not say resolved in 6.0.0.FINAL? Maybe change it to 6.0.1?

                • 5. JBAS-8579 not (completely) solved?
                  skotinin

                  Hello!

                  Will this is fixed in 6.1.0?

                  • 6. JBAS-8579 not (completely) solved?
                    javacoryd

                    Has this been fixed in any version of JBoss 6?

                     

                    Thanks,

                     

                    Cory.

                    • 7. JBAS-8579 not (completely) solved?
                      gcp0703

                      My understanding is that it *is* fixed but the only way to get it currently is in a nightly build until the next release.

                      • 8. JBAS-8579 not (completely) solved?
                        javacoryd

                        Thanks,

                         

                        I'm trying to find the source for the org.apache.jasper.compiler.Parser, but everything I find is org.jboss.  We are basically at a roadblock without this fix.

                         

                        Cory.

                        • 9. JBAS-8579 not (completely) solved?
                          gcp0703

                          It's a huge issue for anyone using Struts, which I believe is a pretty big base of users. I had to give up and go back to 5.1.

                           

                          Good luck!

                          • 10. Re: JBAS-8579 not (completely) solved?
                            feijtel

                            Cory, as I mentioned in one of my earlier posts: In the tablib definition file struts-html.tld, there is no <bodycontent> tag for the html:link tag. This causes the NPE in the Jasper Parser class.

                             

                            We solved this (for now) by adjusting the taglib definition files and manually add a <bodycontent> tag.

                             

                            So e.g. the html tag looked like this:

                             

                            <tag>

                              <name>html</name>

                              <tagclass>org.apache.struts.taglib.html.HtmlTag</tagclass>

                              <attribute>

                                <name>locale</name>

                                <required>false</required>

                                <rtexprvalue>true</rtexprvalue>

                              </attribute>

                              <attribute>

                                 ...

                              </attribute>

                            </tag>

                             

                            and we changed that into:

                             

                            <tag>

                              <name>html</name>

                              <tagclass>org.apache.struts.taglib.html.HtmlTag</tagclass>

                              <bodycontent>JSP</bodycontent>

                              <attribute>

                                <name>locale</name>

                                <required>false</required>

                                <rtexprvalue>true</rtexprvalue>

                              </attribute>

                              <attribute>

                                 ...

                              </attribute>

                            </tag>

                             

                            This prevents the Jasper compiler from giving an exception, since the main issue is that there was no bodycontent tag. An alternative solution could be looking at Struts 1.3, in which these taglibs do have a bodycontent tag.

                             

                            Hope this can help you solve your problem.

                            • 11. Re: JBAS-8579 not (completely) solved?
                              jaikiran

                              Cory Dahlstrom wrote:

                               

                              Thanks,

                               

                              I'm trying to find the source for the org.apache.jasper.compiler.Parser, but everything I find is org.jboss.  We are basically at a roadblock without this fix.

                               

                              Cory.

                              Is this still an issue in the nightly AS6 snapshots http://community.jboss.org/thread/161386 ?

                              • 12. JBAS-8579 not (completely) solved?
                                javacoryd

                                Thanks Leon!

                                • 13. JBAS-8579 not (completely) solved?
                                  yguobin

                                  Thanks Leon, I made changes to tld files and re-zipped the jar file and posted it here, anybody needs it please go there and download.

                                  • 14. Re: JBAS-8579 not (completely) solved?
                                    tc7

                                    This problem is affecting our moving to JBoss 6.0.0.Final.

                                     

                                    Thanks for the fix Leon, however this is difficult to debug when the problem occurs in an included jspf. Basically all trace information is swallowed, with a stack trace simply:

                                     

                                    16:52:11,337 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MyApp].[jsp]] Servlet.service() for servlet jsp threw exception: org.apache.jasper.JasperException: /myapp/myaction.do

                                     

                                    Servlet.service() for servlet jsp threw exception: org.apache.jasper.JasperException: /myapp/MyTest.jsp(27,0) /myapp/include/MyAppDetail.jspf(451,5) null

                                            at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) [:6.0.0.Final]

                                            at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) [:6.0.0.Final]

                                            at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88) [:6.0.0.Final]

                                            at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:300) [:6.0.0.Final]

                                            at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:333) [:6.0.0.Final]

                                            at org.apache.jasper.compiler.Parser.parseXMLDirective(Parser.java:506) [:6.0.0.Final]

                                     

                                    Where the line number simply points to the jsp include directive in the parent page.

                                     

                                    frustrating.

                                    1 2 Previous Next