-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------
Okay
Here is mod_jserv.log:
> [30/09/1999 14:25:20:738] (INFO) Apache Module was cleaned-up
> [30/09/1999 14:25:34:398] (ERROR) ajp11: Servlet Error:
>java.lang.NullPointerException: null
> [30/09/1999 14:25:34:398] (ERROR) an error returned handling request via protocol
>"ajpv11"
Here is jserv.log:
> [30/09/1999 08:25:22:090 MDT] ApacheJServ/1.0 is starting...
> [30/09/1999 08:25:22:090 MDT] WARNING: connection authentication is disabled
> [30/09/1999 08:25:22:210 MDT] Connection allowed from localhost/127.0.0.1
> [30/09/1999 08:25:22:210 MDT] Listening on port 8007 accepting 50 maximum connections
> [30/09/1999 08:25:22:250 MDT] Creating Servlet Zones
> [30/09/1999 08:25:34:348 MDT] CqtdbConnect: init
> [30/09/1999 08:25:34:398 MDT] java.lang.NullPointerException
> at CqtdbConnect.doGet(CqtdbConnect.java:75)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:499)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
> at org.apache.jserv.JServConnection.processRequest(JServConnection.java)
> at org.apache.jserv.JServConnection.run(JServConnection.java)
> at java.lang.Thread.run(Thread.java:466)
Here is my source file CqtdbConnect.java:
> import java.io.*;
> import javax.servlet.*;
> import java.sql.*;
> import javax.servlet.http.*;
> import sun.misc.*;
> import java.util.*;
> import com.javaexchange.dbConnectionBroker.*;
>
>
> public class CqtdbConnect extends HttpServlet
> {
> DbConnectionBroker myBroker;
>
>
> public void init (ServletConfig config) throws ServletException {
> super.init(config);
> // This sets up a connection broker with a minimum pool size of 10
> // and a maximum of 20. The log file is created in
>H:\Projects\CqtdbTest\connection.log
> // Pool connections will be restarted once a day.
>
> try {myBroker = new DbConnectionBroker( "oracle.jdbc.driver.OracleDriver",
>
>"jdbc:oracle:thin:@xxx.xxx.xx.xxx:1523:cqtdb",
> "username", "password", 10, 20,
>
>"H:\\Projects\\CqtdbTest\\connection.log", 0.01);
> }
>
> catch (IOException e5) { }
>
> //{{INIT_CONTROLS
> //}}
> }
>
>
> public void doGet (HttpServletRequest request, HttpServletResponse response)
> throws ServletException, IOException
> {
> ServletOutputStream out = response.getOutputStream();
> Connection conn = null;
> Statement stmt = null;
> int thisConnection;
> response.setContentType ("text/html");
>
> try {
> // get a connection from the broker
> conn = myBroker.getConnection();
>
> thisConnection = myBroker.idOfConnection(conn);
> out.println("<h3>CQTDB Connection Broker Example</h3>" +
> "Using connection " + thisConnection +
> " from connection pool<p>");
>
> // create the sql statement object
> stmt = conn.createStatement();
>
> // execute the query and get a result set
> ResultSet rset = stmt.executeQuery("SELECT * FROM CQT.PART_BASE");
>
> // display the result set as a list
> out.println("<HTML><HEAD><TITLE>CQTDB TEST PAGE</TITLE></HEAD>");
> out.println("<BODY>");
> out.println("<UL>");
> while (rset.next()) {
> out.println("<LI>" + rset.getString("Part_Name") + " " +
>rset.getString("Part_Base_No"));
> }
> out.println("</UL>");
> out.println("</BODY></HTML>");
> }
> catch (SQLException e1) {
> out.println("<I><B>Error code:</B> " + e1 + "</I>");
> }
> finally {
> try{if(stmt != null) {stmt.close();}} catch(SQLException e1) {};
>
> // return the connection to the broker
LINE 75 >>>>>>>> myBroker.freeConnection(conn);
> }
>
> out.close();
> response.getOutputStream().close();
> }
>
> public void destroy()
> {
> // to do: code goes here.
> myBroker.destroy();
> super.destroy();
>
> }
>
> public String getServletInfo()
> {
> return "manages connections to the component database and formats
>displays";
> }
>
>
> //{{DECLARE_CONTROLS
> //}}
> }
The jserv.log shows the error to be at line 75 but I believe it starts
at the init section.
The reason being is when a connection pool is started it should write
something to connection.log.
Well connection.log is empty after I try to run this using jserv.
It is not empty when run under Visual Cafe using servletrunner.
Any clues would be appreciated.
Thanks,
Bob Epling
303-971-1835
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]