tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Sabourdin <zouy...@yahoo.com>
Subject Re: Internal Servlet Error: IllegalStateException
Date Mon, 25 Sep 2000 12:39:18 GMT
you should not // your exception, because you then
don't what is your error.
error 500, is use for almost every excepetion that are
not correctly handle by the developper.


Anyway, the most common probleme is unsuitable Driver
that is to says that your driver is not in your
CLASSPATH.

--- Thomas Cleenewerck
<Thomas.Cleenewerck@cs.kuleuven.ac.be> wrote:
> Hello,
> 
> I'm trying to acces a oracle database from a
> jsp-page.  Every works as long as I do not use use a
> seperate object to establish my database connection.
>  I'm getting the following error:
> Error: 500
> Location: /thomas/jspper.jsp
> Internal Servlet Error:
> 
> java.lang.IllegalStateException: Response has
> already been committed
> 	at
>
org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletResponseFacade.java:157)
> 	at
>
org.apache.jasper.runtime.JspServlet.unknownException(JspServlet.java:299)
> 	at
>
org.apache.jasper.runtime.JspServlet.service(JspServlet.java:377)
> 	at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
>
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
> 	at
>
org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
> 	at
>
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156)
> 	at
>
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
> 	at java.lang.Thread.run(Unknown Source)
> 
> Actualy the code for making a connection, i want to
> reuse....  This a bad example of reuse, but it is
> just for testing !!!
> say the class TempData:
> 
> import java.sql.*;
> import Database.*;
> public class TempData  {
> 
>  public void perform() {
>  try {
>         DriverManager.registerDriver(new
> oracle.jdbc.driver.OracleDriver());
>  } catch (java.sql.SQLException SqlExc) {
>       //throw(new RegisterDriverException("Error
> while registering the JDBC driver\nReceived:
> "+SqlExc.toString()));
>  }
>   
>  String $connectString = "xxxxxxxxxxx";
>  String $username="xxxxxxxx";
>  String $password="xxxxxxxxx";
>  try {
>         Connection $connection =
> DriverManager.getConnection
> ($connectString,$username,$password);
>    
>  } catch (java.sql.SQLException SqlExc) {
>       //throw(new ConnectionException("Error while
> opening database connection\nReceived:
> "+SqlExc.toString()));
>  }
>  } }
> 
> 
> and the code off my jsp page will no look like this:
> 
> <%@ page import="java.util.*, Database.*,
> java.sql.*" %>
> <html>
> <body>
> <h1> joehoe </h1>
> <%
>  TempData td = new TempData();
>   td.perform();
> %>
> </body>
> </html>
> 
> 
> 
> What works:
> <%@ page import="java.util.*, Database.*,
> java.sql.*" %>
> <html>
> <body>
> <h1> joehoe </h1>
> <%
> 
> try {
>         DriverManager.registerDriver(new
> oracle.jdbc.driver.OracleDriver());
>  } catch (java.sql.SQLException SqlExc) {
>       //throw(new RegisterDriverException("Error
> while registering the JDBC
> driver\nReceived:"+SqlExc.toString()));
>  }
>     
>  String $connectString = "xxxxx";
>  String $username="xxxx";
>  String $password="xxxxx";
>  try {
>         Connection $connection =
> DriverManager.getConnection
> ($connectString,$username,$password);
>    
>  } catch (java.sql.SQLException SqlExc) {
>       //throw(new ConnectionException("Error while
> opening database connection\nReceived:
> "+SqlExc.toString()));
>   }
> %>
> </body>
> </html>
> 


__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

Mime
View raw message