3 Replies Latest reply on Apr 16, 2010 2:39 PM by jsipher

    NullPointer when executing JSP compiled page on JBoss AS 5.0

    Stefano Scamuzzo Newbie

      I get the following error when executing a JSP compiled page in JBoss AS 5.0.1 (never got in JBoss 4.x) :

      java.lang.NullPointerException
      at org.apache.jsp.WEB_002dINF.jsp.wapp.home_jsp._jspService(home_jsp.java:1261)

      here is the corresponding line code of the compiled JSP:

      1261 _jsp_instancemanager.newInstance(_jspx_th_spagobiwa_005fuserMenu_005f0);

      So I guess the _jsp_instancemanager is null. As far as I can get it should have been created in the _jspInit method of the servlet by the statement:

      _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());

      So probably the problem comes from there.

      Any configuration missing or something like that ?

        • 1. Re: NullPointer when executing JSP compiled page on JBoss AS
          Vicky Kak Master

           

          "spagobi" wrote:
          I get the following error when executing a JSP compiled page in JBoss AS 5.0.1 (never got in JBoss 4.x) :

          Paste the contents of the simple sample jsp here which will simulate the issue.

          • 2. Re: NullPointer when executing JSP compiled page on JBoss AS
            Charly Clairmont Newbie

            Hi All!

            Just to contribute on this trouble. The exception come from the call of a spapbi tag :

            <spagobiwa:userMenu viewTrackPath='<%=viewTrackPath%>'/>
            


            The generated java codes are :
             // spagobiwa:userMenu
             it.eng.spagobi.commons.presentation.tags.UserMenuTag _jspx_th_spagobiwa_005fuserMenu_005f0 = (new it.eng.spagobi.commons.presentation.tags.UserMenuTag());
             _jsp_instancemanager.newInstance(_jspx_th_spagobiwa_005fuserMenu_005f0);
             _jspx_th_spagobiwa_005fuserMenu_005f0.setPageContext(_jspx_page_context);
             _jspx_th_spagobiwa_005fuserMenu_005f0.setParent(null);
             // /WEB-INF/jsp/wapp/home.jsp(569,2) name = viewTrackPath type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
             _jspx_th_spagobiwa_005fuserMenu_005f0.setViewTrackPath(viewTrackPath);
             int _jspx_eval_spagobiwa_005fuserMenu_005f0 = _jspx_th_spagobiwa_005fuserMenu_005f0.doStartTag();
             if (_jspx_th_spagobiwa_005fuserMenu_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
             _jspx_th_spagobiwa_005fuserMenu_005f0.release();
             _jsp_instancemanager.destroyInstance(_jspx_th_spagobiwa_005fuserMenu_005f0);
             return;
             }
             _jspx_th_spagobiwa_005fuserMenu_005f0.release();
             _jsp_instancemanager.destroyInstance(_jspx_th_spagobiwa_005fuserMenu_005f0);
            


            I hope that can help you to imagine what happen. I try to find the code of the SpagoBI tag libray to put it here.

            Best regards.

            • 3. Re: NullPointer when executing JSP compiled page on JBoss AS 5.0
              jsipher Newbie

              I ran into this upgrading from 4.2.3 to 5.1.0. The problem pages all extend a common base class, and I changed the base class's jspInit() method to to check whether there's a _jspInit() method and, if so, call it.

               

                  public void jspInit() {
                      try {
                          Method _jspInit = this.getClass().getMethod("_jspInit", (Class[])null);
                          try {
                              _jspInit.invoke(this, (Object[])null);
                          } catch (Exception e) {
                              _log.error("Exception invoking _jspInit",e);
                          }
                      } catch (NoSuchMethodException ignored) {
                      }
                  }
              

               

              It doesn't seem like I should need to do that, and I'd appreciate knowing the "correct" fix if anyone knows what it is.