1 2 3 Previous Next 38 Replies Latest reply on May 9, 2007 6:31 PM by 807606

    servlet exception

    807606
      i m just getting 1 error here regarding the connection to oracle database from my servlet.

      javax.servlet.ServletException: Servlet execution threw an exception

      my classpath is set,the ojdbc.jar file is set.
      what is else is needed?
      the servlet compiles properly.
        • 1. Re: servlet exception
          807606
          Is there a stack trace?
          • 2. Re: servlet exception
            807606
            yes there is a stack trace
            • 3. Re: servlet exception
              807606
              Did you read it?
              • 4. Re: servlet exception
                807606
                how do i read it?
                and there r so many.which one?
                it is a .log file so what program should i use to open it?
                • 5. Re: servlet exception
                  807606
                  "What should I use to open it"?
                  windows:wordpad or notepad
                  linux: kedit, gedit, openoffice, ..


                  "Which one??"
                  Is there a specific log file for your webapp? If not, probably the catalina-***.out or stdout***.log file, or else the stderr***.log file..

                  Usually, there is a date associated to the file as well, pick the most recent.

                  The java stack trace shows you the origination of the error...and sometimes even more useful information (SQL exception indicating bad user/password... or the like)
                  • 6. Re: servlet exception
                    807606
                    "What should I use to open it"?
                    windows:wordpad or notepad
                    linux: kedit, gedit, openoffice, ..


                    "Which one??"
                    Is there a specific log file for your webapp? If
                    not, probably the catalina-***.out or stdout***.log
                    file, or else the stderr***.log file..

                    Usually, there is a date associated to the file as
                    well, pick the most recent.

                    The java stack trace shows you the origination of the
                    error...and sometimes even more useful information
                    (SQL exception indicating bad user/password... or the
                    like)
                    Also, PS:
                    It's likely to be toward the bottom of the file.
                    • 7. Re: servlet exception
                      807606
                      Also, I was assuming Tomcat... which is the limit of my servlet experience.
                      • 8. Re: servlet exception
                        807606
                        ok i have read the recent one
                        it is BIG
                        and it is alien for me
                        what should i do?
                        SessionListener: contextDestroyed()
                        ContextListener: contextDestroyed()........
                        java.lang.IllegalStateException: Cannot forward after response has been committed
                        • 9. Re: servlet exception
                          807606
                          Maybe start by searching the file for text matching the method that tries to contact Oracle?


                          for example..

                          public void performMyOracleQueryThingamagigger(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException 
                          {
                          //....
                          }
                          search for "performMyOracleQueryThingamagigger"
                          • 10. Re: servlet exception
                            807606
                            ok i have read the recent one
                            it is BIG
                            I assume your tomcat is non-production.

                            1. stop tomcat
                            2. move the logs directory to logs.old
                            3. make a new logs directory.
                            4. restart tomcat.
                            5. take the LEAST number of steps to duplicate the error
                            6. Open the log file now (should be shorter)
                            • 11. Re: servlet exception
                              807606
                              is it something to do with this?

                              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
                                   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                              • 12. Re: servlet exception
                                807606
                                Is there anything beneath that? (or before it?)

                                How many lines is the file now?
                                • 13. Re: servlet exception
                                  807606
                                  ok this is the whole thing

                                  May 8, 2007 11:03:51 PM org.apache.catalina.core.ApplicationContext log
                                  INFO: ContextListener: contextInitialized()
                                  May 8, 2007 11:03:51 PM org.apache.catalina.core.ApplicationContext log
                                  INFO: SessionListener: contextInitialized()
                                  May 8, 2007 11:04:21 PM org.apache.catalina.core.StandardWrapperValve invoke
                                  SEVERE: Servlet.service() for servlet dress threw exception
                                  javax.servlet.ServletException: Servlet execution threw an exception
                                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:313)
                                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
                                       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                                       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                                       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                                       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                                       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
                                       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                                       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
                                       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
                                       at java.lang.Thread.run(Unknown Source)
                                  • 14. Re: servlet exception
                                    807606
                                    When does the exception occur?
                                    Are you doing something on the web page and it going to the database? Does the exception occur when you first start tomcat?

                                    Also, if you are using Oracle, you surely know the name of the method you are calling that is going to need to connect to Oracle. Also--you could search for the word "Oracle" -- I imagine it appears somewhere in the stack trace?

                                    If I may ask, how long have you been writing java code?
                                    1 2 3 Previous Next