exception

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • venkiiflx
    New Member
    • Feb 2008
    • 5

    #1

    exception

    hi... i am jsut developing a web application where it just throws a exception
    "org.apache.jas per.JasperExcep tion" with the root cause "java.lang.Arra yIndexOutOfBoun dsException:"
    can anyone plz giude me to overcome this error
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by venkiiflx
    hi... i am jsut developing a web application where it just throws a exception
    "org.apache.jas per.JasperExcep tion" with the root cause "java.lang.Arra yIndexOutOfBoun dsException:"
    can anyone plz giude me to overcome this error
    Does the stack trace contain also the java file that threw the exception and the line number?

    Comment

    • venkiiflx
      New Member
      • Feb 2008
      • 5

      #3
      Originally posted by r035198x
      Does the stack trace contain also the java file that threw the exception and the line number?
      no... no such informations

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by venkiiflx
        no... no such informations
        Can you post the full stacktrace that you got then.

        Comment

        • venkiiflx
          New Member
          • Feb 2008
          • 5

          #5
          Originally posted by r035198x
          Can you post the full stacktrace that you got then.
          Exception report

          message

          description The server encountered an internal error () that prevented it from fulfilling this request.

          exception

          org.apache.jasp er.JasperExcept ion: 2
          org.apache.jasp er.servlet.JspS ervletWrapper.h andleJspExcepti on(JspServletWr apper.java:510)
          org.apache.jasp er.servlet.JspS ervletWrapper.s ervice(JspServl etWrapper.java: 393)
          org.apache.jasp er.servlet.JspS ervlet.serviceJ spFile(JspServl et.java:314)
          org.apache.jasp er.servlet.JspS ervlet.service( JspServlet.java :264)
          javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:802)
          org.netbeans.mo dules.web.monit or.server.Monit orFilter.doFilt er(MonitorFilte r.java:368)


          root cause

          java.lang.Array IndexOutOfBound sException: 2
          org.apache.jsp. wrtrans_jsp._js pService(wrtran s_jsp.java:70)
          org.apache.jasp er.runtime.Http JspBase.service (HttpJspBase.ja va:97)
          javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:802)
          org.apache.jasp er.servlet.JspS ervletWrapper.s ervice(JspServl etWrapper.java: 332)
          org.apache.jasp er.servlet.JspS ervlet.serviceJ spFile(JspServl et.java:314)
          org.apache.jasp er.servlet.JspS ervlet.service( JspServlet.java :264)
          javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:802)
          org.netbeans.mo dules.web.monit or.server.Monit orFilter.doFilt er(MonitorFilte r.java:368)

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            So it did give you the files and the line numbers.
            When is the exception thrown?
            Have you made sure that all your JSPs have compiled without errors?

            Comment

            • venkiiflx
              New Member
              • Feb 2008
              • 5

              #7
              Originally posted by r035198x
              So it did give you the files and the line numbers.
              When is the exception thrown?
              Have you made sure that all your JSPs have compiled without errors?

              ya... its compiled and found no errors....
              <%try{
              String temp[];
              String temp1=request.g etParameter("or did");
              temp=temp1.spli t("=");
              FileReader re=new FileReader("D:/venki/project/a1/FIX/belongings/"+session.getAt tribute("sessun ame")+".txt");
              BufferedReader in = new BufferedReader( re);
              ----> if(temp[3]=="S")
              {

              now i got new error..... the error is shown in tat line... but the ordid is a valid one and request is working fine

              Comment

              • r035198x
                MVP
                • Sep 2006
                • 13225

                #8
                Originally posted by venkiiflx
                ya... its compiled and found no errors....
                <%try{
                String temp[];
                String temp1=request.g etParameter("or did");
                temp=temp1.spli t("=");
                FileReader re=new FileReader("D:/venki/project/a1/FIX/belongings/"+session.getAt tribute("sessun ame")+".txt");
                BufferedReader in = new BufferedReader( re);
                ----> if(temp[3]=="S")
                {

                now i got new error..... the error is shown in tat line... but the ordid is a valid one and request is working fine
                You should be testing to make sure that the array called temp does have a length of four for you to be able to access its fourth element (temp[3]). Also, use the equals method when comparing strings in java and not ==

                Comment

                • venkiiflx
                  New Member
                  • Feb 2008
                  • 5

                  #9
                  Originally posted by r035198x
                  You should be testing to make sure that the array called temp does have a length of four for you to be able to access its fourth element (temp[3]). Also, use the equals method when comparing strings in java and not ==
                  i have also tried wit equals..... the result is the same..... same exception...
                  the array length is 4....

                  Comment

                  • r035198x
                    MVP
                    • Sep 2006
                    • 13225

                    #10
                    Originally posted by venkiiflx
                    i have also tried wit equals..... the result is the same..... same exception...
                    the array length is 4....
                    I won't take your word for it (judging by how the discussion has been going so far).
                    Print out the array length using System.out.prin tln,(print out its contents too).
                    One other important thing, you said above that you are getting a new error. What is the error message for this new error?

                    Comment

                    Working...