You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Luminous Heart <lu...@yahoo.com> on 2002/08/19 17:14:08 UTC

It would be great IF somebody answered me, ONCE, for change :(

I keep on asking this question but noone helps. Is it
a bug in TC?

Why do I get NullPointerException? If I press refresh
a couple of times I would go through. 

2002-08-19 00:53:32 StandardWrapperValve[jsp]:
Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
        at
org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:61)
        at
org.postgresql.Connection.ExecSQL(Connection.java:398)
        at
org.postgresql.jdbc2.Statement.execute(Statement.java:130)
        at
org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54)
        at
org.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.java:99)
        at
com.codestudio.sql.PoolManPreparedStatement.executeQuery(Unknown
Source)
        at
org.apache.jsp.AccountAccess$jsp._jspService(AccountAccess$jsp.java:207)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:531)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:392)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)
        at
org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
        at java.lang.Thread.run(Thread.java:536)
 


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: It would be great IF somebody answered me, ONCE, for change :(

Posted by Luminous Heart <lu...@yahoo.com>.
Thank you Paul. I know we are NOT paid to help
eachother, but hey, maybe someday I would be able to
lend a hand. This is how a great software like Apache
is putting a wide smile on all our faces.

Regards.

--- Paul McGovern <mc...@canuck.com> wrote:
> 
> Sorry, but you haven't included enough information
> for anyone to formulate an 
> answer. Based on the information all I can say is
> that you have a null 
> pointer exception. If you want a proper response,
> please include the code 
> segment that is going wrong, and config info from
> server.xml and web.xml.
> 
> Also please bear in mind that nobody here, AFAIK, is
> being paid to answer.
> 
> 
> On Monday 19 August 2002 11:14, you wrote:
> > I keep on asking this question but noone helps. Is
> it
> > a bug in TC?
> >
> > Why do I get NullPointerException? If I press
> refresh
> > a couple of times I would go through.
> >
> > 2002-08-19 00:53:32 StandardWrapperValve[jsp]:
> > Servlet.service() for servlet jsp threw exception
> > java.lang.NullPointerException
> >         at
> >
>
org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:61)
> >         at
> >
>
org.postgresql.Connection.ExecSQL(Connection.java:398)
> >         at
> >
>
org.postgresql.jdbc2.Statement.execute(Statement.java:130)
> >         at
> >
>
org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54)
> >         at
> >
>
org.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.java:
> >99) at
> >
>
com.codestudio.sql.PoolManPreparedStatement.executeQuery(Unknown
> > Source)
> >         at
> >
>
org.apache.jsp.AccountAccess$jsp._jspService(AccountAccess$jsp.java:207)
> >         at
> >
>
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> >         at
> >
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
> >
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j
> >ava:201) at
> >
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
> >         at
> >
>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
> >         at
> >
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
> >
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio
> >nFilterChain.java:247) at
> >
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
> >hain.java:193) at
> >
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j
> >ava:243) at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
> >566) at
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> >         at
> >
>
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >         at
> >
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j
> >ava:190) at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
> >566) at
> >
>
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBas
> >e.java:531) at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
> >564) at
> >
>
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:
> >246) at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
> >564) at
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> >         at
> >
>
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >         at
> >
>
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
> >         at
> >
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:18
> >0) at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
> >566) at
> >
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve
> >.java:170) at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
> >564) at
> >
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:17
> >0) at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
> >564) at
> >
>
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
> >         at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
> >564) at
> >
>
org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:392
> >) at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
> >564) at
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> >         at
> >
>
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >         at
> >
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav
> >a:174) at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
> >566) at
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> >         at
> >
>
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >         at
> >
>
org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)
> >         at
> >
>
org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
> >         at java.lang.Thread.run(Thread.java:536)
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > HotJobs - Search Thousands of New Jobs
> > http://www.hotjobs.com
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: It would be great IF somebody answered me, ONCE, for change :(

Posted by Paul McGovern <mc...@canuck.com>.
Sorry, but you haven't included enough information for anyone to formulate an 
answer. Based on the information all I can say is that you have a null 
pointer exception. If you want a proper response, please include the code 
segment that is going wrong, and config info from server.xml and web.xml.

Also please bear in mind that nobody here, AFAIK, is being paid to answer.


On Monday 19 August 2002 11:14, you wrote:
> I keep on asking this question but noone helps. Is it
> a bug in TC?
>
> Why do I get NullPointerException? If I press refresh
> a couple of times I would go through.
>
> 2002-08-19 00:53:32 StandardWrapperValve[jsp]:
> Servlet.service() for servlet jsp threw exception
> java.lang.NullPointerException
>         at
> org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:61)
>         at
> org.postgresql.Connection.ExecSQL(Connection.java:398)
>         at
> org.postgresql.jdbc2.Statement.execute(Statement.java:130)
>         at
> org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54)
>         at
> org.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.java:
>99) at
> com.codestudio.sql.PoolManPreparedStatement.executeQuery(Unknown
> Source)
>         at
> org.apache.jsp.AccountAccess$jsp._jspService(AccountAccess$jsp.java:207)
>         at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
>         at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j
>ava:201) at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
>         at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
>         at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio
>nFilterChain.java:247) at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
>hain.java:193) at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j
>ava:243) at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
>566) at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j
>ava:190) at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
>566) at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBas
>e.java:531) at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
>564) at
> org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:
>246) at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
>564) at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:18
>0) at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
>566) at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve
>.java:170) at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
>564) at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:17
>0) at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
>564) at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
>         at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
>564) at
> org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:392
>) at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
>564) at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav
>a:174) at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:
>566) at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
> org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)
>         at
> org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
>         at java.lang.Thread.run(Thread.java:536)
>
>
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


HTML document base dir in webapps dir?

Posted by D Bamud <no...@cad.delhi.nic.in>.
I have a web application named "myapp" in "C:\jakarta-tomcat-4.0.4\webapps"
dir. Also have "C:\jakarta-tomcat-4.0.3\webapps\myapp_att" dir which isn't a
web appl but a dir used by my "myapp". In my jsp (in the "myapp") I provide
links to attachments from "C:\jakarta-tomcat-4.0.3\webapps\myapp_att" dir.
Clicking links was showing the file in Tomcat3.2.3 but not in Tomcat4.0.4.
It gives 404  error. What to do so that directory "myapp_att" could be used
as one document base dir.
--
NB: This is a repeat Q


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Tomcat 3.x Vs Tomcat 4.x

Posted by D Bamud <no...@cad.delhi.nic.in>.
Tomcat 3.x Vs Tomcat 4.x

I have a web application named "myapp" in "C:\jakarta-tomcat-4.0.4\webapps"
dir. Also have "C:\jakarta-tomcat-4.0.3\webapps\myapp_att" dir which isn't a
web appl but a dir used by my "myapp". In my jsp (in the "myapp") I provide
links to attachments from "C:\jakarta-tomcat-4.0.3\webapps\myapp_att" dir.
Clicking links was showing the file in Tomcat3.2.3 but not in Tomcat4.0.4. I
guess in 3.x "C:\jakarta-tomcat-3.2.2\webapps" was used as document base but
not in 4.x. How to declare the directory "myapp_att" so that it could also
be used as document base.

--Thanks


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: It would be great IF somebody answered me, ONCE, for change :(

Posted by Carrie Salazar <sa...@nature.berkeley.edu>.
hey, can i get a copy of the debugger?  or do others have
any debugger suggestions?

tomcat error messages are pretty cryptic to me still, though
for the simple JSP work i do i get around it most of the time.
but perhaps a debugger will save me some hair pulling.
--
carrie s.

On Mon, Aug 19, 2002 at 09:53:02AM -0700, micael wrote:
> If you have a debugger, all you have to do is to follow the bouncing ball 
> and find the null reference.  That will be the fastest way to find this 
> problem.  It should not take long.  If you don't have a debugger, I will 
> send you one I made to use, and I like better than the standard debuggers.
> 
> At 08:49 AM 8/19/2002 -0700, you wrote:
> >I am sorry, but I did not get what you mean with
> >connection limit to be a hard limit, which one is
> >that?
> >
> >I am including a copy of my pool.xml if you care do
> >point out what should be changed.
> >
> >Thank you in advance.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: It would be great IF somebody answered me, ONCE, for change :(

Posted by micael <ca...@harbornet.com>.
Here you go, as per request.  You will have to fiddle a bit to get what is 
going on, but not much.  The methods return the object so you can debug as 
follows:  new Debugger().add(blah1).add(blah2).add(blah3).log("Testing the 
Back Forty", true); which will do what is specified.  Set up the paths 
however is best for you.  I give this to students.  When I use it, I name 
it REMOVE_ME.java.  Good luck!

Micael

At 09:59 AM 8/19/2002 -0700, you wrote:
>It is always nice to have an extra debugger handy :) I
>am testing JTest but am not sure it is really what I
>need. I would appreciate your help if you can send me
>yours.
>
>Thank you in advance.
>
>--- micael <ca...@harbornet.com> wrote:
> > If you have a debugger, all you have to do is to
> > follow the bouncing ball
> > and find the null reference.  That will be the
> > fastest way to find this
> > problem.  It should not take long.  If you don't
> > have a debugger, I will
> > send you one I made to use, and I like better than
> > the standard debuggers.
> >
> > At 08:49 AM 8/19/2002 -0700, you wrote:
> > >I am sorry, but I did not get what you mean with
> > >connection limit to be a hard limit, which one is
> > >that?
> > >
> > >I am including a copy of my pool.xml if you care do
> > >point out what should be changed.
> > >
> > >Thank you in advance.
> > >
> > >==================== Pool.xml =====================
> > ><?xml version="1.0" encoding="UTF-8"?>
> > >
> > ><poolman>
> > >
> > >   <management-mode>local</management-mode>
> > >
> > >   <datasource>
> > >
> > >     <!-- ============================== -->
> > >     <!-- Physical Connection Attributes -->
> > >     <!-- ============================== -->
> > >
> > >     <!-- Standard JDBC Driver info -->
> > >
> > >     <dbname>webdev</dbname>
> > >     <jndiName>webdev</jndiName>
> > >     <driver>org.postgresql.Driver</driver>
> > >
> > <url>jdbc:postgresql://localhost:6093/webdev</url>
> > >
> > >     <username>JustAUserName</username>
> > >     <password>JustAUserNamePassword</password>
> > >
> > >     <!-- Oracle needs this to be set to true -->
> > >     <nativeResults>true</nativeResults>
> > >
> > >     <minimumSize>1</minimumSize>
> > >     <maximumSize>10</maximumSize>
> > >     <connectionTimeout>600</connectionTimeout>
> > >     <userTimeout>12</userTimeout>
> > >     <shrinkBy>10</shrinkBy>
> > >
> > >
> >
> ><logFile>/usr/local/tomcat/logs/poolman.log</logFile>
> > >     <debugging>false</debugging>
> > >
> > >     <!-- Query Cache Attributes-->
> > >
> > >     <cacheEnabled>false</cacheEnabled>
> > >     <cacheSize>20</cacheSize>
> > >
> > <cacheRefreshInterval>120</cacheRefreshInterval>
> > >
> > >   </datasource>
> > >
> > ></poolman>
> > >
> > >==================== End Pool.xml =================
> > >--- Mike Jackson <mj...@cdi-hq.com> wrote:
> > > > Actually now that I think about it more that
> > might
> > > > be the cause of the null
> > > > pointer (but
> > > > probably not).  In your poolman.xml file have
> > you
> > > > set the connection limit
> > > > to be a hard
> > > > limit?  If you timeout on connections (user
> > timeout)
> > > > is fairly high you
> > > > could run out of
> > > > connections, and it might return a "null"
> > instead of
> > > > a connection.
> > > >
> > > > But that's just a guess.  Also, you might was to
> > > > also turn on logging (debug
> > > > level) in
> > > > poolman as well so that you can watch the
> > > > connections getting checked out
> > > > and in.
> > > >
> > > > --mikej
> > > > -=-----
> > > > mike jackson
> > > > mjackson@cdi-hq.com
> > > >
> > > > > -----Original Message-----
> > > > > From: Luminous Heart
> > > > [mailto:luminousheart@yahoo.com]
> > > > > Sent: Monday, August 19, 2002 8:36 AM
> > > > > To: Tomcat Users List
> > > > > Subject: Re: It would be great IF somebody
> > > > answered me, ONCE, for change
> > > > > :(
> > > > >
> > > > >
> > > > > Hi Graig,
> > > > > Here is my jsp file. I am not sure what might
> > be
> > > > > wrong. Although the same error happens in a
> > bigger
> > > > > application in a tc cluster of 3 tomcats. Two
> > of
> > > > these
> > > > > tcs fail while one does not get any forwards
> > after
> > > > > that.
> > > > >
> > > > > Please take a look at my code, if you do not
> > mind.
> > > > >
> > > > > Best regards.
> > > > >
> > > > > ===================== JSP
> > =====================
> > > > > <%@ page import="java.io.*" %>
> > > > > <%@ page import="java.util.*" %>
> > > > > <%@ page import="java.text.*" %>
> > > > >
> > > > > <%@ page import="java.util.Properties" %>
> > > > > <%@ page import="java.util.Date" %>
> > > > >
> > > > > <%@ page contentType="text/html"%>
> > > > >
> > > > > <%@ page import="com.codestudio.util.*"%>
> > > > > <%@ page import="java.sql.*"%>
> > > > >
> > > > > <!-- %@ include file="no-cache.jsp" % -->
> > > > >
> > > > > <form action="UserAccount.jsp" method=post
> > > > > name="access_form">
> > > > >   <table width="90%" align="center">
> > > > >   <tr>
> > > > >               <th bgcolor="#CCCCFF" colspan=3>
> > > > <font
> > > > > size=5>User Access</font></th>
> > > > >
> > > > >     <td>&nbsp;</td>
> > > > >     <td>&nbsp;</td>
> > > > >     <td>&nbsp;</td>
> > > > >   </tr>
> > > > >   <tr>
> > > > >     <td>
> > > > >         <center>
> > > > >           <table cellpadding=4 cellspacing=2
> > > > border=0>
> > > > >             <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > > size=5>User Access by userid</font></th>
> > > > >             <tr bgcolor="#c8d8f8">
> > > > >               <td valign=top colspan=2>
> > <b>User
> > > > > Name</b><br>
> > > > >                 <input type="text"
> > > > name="byusername"
> > > > > size=25 value=""  maxlength=25>
> > > > >               </td>
> > > > >             </tr>
> > > > >           </table>
> > > > > </center>
> > > > > </td>
> > > > >     <td>
> > > > >         <center>
> > > > >           <table cellpadding=4 cellspacing=2
> > > > border=0>
> > > > >             <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > > size=5>User Access by Date</font><font
> > > > size=1></font>
> > > > >             </th>
> > > > >             <tr bgcolor="#c8d8f8">
> > > > >               <td valign=top> <b>Date</b><br>
> > > > >                 <input type="text"
> > name="bydate"
> > > > > value="" size=25  maxlength=125>
> > > > >                 <br>
> > > > >               </td>
> > > > >             </tr>
> > > > >           </table>
> > > > > </center>
> > > > > </td>
> > > > >     <td>
> > > > >         <center>
> > > > >           <table cellpadding=4 cellspacing=2
> > > > border=0>
> > > > >             <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > > size=5>USER Access by IP Address</font>
> > > > >             </th>
> > > > >             <tr bgcolor="#c8d8f8">
> >
>=== message truncated ===
>
>
>__________________________________________________
>Do You Yahoo!?
>HotJobs - Search Thousands of New Jobs
>http://www.hotjobs.com
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

RE: It would be great IF somebody answered me, ONCE, for change :(

Posted by Luminous Heart <lu...@yahoo.com>.
It is always nice to have an extra debugger handy :) I
am testing JTest but am not sure it is really what I
need. I would appreciate your help if you can send me
yours.

Thank you in advance.

--- micael <ca...@harbornet.com> wrote:
> If you have a debugger, all you have to do is to
> follow the bouncing ball 
> and find the null reference.  That will be the
> fastest way to find this 
> problem.  It should not take long.  If you don't
> have a debugger, I will 
> send you one I made to use, and I like better than
> the standard debuggers.
> 
> At 08:49 AM 8/19/2002 -0700, you wrote:
> >I am sorry, but I did not get what you mean with
> >connection limit to be a hard limit, which one is
> >that?
> >
> >I am including a copy of my pool.xml if you care do
> >point out what should be changed.
> >
> >Thank you in advance.
> >
> >==================== Pool.xml =====================
> ><?xml version="1.0" encoding="UTF-8"?>
> >
> ><poolman>
> >
> >   <management-mode>local</management-mode>
> >
> >   <datasource>
> >
> >     <!-- ============================== -->
> >     <!-- Physical Connection Attributes -->
> >     <!-- ============================== -->
> >
> >     <!-- Standard JDBC Driver info -->
> >
> >     <dbname>webdev</dbname>
> >     <jndiName>webdev</jndiName>
> >     <driver>org.postgresql.Driver</driver>
> >    
> <url>jdbc:postgresql://localhost:6093/webdev</url>
> >
> >     <username>JustAUserName</username>
> >     <password>JustAUserNamePassword</password>
> >
> >     <!-- Oracle needs this to be set to true -->
> >     <nativeResults>true</nativeResults>
> >
> >     <minimumSize>1</minimumSize>
> >     <maximumSize>10</maximumSize>
> >     <connectionTimeout>600</connectionTimeout>
> >     <userTimeout>12</userTimeout>
> >     <shrinkBy>10</shrinkBy>
> >
> >
>
><logFile>/usr/local/tomcat/logs/poolman.log</logFile>
> >     <debugging>false</debugging>
> >
> >     <!-- Query Cache Attributes-->
> >
> >     <cacheEnabled>false</cacheEnabled>
> >     <cacheSize>20</cacheSize>
> >    
> <cacheRefreshInterval>120</cacheRefreshInterval>
> >
> >   </datasource>
> >
> ></poolman>
> >
> >==================== End Pool.xml =================
> >--- Mike Jackson <mj...@cdi-hq.com> wrote:
> > > Actually now that I think about it more that
> might
> > > be the cause of the null
> > > pointer (but
> > > probably not).  In your poolman.xml file have
> you
> > > set the connection limit
> > > to be a hard
> > > limit?  If you timeout on connections (user
> timeout)
> > > is fairly high you
> > > could run out of
> > > connections, and it might return a "null"
> instead of
> > > a connection.
> > >
> > > But that's just a guess.  Also, you might was to
> > > also turn on logging (debug
> > > level) in
> > > poolman as well so that you can watch the
> > > connections getting checked out
> > > and in.
> > >
> > > --mikej
> > > -=-----
> > > mike jackson
> > > mjackson@cdi-hq.com
> > >
> > > > -----Original Message-----
> > > > From: Luminous Heart
> > > [mailto:luminousheart@yahoo.com]
> > > > Sent: Monday, August 19, 2002 8:36 AM
> > > > To: Tomcat Users List
> > > > Subject: Re: It would be great IF somebody
> > > answered me, ONCE, for change
> > > > :(
> > > >
> > > >
> > > > Hi Graig,
> > > > Here is my jsp file. I am not sure what might
> be
> > > > wrong. Although the same error happens in a
> bigger
> > > > application in a tc cluster of 3 tomcats. Two
> of
> > > these
> > > > tcs fail while one does not get any forwards
> after
> > > > that.
> > > >
> > > > Please take a look at my code, if you do not
> mind.
> > > >
> > > > Best regards.
> > > >
> > > > ===================== JSP
> =====================
> > > > <%@ page import="java.io.*" %>
> > > > <%@ page import="java.util.*" %>
> > > > <%@ page import="java.text.*" %>
> > > >
> > > > <%@ page import="java.util.Properties" %>
> > > > <%@ page import="java.util.Date" %>
> > > >
> > > > <%@ page contentType="text/html"%>
> > > >
> > > > <%@ page import="com.codestudio.util.*"%>
> > > > <%@ page import="java.sql.*"%>
> > > >
> > > > <!-- %@ include file="no-cache.jsp" % -->
> > > >
> > > > <form action="UserAccount.jsp" method=post
> > > > name="access_form">
> > > >   <table width="90%" align="center">
> > > >   <tr>
> > > >               <th bgcolor="#CCCCFF" colspan=3>
> > > <font
> > > > size=5>User Access</font></th>
> > > >
> > > >     <td>&nbsp;</td>
> > > >     <td>&nbsp;</td>
> > > >     <td>&nbsp;</td>
> > > >   </tr>
> > > >   <tr>
> > > >     <td>
> > > >         <center>
> > > >           <table cellpadding=4 cellspacing=2
> > > border=0>
> > > >             <th bgcolor="#CCCCFF" colspan=2>
> <font
> > > > size=5>User Access by userid</font></th>
> > > >             <tr bgcolor="#c8d8f8">
> > > >               <td valign=top colspan=2>
> <b>User
> > > > Name</b><br>
> > > >                 <input type="text"
> > > name="byusername"
> > > > size=25 value=""  maxlength=25>
> > > >               </td>
> > > >             </tr>
> > > >           </table>
> > > > </center>
> > > > </td>
> > > >     <td>
> > > >         <center>
> > > >           <table cellpadding=4 cellspacing=2
> > > border=0>
> > > >             <th bgcolor="#CCCCFF" colspan=2>
> <font
> > > > size=5>User Access by Date</font><font
> > > size=1></font>
> > > >             </th>
> > > >             <tr bgcolor="#c8d8f8">
> > > >               <td valign=top> <b>Date</b><br>
> > > >                 <input type="text"
> name="bydate"
> > > > value="" size=25  maxlength=125>
> > > >                 <br>
> > > >               </td>
> > > >             </tr>
> > > >           </table>
> > > > </center>
> > > > </td>
> > > >     <td>
> > > >         <center>
> > > >           <table cellpadding=4 cellspacing=2
> > > border=0>
> > > >             <th bgcolor="#CCCCFF" colspan=2>
> <font
> > > > size=5>USER Access by IP Address</font>
> > > >             </th>
> > > >             <tr bgcolor="#c8d8f8">
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: It would be great IF somebody answered me, ONCE, for change :(

Posted by micael <ca...@harbornet.com>.
If you have a debugger, all you have to do is to follow the bouncing ball 
and find the null reference.  That will be the fastest way to find this 
problem.  It should not take long.  If you don't have a debugger, I will 
send you one I made to use, and I like better than the standard debuggers.

At 08:49 AM 8/19/2002 -0700, you wrote:
>I am sorry, but I did not get what you mean with
>connection limit to be a hard limit, which one is
>that?
>
>I am including a copy of my pool.xml if you care do
>point out what should be changed.
>
>Thank you in advance.
>
>==================== Pool.xml =====================
><?xml version="1.0" encoding="UTF-8"?>
>
><poolman>
>
>   <management-mode>local</management-mode>
>
>   <datasource>
>
>     <!-- ============================== -->
>     <!-- Physical Connection Attributes -->
>     <!-- ============================== -->
>
>     <!-- Standard JDBC Driver info -->
>
>     <dbname>webdev</dbname>
>     <jndiName>webdev</jndiName>
>     <driver>org.postgresql.Driver</driver>
>     <url>jdbc:postgresql://localhost:6093/webdev</url>
>
>     <username>JustAUserName</username>
>     <password>JustAUserNamePassword</password>
>
>     <!-- Oracle needs this to be set to true -->
>     <nativeResults>true</nativeResults>
>
>     <minimumSize>1</minimumSize>
>     <maximumSize>10</maximumSize>
>     <connectionTimeout>600</connectionTimeout>
>     <userTimeout>12</userTimeout>
>     <shrinkBy>10</shrinkBy>
>
>
><logFile>/usr/local/tomcat/logs/poolman.log</logFile>
>     <debugging>false</debugging>
>
>     <!-- Query Cache Attributes-->
>
>     <cacheEnabled>false</cacheEnabled>
>     <cacheSize>20</cacheSize>
>     <cacheRefreshInterval>120</cacheRefreshInterval>
>
>   </datasource>
>
></poolman>
>
>==================== End Pool.xml =================
>--- Mike Jackson <mj...@cdi-hq.com> wrote:
> > Actually now that I think about it more that might
> > be the cause of the null
> > pointer (but
> > probably not).  In your poolman.xml file have you
> > set the connection limit
> > to be a hard
> > limit?  If you timeout on connections (user timeout)
> > is fairly high you
> > could run out of
> > connections, and it might return a "null" instead of
> > a connection.
> >
> > But that's just a guess.  Also, you might was to
> > also turn on logging (debug
> > level) in
> > poolman as well so that you can watch the
> > connections getting checked out
> > and in.
> >
> > --mikej
> > -=-----
> > mike jackson
> > mjackson@cdi-hq.com
> >
> > > -----Original Message-----
> > > From: Luminous Heart
> > [mailto:luminousheart@yahoo.com]
> > > Sent: Monday, August 19, 2002 8:36 AM
> > > To: Tomcat Users List
> > > Subject: Re: It would be great IF somebody
> > answered me, ONCE, for change
> > > :(
> > >
> > >
> > > Hi Graig,
> > > Here is my jsp file. I am not sure what might be
> > > wrong. Although the same error happens in a bigger
> > > application in a tc cluster of 3 tomcats. Two of
> > these
> > > tcs fail while one does not get any forwards after
> > > that.
> > >
> > > Please take a look at my code, if you do not mind.
> > >
> > > Best regards.
> > >
> > > ===================== JSP =====================
> > > <%@ page import="java.io.*" %>
> > > <%@ page import="java.util.*" %>
> > > <%@ page import="java.text.*" %>
> > >
> > > <%@ page import="java.util.Properties" %>
> > > <%@ page import="java.util.Date" %>
> > >
> > > <%@ page contentType="text/html"%>
> > >
> > > <%@ page import="com.codestudio.util.*"%>
> > > <%@ page import="java.sql.*"%>
> > >
> > > <!-- %@ include file="no-cache.jsp" % -->
> > >
> > > <form action="UserAccount.jsp" method=post
> > > name="access_form">
> > >   <table width="90%" align="center">
> > >   <tr>
> > >               <th bgcolor="#CCCCFF" colspan=3>
> > <font
> > > size=5>User Access</font></th>
> > >
> > >     <td>&nbsp;</td>
> > >     <td>&nbsp;</td>
> > >     <td>&nbsp;</td>
> > >   </tr>
> > >   <tr>
> > >     <td>
> > >         <center>
> > >           <table cellpadding=4 cellspacing=2
> > border=0>
> > >             <th bgcolor="#CCCCFF" colspan=2> <font
> > > size=5>User Access by userid</font></th>
> > >             <tr bgcolor="#c8d8f8">
> > >               <td valign=top colspan=2> <b>User
> > > Name</b><br>
> > >                 <input type="text"
> > name="byusername"
> > > size=25 value=""  maxlength=25>
> > >               </td>
> > >             </tr>
> > >           </table>
> > > </center>
> > > </td>
> > >     <td>
> > >         <center>
> > >           <table cellpadding=4 cellspacing=2
> > border=0>
> > >             <th bgcolor="#CCCCFF" colspan=2> <font
> > > size=5>User Access by Date</font><font
> > size=1></font>
> > >             </th>
> > >             <tr bgcolor="#c8d8f8">
> > >               <td valign=top> <b>Date</b><br>
> > >                 <input type="text" name="bydate"
> > > value="" size=25  maxlength=125>
> > >                 <br>
> > >               </td>
> > >             </tr>
> > >           </table>
> > > </center>
> > > </td>
> > >     <td>
> > >         <center>
> > >           <table cellpadding=4 cellspacing=2
> > border=0>
> > >             <th bgcolor="#CCCCFF" colspan=2> <font
> > > size=5>USER Access by IP Address</font>
> > >             </th>
> > >             <tr bgcolor="#c8d8f8">
> > >               <td valign=top> <b>IP
> > Address</b><br>
> > >                 <input type="text"
> > name="byipaddress"
> > > value="" size=25  maxlength=125>
> > >                 <br>
> > >               </td>
> > >             </tr>
> > >           </table>
> > > </center>
> > > </td>
> > >   </tr>
> > >   <tr>
> > >     <td>&nbsp;</td>
> > >     <td align="center" bgcolor="#c8d8f8">
> > >       <input type="submit" value="Submit"
> > > name="submit">
> > >     </td>
> > >     <td>&nbsp;</td>
> > >   </tr>
> > > </table>
> > > </form>
> > > <%
> > >     String inUser = null;
> > >             String inDate = null;
> > >             String inIPadd = null;
> > >
> > >     try{
> > >        inUser =
> > > (request.getParameter("byusername")).trim();
> > >        if (inUser == null) inUser = "";
> > >        inDate =
> > request.getParameter("bydate").trim();
> > >        if (inDate == null) inDate = "";
> > >        inIPadd =
> > > request.getParameter("byipaddress").trim();
> > >        if (inIPadd == null) inIPadd = "";
> > >
> > >     }catch(NullPointerException npe){
> > >             out.println("Please choose a query option.");
> > >
> > >     }
> > >
> > >       PreparedStatement ps = null;
> > >          /* Log user access count to the system */
> > >
> > >     SQLManager thisManager = null;
> > >     if (thisManager == null)
> > >       thisManager = SQLManager.getInstance();
> > >
> > >     Connection myConn = null;
> > >
> > >     if (myConn == null)
> > >        myConn = thisManager.requestConnection();
> > >     if (((inUser != null) && !inUser.equals("") ) ||
> > > ((inDate != null) && !inDate.equals("")) ||
> > ((inIPadd
> > > != null) && !inIPadd.equals("")))
> > >     {
> > >
> > >         java.util.Date today = new
> > java.util.Date();
> > >         java.sql.Timestamp stamp = new
> > > java.sql.Timestamp(today.getTime());
> > >
> > >         String stampStr = stamp.toString();
> > >
> > >         String timeofday =
> > > stampStr.substring(11,stampStr.length());
> > >         String date = stampStr.substring(0,11);
> > >
> > >         String todayatZero = date + "
> > 00:00:00.0000";
> > >
> > >         todayatZero = "2002-08-01 00:00:00.0000";
> > >
> > > inDate += " 00:00:00.0000";
> > >
> > >     boolean ValueEntered = false;
> > > if (((inUser != null)&& (inDate != null) &&
> > (inIPadd
> > > != null)) && (!inUser.equals("") &&
> > !inDate.equals("")
> > > && !inIPadd.equals("")) )
> >
>=== message truncated ===
>
>
>__________________________________________________
>Do You Yahoo!?
>HotJobs - Search Thousands of New Jobs
>http://www.hotjobs.com
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: It would be great IF somebody answered me, ONCE, for change :(

Posted by Mike Jackson <mj...@cdi-hq.com>.
It can, and then you'd have other problems.  I use oracle here and
even though I'm licensed for x connections the database hasn't
yet failed to give me a connection at high load times.  I've got
my scavenge count fairly high with only a 2 minute timeout on the
connections in the pool (user timeout is more).  Seems to work
pretty well for me.  Much better than that connection pool that I
wrote.

--mikej
-=-----
mike jackson
mjackson@cdi-hq.com

> -----Original Message-----
> From: Luminous Heart [mailto:luminousheart@yahoo.com]
> Sent: Monday, August 19, 2002 9:58 AM
> To: Tomcat Users List
> Subject: RE: It would be great IF somebody answered me, ONCE, for change
> :(
>
>
> Thank you Mike,
> I will test with this, although I tried to
> troubleshoot the problem by going back to an older
> version of poolman. It worked. Now I will try your
> solution, that might help. But would the softlimiting
> of the pool run my server out of sockets in case of
> heavy access?
>
>
> --- Mike Jackson <mj...@cdi-hq.com> wrote:
> > Add the following and the limit will be a soft limit
> > (it can go above as
> > needed)
> >
> >     <maximumSoft>true</maximumSoft>
> >
> >
> > --mikej
> > -=-----
> > mike jackson
> > mjackson@cdi-hq.com
> >
> > > -----Original Message-----
> > > From: Luminous Heart
> > [mailto:luminousheart@yahoo.com]
> > > Sent: Monday, August 19, 2002 8:50 AM
> > > To: Tomcat Users List
> > > Subject: RE: It would be great IF somebody
> > answered me, ONCE, for change
> > > :(
> > >
> > >
> > > I am sorry, but I did not get what you mean with
> > > connection limit to be a hard limit, which one is
> > > that?
> > >
> > > I am including a copy of my pool.xml if you care
> > do
> > > point out what should be changed.
> > >
> > > Thank you in advance.
> > >
> > > ==================== Pool.xml
> > =====================
> > > <?xml version="1.0" encoding="UTF-8"?>
> > >
> > > <poolman>
> > >
> > >   <management-mode>local</management-mode>
> > >
> > >   <datasource>
> > >
> > >     <!-- ============================== -->
> > >     <!-- Physical Connection Attributes -->
> > >     <!-- ============================== -->
> > >
> > >     <!-- Standard JDBC Driver info -->
> > >
> > >     <dbname>webdev</dbname>
> > >     <jndiName>webdev</jndiName>
> > >     <driver>org.postgresql.Driver</driver>
> > >
> > <url>jdbc:postgresql://localhost:6093/webdev</url>
> > >
> > >     <username>JustAUserName</username>
> > >     <password>JustAUserNamePassword</password>
> > >
> > >     <!-- Oracle needs this to be set to true -->
> > >     <nativeResults>true</nativeResults>
> > >
> > >     <minimumSize>1</minimumSize>
> > >     <maximumSize>10</maximumSize>
> > >     <connectionTimeout>600</connectionTimeout>
> > >     <userTimeout>12</userTimeout>
> > >     <shrinkBy>10</shrinkBy>
> > >
> > >
> > >
> >
> <logFile>/usr/local/tomcat/logs/poolman.log</logFile>
> > >     <debugging>false</debugging>
> > >
> > >     <!-- Query Cache Attributes-->
> > >
> > >     <cacheEnabled>false</cacheEnabled>
> > >     <cacheSize>20</cacheSize>
> > >
> > <cacheRefreshInterval>120</cacheRefreshInterval>
> > >
> > >   </datasource>
> > >
> > > </poolman>
> > >
> > > ==================== End Pool.xml
> > =================
> > > --- Mike Jackson <mj...@cdi-hq.com> wrote:
> > > > Actually now that I think about it more that
> > might
> > > > be the cause of the null
> > > > pointer (but
> > > > probably not).  In your poolman.xml file have
> > you
> > > > set the connection limit
> > > > to be a hard
> > > > limit?  If you timeout on connections (user
> > timeout)
> > > > is fairly high you
> > > > could run out of
> > > > connections, and it might return a "null"
> > instead of
> > > > a connection.
> > > >
> > > > But that's just a guess.  Also, you might was to
> > > > also turn on logging (debug
> > > > level) in
> > > > poolman as well so that you can watch the
> > > > connections getting checked out
> > > > and in.
> > > >
> > > > --mikej
> > > > -=-----
> > > > mike jackson
> > > > mjackson@cdi-hq.com
> > > >
> > > > > -----Original Message-----
> > > > > From: Luminous Heart
> > > > [mailto:luminousheart@yahoo.com]
> > > > > Sent: Monday, August 19, 2002 8:36 AM
> > > > > To: Tomcat Users List
> > > > > Subject: Re: It would be great IF somebody
> > > > answered me, ONCE, for change
> > > > > :(
> > > > >
> > > > >
> > > > > Hi Graig,
> > > > > Here is my jsp file. I am not sure what might
> > be
> > > > > wrong. Although the same error happens in a
> > bigger
> > > > > application in a tc cluster of 3 tomcats. Two
> > of
> > > > these
> > > > > tcs fail while one does not get any forwards
> > after
> > > > > that.
> > > > >
> > > > > Please take a look at my code, if you do not
> > mind.
> > > > >
> > > > > Best regards.
> > > > >
> > > > > ===================== JSP
> > =====================
> > > > > <%@ page import="java.io.*" %>
> > > > > <%@ page import="java.util.*" %>
> > > > > <%@ page import="java.text.*" %>
> > > > >
> > > > > <%@ page import="java.util.Properties" %>
> > > > > <%@ page import="java.util.Date" %>
> > > > >
> > > > > <%@ page contentType="text/html"%>
> > > > >
> > > > > <%@ page import="com.codestudio.util.*"%>
> > > > > <%@ page import="java.sql.*"%>
> > > > >
> > > > > <!-- %@ include file="no-cache.jsp" % -->
> > > > >
> > > > > <form action="UserAccount.jsp" method=post
> > > > > name="access_form">
> > > > >   <table width="90%" align="center">
> > > > >   <tr>
> > > > >               <th bgcolor="#CCCCFF" colspan=3>
> > > > <font
> > > > > size=5>User Access</font></th>
> > > > >
> > > > >     <td>&nbsp;</td>
> > > > >     <td>&nbsp;</td>
> > > > >     <td>&nbsp;</td>
> > > > >   </tr>
> > > > >   <tr>
> > > > >     <td>
> > > > >         <center>
> > > > >           <table cellpadding=4 cellspacing=2
> > > > border=0>
> > > > >             <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > > size=5>User Access by userid</font></th>
> > > > >             <tr bgcolor="#c8d8f8">
> > > > >               <td valign=top colspan=2>
> > <b>User
> > > > > Name</b><br>
> > > > >                 <input type="text"
> > > > name="byusername"
> > > > > size=25 value=""  maxlength=25>
> > > > >               </td>
> > > > >             </tr>
> > > > >           </table>
> > > > > </center>
> > > > > </td>
> > > > >     <td>
> > > > >         <center>
> > > > >           <table cellpadding=4 cellspacing=2
> > > > border=0>
> > > > >             <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > > size=5>User Access by Date</font><font
> > > > size=1></font>
> > > > >             </th>
> > > > >             <tr bgcolor="#c8d8f8">
> > > > >               <td valign=top> <b>Date</b><br>
> > > > >                 <input type="text"
> > name="bydate"
> >
> === message truncated ===
>
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: It would be great IF somebody answered me, ONCE, for change :(

Posted by Luminous Heart <lu...@yahoo.com>.
Thank you Mike,
I will test with this, although I tried to
troubleshoot the problem by going back to an older
version of poolman. It worked. Now I will try your
solution, that might help. But would the softlimiting
of the pool run my server out of sockets in case of
heavy access?


--- Mike Jackson <mj...@cdi-hq.com> wrote:
> Add the following and the limit will be a soft limit
> (it can go above as
> needed)
> 
>     <maximumSoft>true</maximumSoft>
> 
> 
> --mikej
> -=-----
> mike jackson
> mjackson@cdi-hq.com
> 
> > -----Original Message-----
> > From: Luminous Heart
> [mailto:luminousheart@yahoo.com]
> > Sent: Monday, August 19, 2002 8:50 AM
> > To: Tomcat Users List
> > Subject: RE: It would be great IF somebody
> answered me, ONCE, for change
> > :(
> >
> >
> > I am sorry, but I did not get what you mean with
> > connection limit to be a hard limit, which one is
> > that?
> >
> > I am including a copy of my pool.xml if you care
> do
> > point out what should be changed.
> >
> > Thank you in advance.
> >
> > ==================== Pool.xml
> =====================
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <poolman>
> >
> >   <management-mode>local</management-mode>
> >
> >   <datasource>
> >
> >     <!-- ============================== -->
> >     <!-- Physical Connection Attributes -->
> >     <!-- ============================== -->
> >
> >     <!-- Standard JDBC Driver info -->
> >
> >     <dbname>webdev</dbname>
> >     <jndiName>webdev</jndiName>
> >     <driver>org.postgresql.Driver</driver>
> >    
> <url>jdbc:postgresql://localhost:6093/webdev</url>
> >
> >     <username>JustAUserName</username>
> >     <password>JustAUserNamePassword</password>
> >
> >     <!-- Oracle needs this to be set to true -->
> >     <nativeResults>true</nativeResults>
> >
> >     <minimumSize>1</minimumSize>
> >     <maximumSize>10</maximumSize>
> >     <connectionTimeout>600</connectionTimeout>
> >     <userTimeout>12</userTimeout>
> >     <shrinkBy>10</shrinkBy>
> >
> >
> >
>
<logFile>/usr/local/tomcat/logs/poolman.log</logFile>
> >     <debugging>false</debugging>
> >
> >     <!-- Query Cache Attributes-->
> >
> >     <cacheEnabled>false</cacheEnabled>
> >     <cacheSize>20</cacheSize>
> >    
> <cacheRefreshInterval>120</cacheRefreshInterval>
> >
> >   </datasource>
> >
> > </poolman>
> >
> > ==================== End Pool.xml
> =================
> > --- Mike Jackson <mj...@cdi-hq.com> wrote:
> > > Actually now that I think about it more that
> might
> > > be the cause of the null
> > > pointer (but
> > > probably not).  In your poolman.xml file have
> you
> > > set the connection limit
> > > to be a hard
> > > limit?  If you timeout on connections (user
> timeout)
> > > is fairly high you
> > > could run out of
> > > connections, and it might return a "null"
> instead of
> > > a connection.
> > >
> > > But that's just a guess.  Also, you might was to
> > > also turn on logging (debug
> > > level) in
> > > poolman as well so that you can watch the
> > > connections getting checked out
> > > and in.
> > >
> > > --mikej
> > > -=-----
> > > mike jackson
> > > mjackson@cdi-hq.com
> > >
> > > > -----Original Message-----
> > > > From: Luminous Heart
> > > [mailto:luminousheart@yahoo.com]
> > > > Sent: Monday, August 19, 2002 8:36 AM
> > > > To: Tomcat Users List
> > > > Subject: Re: It would be great IF somebody
> > > answered me, ONCE, for change
> > > > :(
> > > >
> > > >
> > > > Hi Graig,
> > > > Here is my jsp file. I am not sure what might
> be
> > > > wrong. Although the same error happens in a
> bigger
> > > > application in a tc cluster of 3 tomcats. Two
> of
> > > these
> > > > tcs fail while one does not get any forwards
> after
> > > > that.
> > > >
> > > > Please take a look at my code, if you do not
> mind.
> > > >
> > > > Best regards.
> > > >
> > > > ===================== JSP
> =====================
> > > > <%@ page import="java.io.*" %>
> > > > <%@ page import="java.util.*" %>
> > > > <%@ page import="java.text.*" %>
> > > >
> > > > <%@ page import="java.util.Properties" %>
> > > > <%@ page import="java.util.Date" %>
> > > >
> > > > <%@ page contentType="text/html"%>
> > > >
> > > > <%@ page import="com.codestudio.util.*"%>
> > > > <%@ page import="java.sql.*"%>
> > > >
> > > > <!-- %@ include file="no-cache.jsp" % -->
> > > >
> > > > <form action="UserAccount.jsp" method=post
> > > > name="access_form">
> > > >   <table width="90%" align="center">
> > > >   <tr>
> > > >               <th bgcolor="#CCCCFF" colspan=3>
> > > <font
> > > > size=5>User Access</font></th>
> > > >
> > > >     <td>&nbsp;</td>
> > > >     <td>&nbsp;</td>
> > > >     <td>&nbsp;</td>
> > > >   </tr>
> > > >   <tr>
> > > >     <td>
> > > >         <center>
> > > >           <table cellpadding=4 cellspacing=2
> > > border=0>
> > > >             <th bgcolor="#CCCCFF" colspan=2>
> <font
> > > > size=5>User Access by userid</font></th>
> > > >             <tr bgcolor="#c8d8f8">
> > > >               <td valign=top colspan=2>
> <b>User
> > > > Name</b><br>
> > > >                 <input type="text"
> > > name="byusername"
> > > > size=25 value=""  maxlength=25>
> > > >               </td>
> > > >             </tr>
> > > >           </table>
> > > > </center>
> > > > </td>
> > > >     <td>
> > > >         <center>
> > > >           <table cellpadding=4 cellspacing=2
> > > border=0>
> > > >             <th bgcolor="#CCCCFF" colspan=2>
> <font
> > > > size=5>User Access by Date</font><font
> > > size=1></font>
> > > >             </th>
> > > >             <tr bgcolor="#c8d8f8">
> > > >               <td valign=top> <b>Date</b><br>
> > > >                 <input type="text"
> name="bydate"
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: It would be great IF somebody answered me, ONCE, for change :(

Posted by Mike Jackson <mj...@cdi-hq.com>.
Add the following and the limit will be a soft limit (it can go above as
needed)

    <maximumSoft>true</maximumSoft>


--mikej
-=-----
mike jackson
mjackson@cdi-hq.com

> -----Original Message-----
> From: Luminous Heart [mailto:luminousheart@yahoo.com]
> Sent: Monday, August 19, 2002 8:50 AM
> To: Tomcat Users List
> Subject: RE: It would be great IF somebody answered me, ONCE, for change
> :(
>
>
> I am sorry, but I did not get what you mean with
> connection limit to be a hard limit, which one is
> that?
>
> I am including a copy of my pool.xml if you care do
> point out what should be changed.
>
> Thank you in advance.
>
> ==================== Pool.xml =====================
> <?xml version="1.0" encoding="UTF-8"?>
>
> <poolman>
>
>   <management-mode>local</management-mode>
>
>   <datasource>
>
>     <!-- ============================== -->
>     <!-- Physical Connection Attributes -->
>     <!-- ============================== -->
>
>     <!-- Standard JDBC Driver info -->
>
>     <dbname>webdev</dbname>
>     <jndiName>webdev</jndiName>
>     <driver>org.postgresql.Driver</driver>
>     <url>jdbc:postgresql://localhost:6093/webdev</url>
>
>     <username>JustAUserName</username>
>     <password>JustAUserNamePassword</password>
>
>     <!-- Oracle needs this to be set to true -->
>     <nativeResults>true</nativeResults>
>
>     <minimumSize>1</minimumSize>
>     <maximumSize>10</maximumSize>
>     <connectionTimeout>600</connectionTimeout>
>     <userTimeout>12</userTimeout>
>     <shrinkBy>10</shrinkBy>
>
>
> <logFile>/usr/local/tomcat/logs/poolman.log</logFile>
>     <debugging>false</debugging>
>
>     <!-- Query Cache Attributes-->
>
>     <cacheEnabled>false</cacheEnabled>
>     <cacheSize>20</cacheSize>
>     <cacheRefreshInterval>120</cacheRefreshInterval>
>
>   </datasource>
>
> </poolman>
>
> ==================== End Pool.xml =================
> --- Mike Jackson <mj...@cdi-hq.com> wrote:
> > Actually now that I think about it more that might
> > be the cause of the null
> > pointer (but
> > probably not).  In your poolman.xml file have you
> > set the connection limit
> > to be a hard
> > limit?  If you timeout on connections (user timeout)
> > is fairly high you
> > could run out of
> > connections, and it might return a "null" instead of
> > a connection.
> >
> > But that's just a guess.  Also, you might was to
> > also turn on logging (debug
> > level) in
> > poolman as well so that you can watch the
> > connections getting checked out
> > and in.
> >
> > --mikej
> > -=-----
> > mike jackson
> > mjackson@cdi-hq.com
> >
> > > -----Original Message-----
> > > From: Luminous Heart
> > [mailto:luminousheart@yahoo.com]
> > > Sent: Monday, August 19, 2002 8:36 AM
> > > To: Tomcat Users List
> > > Subject: Re: It would be great IF somebody
> > answered me, ONCE, for change
> > > :(
> > >
> > >
> > > Hi Graig,
> > > Here is my jsp file. I am not sure what might be
> > > wrong. Although the same error happens in a bigger
> > > application in a tc cluster of 3 tomcats. Two of
> > these
> > > tcs fail while one does not get any forwards after
> > > that.
> > >
> > > Please take a look at my code, if you do not mind.
> > >
> > > Best regards.
> > >
> > > ===================== JSP =====================
> > > <%@ page import="java.io.*" %>
> > > <%@ page import="java.util.*" %>
> > > <%@ page import="java.text.*" %>
> > >
> > > <%@ page import="java.util.Properties" %>
> > > <%@ page import="java.util.Date" %>
> > >
> > > <%@ page contentType="text/html"%>
> > >
> > > <%@ page import="com.codestudio.util.*"%>
> > > <%@ page import="java.sql.*"%>
> > >
> > > <!-- %@ include file="no-cache.jsp" % -->
> > >
> > > <form action="UserAccount.jsp" method=post
> > > name="access_form">
> > >   <table width="90%" align="center">
> > >   <tr>
> > >               <th bgcolor="#CCCCFF" colspan=3>
> > <font
> > > size=5>User Access</font></th>
> > >
> > >     <td>&nbsp;</td>
> > >     <td>&nbsp;</td>
> > >     <td>&nbsp;</td>
> > >   </tr>
> > >   <tr>
> > >     <td>
> > >         <center>
> > >           <table cellpadding=4 cellspacing=2
> > border=0>
> > >             <th bgcolor="#CCCCFF" colspan=2> <font
> > > size=5>User Access by userid</font></th>
> > >             <tr bgcolor="#c8d8f8">
> > >               <td valign=top colspan=2> <b>User
> > > Name</b><br>
> > >                 <input type="text"
> > name="byusername"
> > > size=25 value=""  maxlength=25>
> > >               </td>
> > >             </tr>
> > >           </table>
> > > </center>
> > > </td>
> > >     <td>
> > >         <center>
> > >           <table cellpadding=4 cellspacing=2
> > border=0>
> > >             <th bgcolor="#CCCCFF" colspan=2> <font
> > > size=5>User Access by Date</font><font
> > size=1></font>
> > >             </th>
> > >             <tr bgcolor="#c8d8f8">
> > >               <td valign=top> <b>Date</b><br>
> > >                 <input type="text" name="bydate"
> > > value="" size=25  maxlength=125>
> > >                 <br>
> > >               </td>
> > >             </tr>
> > >           </table>
> > > </center>
> > > </td>
> > >     <td>
> > >         <center>
> > >           <table cellpadding=4 cellspacing=2
> > border=0>
> > >             <th bgcolor="#CCCCFF" colspan=2> <font
> > > size=5>USER Access by IP Address</font>
> > >             </th>
> > >             <tr bgcolor="#c8d8f8">
> > >               <td valign=top> <b>IP
> > Address</b><br>
> > >                 <input type="text"
> > name="byipaddress"
> > > value="" size=25  maxlength=125>
> > >                 <br>
> > >               </td>
> > >             </tr>
> > >           </table>
> > > </center>
> > > </td>
> > >   </tr>
> > >   <tr>
> > >     <td>&nbsp;</td>
> > >     <td align="center" bgcolor="#c8d8f8">
> > >       <input type="submit" value="Submit"
> > > name="submit">
> > >     </td>
> > >     <td>&nbsp;</td>
> > >   </tr>
> > > </table>
> > > </form>
> > > <%
> > > 	String inUser = null;
> > > 		String inDate = null;
> > > 		String inIPadd = null;
> > >
> > > 	try{
> > > 	   inUser =
> > > (request.getParameter("byusername")).trim();
> > > 	   if (inUser == null) inUser = "";
> > > 	   inDate =
> > request.getParameter("bydate").trim();
> > > 	   if (inDate == null) inDate = "";
> > > 	   inIPadd =
> > > request.getParameter("byipaddress").trim();
> > > 	   if (inIPadd == null) inIPadd = "";
> > >
> > > 	}catch(NullPointerException npe){
> > > 		out.println("Please choose a query option.");
> > >
> > > 	}
> > >
> > > 	  PreparedStatement ps = null;
> > >          /* Log user access count to the system */
> > >
> > >     SQLManager thisManager = null;
> > >     if (thisManager == null)
> > >       thisManager = SQLManager.getInstance();
> > >
> > >     Connection myConn = null;
> > >
> > > 	 if (myConn == null)
> > > 	   myConn = thisManager.requestConnection();
> > > 	if (((inUser != null) && !inUser.equals("") ) ||
> > > ((inDate != null) && !inDate.equals("")) ||
> > ((inIPadd
> > > != null) && !inIPadd.equals("")))
> > > 	{
> > >
> > >         java.util.Date today = new
> > java.util.Date();
> > >         java.sql.Timestamp stamp = new
> > > java.sql.Timestamp(today.getTime());
> > >
> > >         String stampStr = stamp.toString();
> > >
> > >         String timeofday =
> > > stampStr.substring(11,stampStr.length());
> > >         String date = stampStr.substring(0,11);
> > >
> > >         String todayatZero = date + "
> > 00:00:00.0000";
> > >
> > >         todayatZero = "2002-08-01 00:00:00.0000";
> > >
> > > inDate += " 00:00:00.0000";
> > >
> > > 	boolean ValueEntered = false;
> > > if (((inUser != null)&& (inDate != null) &&
> > (inIPadd
> > > != null)) && (!inUser.equals("") &&
> > !inDate.equals("")
> > > && !inIPadd.equals("")) )
> >
> === message truncated ===
>
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Craig, PoolMan, latest version WAS the problem.

Posted by Mike Jackson <mj...@cdi-hq.com>.
Did you try using a soft limit?  That combined with a larger
scavenge count and a shorter time limit on the connections
(not the user time limit) should allow you to scale decently.

Also you really should check the connection to be sure that
it's not a null connection prior to using it.  That should
also elminate the problem, but you'd have to add some code
to handle when it's not there (retry acquiring a connection
most likely).

--mikej
-=-----
mike jackson
mjackson@cdi-hq.com

> -----Original Message-----
> From: Luminous Heart [mailto:luminousheart@yahoo.com]
> Sent: Monday, August 19, 2002 9:54 AM
> To: Tomcat Users List
> Subject: Craig, PoolMan, latest version WAS the problem.
>
>
> Ok. I reverted to an older version of PoolMan, where
> we use pool.prop instead of pool.xml. That version
> works fine. I have not hit the exception although I
> tested it for sometime.
>
> Does that mean am stuck to the older poolman? Is there
> a better solution to handle database pooling?
>
> Thank you.
>
> --- Luminous Heart <lu...@yahoo.com> wrote:
> > I am sorry, but I did not get what you mean with
> > connection limit to be a hard limit, which one is
> > that?
> >
> > I am including a copy of my pool.xml if you care do
> > point out what should be changed.
> >
> > Thank you in advance.
> >
> > ==================== Pool.xml =====================
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <poolman>
> >
> >   <management-mode>local</management-mode>
> >
> >   <datasource>
> >
> >     <!-- ============================== -->
> >     <!-- Physical Connection Attributes -->
> >     <!-- ============================== -->
> >
> >     <!-- Standard JDBC Driver info -->
> >
> >     <dbname>webdev</dbname>
> >     <jndiName>webdev</jndiName>
> >     <driver>org.postgresql.Driver</driver>
> >
> > <url>jdbc:postgresql://localhost:6093/webdev</url>
> >
> >     <username>JustAUserName</username>
> >     <password>JustAUserNamePassword</password>
> >
> >     <!-- Oracle needs this to be set to true -->
> >     <nativeResults>true</nativeResults>
> >
> >     <minimumSize>1</minimumSize>
> >     <maximumSize>10</maximumSize>
> >     <connectionTimeout>600</connectionTimeout>
> >     <userTimeout>12</userTimeout>
> >     <shrinkBy>10</shrinkBy>
> >
> >
> >
> <logFile>/usr/local/tomcat/logs/poolman.log</logFile>
> >     <debugging>false</debugging>
> >
> >     <!-- Query Cache Attributes-->
> >
> >     <cacheEnabled>false</cacheEnabled>
> >     <cacheSize>20</cacheSize>
> >     <cacheRefreshInterval>120</cacheRefreshInterval>
> >
> >   </datasource>
> >
> > </poolman>
> >
> > ==================== End Pool.xml =================
> > --- Mike Jackson <mj...@cdi-hq.com> wrote:
> > > Actually now that I think about it more that might
> > > be the cause of the null
> > > pointer (but
> > > probably not).  In your poolman.xml file have you
> > > set the connection limit
> > > to be a hard
> > > limit?  If you timeout on connections (user
> > timeout)
> > > is fairly high you
> > > could run out of
> > > connections, and it might return a "null" instead
> > of
> > > a connection.
> > >
> > > But that's just a guess.  Also, you might was to
> > > also turn on logging (debug
> > > level) in
> > > poolman as well so that you can watch the
> > > connections getting checked out
> > > and in.
> > >
> > > --mikej
> > > -=-----
> > > mike jackson
> > > mjackson@cdi-hq.com
> > >
> > > > -----Original Message-----
> > > > From: Luminous Heart
> > > [mailto:luminousheart@yahoo.com]
> > > > Sent: Monday, August 19, 2002 8:36 AM
> > > > To: Tomcat Users List
> > > > Subject: Re: It would be great IF somebody
> > > answered me, ONCE, for change
> > > > :(
> > > >
> > > >
> > > > Hi Graig,
> > > > Here is my jsp file. I am not sure what might be
> > > > wrong. Although the same error happens in a
> > bigger
> > > > application in a tc cluster of 3 tomcats. Two of
> > > these
> > > > tcs fail while one does not get any forwards
> > after
> > > > that.
> > > >
> > > > Please take a look at my code, if you do not
> > mind.
> > > >
> > > > Best regards.
> > > >
> > > > ===================== JSP =====================
> > > > <%@ page import="java.io.*" %>
> > > > <%@ page import="java.util.*" %>
> > > > <%@ page import="java.text.*" %>
> > > >
> > > > <%@ page import="java.util.Properties" %>
> > > > <%@ page import="java.util.Date" %>
> > > >
> > > > <%@ page contentType="text/html"%>
> > > >
> > > > <%@ page import="com.codestudio.util.*"%>
> > > > <%@ page import="java.sql.*"%>
> > > >
> > > > <!-- %@ include file="no-cache.jsp" % -->
> > > >
> > > > <form action="UserAccount.jsp" method=post
> > > > name="access_form">
> > > >   <table width="90%" align="center">
> > > >   <tr>
> > > >               <th bgcolor="#CCCCFF" colspan=3>
> > > <font
> > > > size=5>User Access</font></th>
> > > >
> > > >     <td>&nbsp;</td>
> > > >     <td>&nbsp;</td>
> > > >     <td>&nbsp;</td>
> > > >   </tr>
> > > >   <tr>
> > > >     <td>
> > > >         <center>
> > > >           <table cellpadding=4 cellspacing=2
> > > border=0>
> > > >             <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > size=5>User Access by userid</font></th>
> > > >             <tr bgcolor="#c8d8f8">
> > > >               <td valign=top colspan=2> <b>User
> > > > Name</b><br>
> > > >                 <input type="text"
> > > name="byusername"
> > > > size=25 value=""  maxlength=25>
> > > >               </td>
> > > >             </tr>
> > > >           </table>
> > > > </center>
> > > > </td>
> > > >     <td>
> > > >         <center>
> > > >           <table cellpadding=4 cellspacing=2
> > > border=0>
> > > >             <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > size=5>User Access by Date</font><font
> > > size=1></font>
> > > >             </th>
> > > >             <tr bgcolor="#c8d8f8">
> > > >               <td valign=top> <b>Date</b><br>
> > > >                 <input type="text" name="bydate"
> > > > value="" size=25  maxlength=125>
> > > >                 <br>
> > > >               </td>
> > > >             </tr>
> > > >           </table>
> > > > </center>
> > > > </td>
> > > >     <td>
> > > >         <center>
> > > >           <table cellpadding=4 cellspacing=2
> > > border=0>
> > > >             <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > size=5>USER Access by IP Address</font>
> > > >             </th>
> > > >             <tr bgcolor="#c8d8f8">
> > > >               <td valign=top> <b>IP
> > > Address</b><br>
> > > >                 <input type="text"
> > > name="byipaddress"
> > > > value="" size=25  maxlength=125>
> > > >                 <br>
> > > >               </td>
> > > >             </tr>
> > > >           </table>
> > > > </center>
> > > > </td>
> > > >   </tr>
> > > >   <tr>
> > > >     <td>&nbsp;</td>
> > > >     <td align="center" bgcolor="#c8d8f8">
> > > >       <input type="submit" value="Submit"
> > > > name="submit">
> > > >     </td>
> >
> === message truncated ===
>
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Craig, PoolMan, latest version WAS the problem.

Posted by Andrew Conrad <an...@attbi.com>.
Instead of using poolman, you could use dbcp.  It's the default
connection pool for TC 4.1.x

http://jakarta.apache.org/commons/dbcp.html

- Andrew

> -----Original Message-----
> From: Luminous Heart [mailto:luminousheart@yahoo.com] 
> Sent: Monday, August 19, 2002 12:54 PM
> To: Tomcat Users List
> Subject: Craig, PoolMan, latest version WAS the problem.
> 
> 
> Ok. I reverted to an older version of PoolMan, where
> we use pool.prop instead of pool.xml. That version
> works fine. I have not hit the exception although I
> tested it for sometime. 
> 
> Does that mean am stuck to the older poolman? Is there
> a better solution to handle database pooling?
> 
> Thank you.
> 
> --- Luminous Heart <lu...@yahoo.com> wrote:
> > I am sorry, but I did not get what you mean with
> > connection limit to be a hard limit, which one is
> > that?
> > 
> > I am including a copy of my pool.xml if you care do
> > point out what should be changed.
> > 
> > Thank you in advance.
> > 
> > ==================== Pool.xml =====================
> > <?xml version="1.0" encoding="UTF-8"?>
> > 
> > <poolman>
> > 
> >   <management-mode>local</management-mode>
> > 
> >   <datasource>
> > 
> >     <!-- ============================== -->
> >     <!-- Physical Connection Attributes -->
> >     <!-- ============================== -->
> > 
> >     <!-- Standard JDBC Driver info -->
> > 
> >     <dbname>webdev</dbname>
> >     <jndiName>webdev</jndiName>
> >     <driver>org.postgresql.Driver</driver>
> >    
> > <url>jdbc:postgresql://localhost:6093/webdev</url>
> > 
> >     <username>JustAUserName</username>
> >     <password>JustAUserNamePassword</password>
> > 
> >     <!-- Oracle needs this to be set to true -->
> >     <nativeResults>true</nativeResults>
> > 
> >     <minimumSize>1</minimumSize>
> >     <maximumSize>10</maximumSize>
> >     <connectionTimeout>600</connectionTimeout>
> >     <userTimeout>12</userTimeout>
> >     <shrinkBy>10</shrinkBy>
> > 
> >    
> >
> <logFile>/usr/local/tomcat/logs/poolman.log</logFile>
> >     <debugging>false</debugging>
> > 
> >     <!-- Query Cache Attributes-->
> > 
> >     <cacheEnabled>false</cacheEnabled>
> >     <cacheSize>20</cacheSize>
> >     <cacheRefreshInterval>120</cacheRefreshInterval>
> > 
> >   </datasource>
> > 
> > </poolman>
> > 
> > ==================== End Pool.xml =================
> > --- Mike Jackson <mj...@cdi-hq.com> wrote:
> > > Actually now that I think about it more that might
> > > be the cause of the null
> > > pointer (but
> > > probably not).  In your poolman.xml file have you
> > > set the connection limit
> > > to be a hard
> > > limit?  If you timeout on connections (user
> > timeout)
> > > is fairly high you
> > > could run out of
> > > connections, and it might return a "null" instead
> > of
> > > a connection.
> > > 
> > > But that's just a guess.  Also, you might was to
> > > also turn on logging (debug
> > > level) in
> > > poolman as well so that you can watch the
> > > connections getting checked out
> > > and in.
> > > 
> > > --mikej
> > > -=-----
> > > mike jackson
> > > mjackson@cdi-hq.com
> > > 
> > > > -----Original Message-----
> > > > From: Luminous Heart
> > > [mailto:luminousheart@yahoo.com]
> > > > Sent: Monday, August 19, 2002 8:36 AM
> > > > To: Tomcat Users List
> > > > Subject: Re: It would be great IF somebody
> > > answered me, ONCE, for change
> > > > :(
> > > >
> > > >
> > > > Hi Graig,
> > > > Here is my jsp file. I am not sure what might be
> > > > wrong. Although the same error happens in a
> > bigger
> > > > application in a tc cluster of 3 tomcats. Two of
> > > these
> > > > tcs fail while one does not get any forwards
> > after
> > > > that.
> > > >
> > > > Please take a look at my code, if you do not
> > mind.
> > > >
> > > > Best regards.
> > > >
> > > > ===================== JSP =====================
> > > > <%@ page import="java.io.*" %>
> > > > <%@ page import="java.util.*" %>
> > > > <%@ page import="java.text.*" %>
> > > >
> > > > <%@ page import="java.util.Properties" %>
> > > > <%@ page import="java.util.Date" %>
> > > >
> > > > <%@ page contentType="text/html"%>
> > > >
> > > > <%@ page import="com.codestudio.util.*"%>
> > > > <%@ page import="java.sql.*"%>
> > > >
> > > > <!-- %@ include file="no-cache.jsp" % -->
> > > >
> > > > <form action="UserAccount.jsp" method=post name="access_form">
> > > >   <table width="90%" align="center">
> > > >   <tr>
> > > >               <th bgcolor="#CCCCFF" colspan=3>
> > > <font
> > > > size=5>User Access</font></th>
> > > >
> > > >     <td>&nbsp;</td>
> > > >     <td>&nbsp;</td>
> > > >     <td>&nbsp;</td>
> > > >   </tr>
> > > >   <tr>
> > > >     <td>
> > > >         <center>
> > > >           <table cellpadding=4 cellspacing=2
> > > border=0>
> > > >             <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > size=5>User Access by userid</font></th>
> > > >             <tr bgcolor="#c8d8f8">
> > > >               <td valign=top colspan=2> <b>User Name</b><br>
> > > >                 <input type="text"
> > > name="byusername"
> > > > size=25 value=""  maxlength=25>
> > > >               </td>
> > > >             </tr>
> > > >           </table>
> > > > </center>
> > > > </td>
> > > >     <td>
> > > >         <center>
> > > >           <table cellpadding=4 cellspacing=2
> > > border=0>
> > > >             <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > size=5>User Access by Date</font><font
> > > size=1></font>
> > > >             </th>
> > > >             <tr bgcolor="#c8d8f8">
> > > >               <td valign=top> <b>Date</b><br>
> > > >                 <input type="text" name="bydate"
> > > > value="" size=25  maxlength=125>
> > > >                 <br>
> > > >               </td>
> > > >             </tr>
> > > >           </table>
> > > > </center>
> > > > </td>
> > > >     <td>
> > > >         <center>
> > > >           <table cellpadding=4 cellspacing=2
> > > border=0>
> > > >             <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > size=5>USER Access by IP Address</font>
> > > >             </th>
> > > >             <tr bgcolor="#c8d8f8">
> > > >               <td valign=top> <b>IP
> > > Address</b><br>
> > > >                 <input type="text"
> > > name="byipaddress"
> > > > value="" size=25  maxlength=125>
> > > >                 <br>
> > > >               </td>
> > > >             </tr>
> > > >           </table>
> > > > </center>
> > > > </td>
> > > >   </tr>
> > > >   <tr>
> > > >     <td>&nbsp;</td>
> > > >     <td align="center" bgcolor="#c8d8f8">
> > > >       <input type="submit" value="Submit"
> > > > name="submit">
> > > >     </td>
> > 
> === message truncated ===
> 
> 
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Craig, PoolMan, latest version WAS the problem.

Posted by Luminous Heart <lu...@yahoo.com>.
Ok. I reverted to an older version of PoolMan, where
we use pool.prop instead of pool.xml. That version
works fine. I have not hit the exception although I
tested it for sometime. 

Does that mean am stuck to the older poolman? Is there
a better solution to handle database pooling?

Thank you.

--- Luminous Heart <lu...@yahoo.com> wrote:
> I am sorry, but I did not get what you mean with 
> connection limit to be a hard limit, which one is
> that?
> 
> I am including a copy of my pool.xml if you care do
> point out what should be changed.
> 
> Thank you in advance.
> 
> ==================== Pool.xml =====================
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <poolman>
> 
>   <management-mode>local</management-mode>
> 
>   <datasource>
> 
>     <!-- ============================== -->
>     <!-- Physical Connection Attributes -->
>     <!-- ============================== -->
> 
>     <!-- Standard JDBC Driver info -->
> 
>     <dbname>webdev</dbname>
>     <jndiName>webdev</jndiName>
>     <driver>org.postgresql.Driver</driver>
>    
> <url>jdbc:postgresql://localhost:6093/webdev</url>
> 
>     <username>JustAUserName</username>
>     <password>JustAUserNamePassword</password>
> 
>     <!-- Oracle needs this to be set to true -->
>     <nativeResults>true</nativeResults>
> 
>     <minimumSize>1</minimumSize>
>     <maximumSize>10</maximumSize>
>     <connectionTimeout>600</connectionTimeout>
>     <userTimeout>12</userTimeout>
>     <shrinkBy>10</shrinkBy>
> 
>    
>
<logFile>/usr/local/tomcat/logs/poolman.log</logFile>
>     <debugging>false</debugging>
> 
>     <!-- Query Cache Attributes-->
> 
>     <cacheEnabled>false</cacheEnabled>
>     <cacheSize>20</cacheSize>
>     <cacheRefreshInterval>120</cacheRefreshInterval>
> 
>   </datasource>
> 
> </poolman>
> 
> ==================== End Pool.xml =================
> --- Mike Jackson <mj...@cdi-hq.com> wrote:
> > Actually now that I think about it more that might
> > be the cause of the null
> > pointer (but
> > probably not).  In your poolman.xml file have you
> > set the connection limit
> > to be a hard
> > limit?  If you timeout on connections (user
> timeout)
> > is fairly high you
> > could run out of
> > connections, and it might return a "null" instead
> of
> > a connection.
> > 
> > But that's just a guess.  Also, you might was to
> > also turn on logging (debug
> > level) in
> > poolman as well so that you can watch the
> > connections getting checked out
> > and in.
> > 
> > --mikej
> > -=-----
> > mike jackson
> > mjackson@cdi-hq.com
> > 
> > > -----Original Message-----
> > > From: Luminous Heart
> > [mailto:luminousheart@yahoo.com]
> > > Sent: Monday, August 19, 2002 8:36 AM
> > > To: Tomcat Users List
> > > Subject: Re: It would be great IF somebody
> > answered me, ONCE, for change
> > > :(
> > >
> > >
> > > Hi Graig,
> > > Here is my jsp file. I am not sure what might be
> > > wrong. Although the same error happens in a
> bigger
> > > application in a tc cluster of 3 tomcats. Two of
> > these
> > > tcs fail while one does not get any forwards
> after
> > > that.
> > >
> > > Please take a look at my code, if you do not
> mind.
> > >
> > > Best regards.
> > >
> > > ===================== JSP =====================
> > > <%@ page import="java.io.*" %>
> > > <%@ page import="java.util.*" %>
> > > <%@ page import="java.text.*" %>
> > >
> > > <%@ page import="java.util.Properties" %>
> > > <%@ page import="java.util.Date" %>
> > >
> > > <%@ page contentType="text/html"%>
> > >
> > > <%@ page import="com.codestudio.util.*"%>
> > > <%@ page import="java.sql.*"%>
> > >
> > > <!-- %@ include file="no-cache.jsp" % -->
> > >
> > > <form action="UserAccount.jsp" method=post
> > > name="access_form">
> > >   <table width="90%" align="center">
> > >   <tr>
> > >               <th bgcolor="#CCCCFF" colspan=3>
> > <font
> > > size=5>User Access</font></th>
> > >
> > >     <td>&nbsp;</td>
> > >     <td>&nbsp;</td>
> > >     <td>&nbsp;</td>
> > >   </tr>
> > >   <tr>
> > >     <td>
> > >         <center>
> > >           <table cellpadding=4 cellspacing=2
> > border=0>
> > >             <th bgcolor="#CCCCFF" colspan=2>
> <font
> > > size=5>User Access by userid</font></th>
> > >             <tr bgcolor="#c8d8f8">
> > >               <td valign=top colspan=2> <b>User
> > > Name</b><br>
> > >                 <input type="text"
> > name="byusername"
> > > size=25 value=""  maxlength=25>
> > >               </td>
> > >             </tr>
> > >           </table>
> > > </center>
> > > </td>
> > >     <td>
> > >         <center>
> > >           <table cellpadding=4 cellspacing=2
> > border=0>
> > >             <th bgcolor="#CCCCFF" colspan=2>
> <font
> > > size=5>User Access by Date</font><font
> > size=1></font>
> > >             </th>
> > >             <tr bgcolor="#c8d8f8">
> > >               <td valign=top> <b>Date</b><br>
> > >                 <input type="text" name="bydate"
> > > value="" size=25  maxlength=125>
> > >                 <br>
> > >               </td>
> > >             </tr>
> > >           </table>
> > > </center>
> > > </td>
> > >     <td>
> > >         <center>
> > >           <table cellpadding=4 cellspacing=2
> > border=0>
> > >             <th bgcolor="#CCCCFF" colspan=2>
> <font
> > > size=5>USER Access by IP Address</font>
> > >             </th>
> > >             <tr bgcolor="#c8d8f8">
> > >               <td valign=top> <b>IP
> > Address</b><br>
> > >                 <input type="text"
> > name="byipaddress"
> > > value="" size=25  maxlength=125>
> > >                 <br>
> > >               </td>
> > >             </tr>
> > >           </table>
> > > </center>
> > > </td>
> > >   </tr>
> > >   <tr>
> > >     <td>&nbsp;</td>
> > >     <td align="center" bgcolor="#c8d8f8">
> > >       <input type="submit" value="Submit"
> > > name="submit">
> > >     </td>
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: It would be great IF somebody answered me, ONCE, for change :(

Posted by Luminous Heart <lu...@yahoo.com>.
I am sorry, but I did not get what you mean with 
connection limit to be a hard limit, which one is
that?

I am including a copy of my pool.xml if you care do
point out what should be changed.

Thank you in advance.

==================== Pool.xml =====================
<?xml version="1.0" encoding="UTF-8"?>

<poolman>

  <management-mode>local</management-mode>

  <datasource>

    <!-- ============================== -->
    <!-- Physical Connection Attributes -->
    <!-- ============================== -->

    <!-- Standard JDBC Driver info -->

    <dbname>webdev</dbname>
    <jndiName>webdev</jndiName>
    <driver>org.postgresql.Driver</driver>
    <url>jdbc:postgresql://localhost:6093/webdev</url>

    <username>JustAUserName</username>
    <password>JustAUserNamePassword</password>

    <!-- Oracle needs this to be set to true -->
    <nativeResults>true</nativeResults>

    <minimumSize>1</minimumSize>
    <maximumSize>10</maximumSize>
    <connectionTimeout>600</connectionTimeout>
    <userTimeout>12</userTimeout>
    <shrinkBy>10</shrinkBy>

   
<logFile>/usr/local/tomcat/logs/poolman.log</logFile>
    <debugging>false</debugging>

    <!-- Query Cache Attributes-->

    <cacheEnabled>false</cacheEnabled>
    <cacheSize>20</cacheSize>
    <cacheRefreshInterval>120</cacheRefreshInterval>

  </datasource>

</poolman>

==================== End Pool.xml =================
--- Mike Jackson <mj...@cdi-hq.com> wrote:
> Actually now that I think about it more that might
> be the cause of the null
> pointer (but
> probably not).  In your poolman.xml file have you
> set the connection limit
> to be a hard
> limit?  If you timeout on connections (user timeout)
> is fairly high you
> could run out of
> connections, and it might return a "null" instead of
> a connection.
> 
> But that's just a guess.  Also, you might was to
> also turn on logging (debug
> level) in
> poolman as well so that you can watch the
> connections getting checked out
> and in.
> 
> --mikej
> -=-----
> mike jackson
> mjackson@cdi-hq.com
> 
> > -----Original Message-----
> > From: Luminous Heart
> [mailto:luminousheart@yahoo.com]
> > Sent: Monday, August 19, 2002 8:36 AM
> > To: Tomcat Users List
> > Subject: Re: It would be great IF somebody
> answered me, ONCE, for change
> > :(
> >
> >
> > Hi Graig,
> > Here is my jsp file. I am not sure what might be
> > wrong. Although the same error happens in a bigger
> > application in a tc cluster of 3 tomcats. Two of
> these
> > tcs fail while one does not get any forwards after
> > that.
> >
> > Please take a look at my code, if you do not mind.
> >
> > Best regards.
> >
> > ===================== JSP =====================
> > <%@ page import="java.io.*" %>
> > <%@ page import="java.util.*" %>
> > <%@ page import="java.text.*" %>
> >
> > <%@ page import="java.util.Properties" %>
> > <%@ page import="java.util.Date" %>
> >
> > <%@ page contentType="text/html"%>
> >
> > <%@ page import="com.codestudio.util.*"%>
> > <%@ page import="java.sql.*"%>
> >
> > <!-- %@ include file="no-cache.jsp" % -->
> >
> > <form action="UserAccount.jsp" method=post
> > name="access_form">
> >   <table width="90%" align="center">
> >   <tr>
> >               <th bgcolor="#CCCCFF" colspan=3>
> <font
> > size=5>User Access</font></th>
> >
> >     <td>&nbsp;</td>
> >     <td>&nbsp;</td>
> >     <td>&nbsp;</td>
> >   </tr>
> >   <tr>
> >     <td>
> >         <center>
> >           <table cellpadding=4 cellspacing=2
> border=0>
> >             <th bgcolor="#CCCCFF" colspan=2> <font
> > size=5>User Access by userid</font></th>
> >             <tr bgcolor="#c8d8f8">
> >               <td valign=top colspan=2> <b>User
> > Name</b><br>
> >                 <input type="text"
> name="byusername"
> > size=25 value=""  maxlength=25>
> >               </td>
> >             </tr>
> >           </table>
> > </center>
> > </td>
> >     <td>
> >         <center>
> >           <table cellpadding=4 cellspacing=2
> border=0>
> >             <th bgcolor="#CCCCFF" colspan=2> <font
> > size=5>User Access by Date</font><font
> size=1></font>
> >             </th>
> >             <tr bgcolor="#c8d8f8">
> >               <td valign=top> <b>Date</b><br>
> >                 <input type="text" name="bydate"
> > value="" size=25  maxlength=125>
> >                 <br>
> >               </td>
> >             </tr>
> >           </table>
> > </center>
> > </td>
> >     <td>
> >         <center>
> >           <table cellpadding=4 cellspacing=2
> border=0>
> >             <th bgcolor="#CCCCFF" colspan=2> <font
> > size=5>USER Access by IP Address</font>
> >             </th>
> >             <tr bgcolor="#c8d8f8">
> >               <td valign=top> <b>IP
> Address</b><br>
> >                 <input type="text"
> name="byipaddress"
> > value="" size=25  maxlength=125>
> >                 <br>
> >               </td>
> >             </tr>
> >           </table>
> > </center>
> > </td>
> >   </tr>
> >   <tr>
> >     <td>&nbsp;</td>
> >     <td align="center" bgcolor="#c8d8f8">
> >       <input type="submit" value="Submit"
> > name="submit">
> >     </td>
> >     <td>&nbsp;</td>
> >   </tr>
> > </table>
> > </form>
> > <%
> > 	String inUser = null;
> > 		String inDate = null;
> > 		String inIPadd = null;
> >
> > 	try{
> > 	   inUser =
> > (request.getParameter("byusername")).trim();
> > 	   if (inUser == null) inUser = "";
> > 	   inDate =
> request.getParameter("bydate").trim();
> > 	   if (inDate == null) inDate = "";
> > 	   inIPadd =
> > request.getParameter("byipaddress").trim();
> > 	   if (inIPadd == null) inIPadd = "";
> >
> > 	}catch(NullPointerException npe){
> > 		out.println("Please choose a query option.");
> >
> > 	}
> >
> > 	  PreparedStatement ps = null;
> >          /* Log user access count to the system */
> >
> >     SQLManager thisManager = null;
> >     if (thisManager == null)
> >       thisManager = SQLManager.getInstance();
> >
> >     Connection myConn = null;
> >
> > 	 if (myConn == null)
> > 	   myConn = thisManager.requestConnection();
> > 	if (((inUser != null) && !inUser.equals("") ) ||
> > ((inDate != null) && !inDate.equals("")) ||
> ((inIPadd
> > != null) && !inIPadd.equals("")))
> > 	{
> >
> >         java.util.Date today = new
> java.util.Date();
> >         java.sql.Timestamp stamp = new
> > java.sql.Timestamp(today.getTime());
> >
> >         String stampStr = stamp.toString();
> >
> >         String timeofday =
> > stampStr.substring(11,stampStr.length());
> >         String date = stampStr.substring(0,11);
> >
> >         String todayatZero = date + "
> 00:00:00.0000";
> >
> >         todayatZero = "2002-08-01 00:00:00.0000";
> >
> > inDate += " 00:00:00.0000";
> >
> > 	boolean ValueEntered = false;
> > if (((inUser != null)&& (inDate != null) &&
> (inIPadd
> > != null)) && (!inUser.equals("") &&
> !inDate.equals("")
> > && !inIPadd.equals("")) )
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: It would be great IF somebody answered me, ONCE, for change :(

Posted by Mike Jackson <mj...@cdi-hq.com>.
Actually now that I think about it more that might be the cause of the null
pointer (but
probably not).  In your poolman.xml file have you set the connection limit
to be a hard
limit?  If you timeout on connections (user timeout) is fairly high you
could run out of
connections, and it might return a "null" instead of a connection.

But that's just a guess.  Also, you might was to also turn on logging (debug
level) in
poolman as well so that you can watch the connections getting checked out
and in.

--mikej
-=-----
mike jackson
mjackson@cdi-hq.com

> -----Original Message-----
> From: Luminous Heart [mailto:luminousheart@yahoo.com]
> Sent: Monday, August 19, 2002 8:36 AM
> To: Tomcat Users List
> Subject: Re: It would be great IF somebody answered me, ONCE, for change
> :(
>
>
> Hi Graig,
> Here is my jsp file. I am not sure what might be
> wrong. Although the same error happens in a bigger
> application in a tc cluster of 3 tomcats. Two of these
> tcs fail while one does not get any forwards after
> that.
>
> Please take a look at my code, if you do not mind.
>
> Best regards.
>
> ===================== JSP =====================
> <%@ page import="java.io.*" %>
> <%@ page import="java.util.*" %>
> <%@ page import="java.text.*" %>
>
> <%@ page import="java.util.Properties" %>
> <%@ page import="java.util.Date" %>
>
> <%@ page contentType="text/html"%>
>
> <%@ page import="com.codestudio.util.*"%>
> <%@ page import="java.sql.*"%>
>
> <!-- %@ include file="no-cache.jsp" % -->
>
> <form action="UserAccount.jsp" method=post
> name="access_form">
>   <table width="90%" align="center">
>   <tr>
>               <th bgcolor="#CCCCFF" colspan=3> <font
> size=5>User Access</font></th>
>
>     <td>&nbsp;</td>
>     <td>&nbsp;</td>
>     <td>&nbsp;</td>
>   </tr>
>   <tr>
>     <td>
>         <center>
>           <table cellpadding=4 cellspacing=2 border=0>
>             <th bgcolor="#CCCCFF" colspan=2> <font
> size=5>User Access by userid</font></th>
>             <tr bgcolor="#c8d8f8">
>               <td valign=top colspan=2> <b>User
> Name</b><br>
>                 <input type="text" name="byusername"
> size=25 value=""  maxlength=25>
>               </td>
>             </tr>
>           </table>
> </center>
> </td>
>     <td>
>         <center>
>           <table cellpadding=4 cellspacing=2 border=0>
>             <th bgcolor="#CCCCFF" colspan=2> <font
> size=5>User Access by Date</font><font size=1></font>
>             </th>
>             <tr bgcolor="#c8d8f8">
>               <td valign=top> <b>Date</b><br>
>                 <input type="text" name="bydate"
> value="" size=25  maxlength=125>
>                 <br>
>               </td>
>             </tr>
>           </table>
> </center>
> </td>
>     <td>
>         <center>
>           <table cellpadding=4 cellspacing=2 border=0>
>             <th bgcolor="#CCCCFF" colspan=2> <font
> size=5>USER Access by IP Address</font>
>             </th>
>             <tr bgcolor="#c8d8f8">
>               <td valign=top> <b>IP Address</b><br>
>                 <input type="text" name="byipaddress"
> value="" size=25  maxlength=125>
>                 <br>
>               </td>
>             </tr>
>           </table>
> </center>
> </td>
>   </tr>
>   <tr>
>     <td>&nbsp;</td>
>     <td align="center" bgcolor="#c8d8f8">
>       <input type="submit" value="Submit"
> name="submit">
>     </td>
>     <td>&nbsp;</td>
>   </tr>
> </table>
> </form>
> <%
> 	String inUser = null;
> 		String inDate = null;
> 		String inIPadd = null;
>
> 	try{
> 	   inUser =
> (request.getParameter("byusername")).trim();
> 	   if (inUser == null) inUser = "";
> 	   inDate = request.getParameter("bydate").trim();
> 	   if (inDate == null) inDate = "";
> 	   inIPadd =
> request.getParameter("byipaddress").trim();
> 	   if (inIPadd == null) inIPadd = "";
>
> 	}catch(NullPointerException npe){
> 		out.println("Please choose a query option.");
>
> 	}
>
> 	  PreparedStatement ps = null;
>          /* Log user access count to the system */
>
>     SQLManager thisManager = null;
>     if (thisManager == null)
>       thisManager = SQLManager.getInstance();
>
>     Connection myConn = null;
>
> 	 if (myConn == null)
> 	   myConn = thisManager.requestConnection();
> 	if (((inUser != null) && !inUser.equals("") ) ||
> ((inDate != null) && !inDate.equals("")) || ((inIPadd
> != null) && !inIPadd.equals("")))
> 	{
>
>         java.util.Date today = new java.util.Date();
>         java.sql.Timestamp stamp = new
> java.sql.Timestamp(today.getTime());
>
>         String stampStr = stamp.toString();
>
>         String timeofday =
> stampStr.substring(11,stampStr.length());
>         String date = stampStr.substring(0,11);
>
>         String todayatZero = date + " 00:00:00.0000";
>
>         todayatZero = "2002-08-01 00:00:00.0000";
>
> inDate += " 00:00:00.0000";
>
> 	boolean ValueEntered = false;
> if (((inUser != null)&& (inDate != null) && (inIPadd
> != null)) && (!inUser.equals("") && !inDate.equals("")
> && !inIPadd.equals("")) )
> {
> //out.println("all are not empty and not null!");
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where username = ? and useripaddress
> = ? and timestamp >= ? order by timestamp desc");
> ps.setString(1, inUser);
> ps.setString(2, inIPadd);
> ps.setString(3, inDate);
> ValueEntered = true;
>
> }else{
> if ((inUser != null)&&	(!inUser.equals("")))
> {
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where username = ? order by
> timestamp desc");
> ps.setString(1, inUser);
> //out.println("inUser is not empty!");
> ValueEntered = true;
> }else
> if ((inIPadd != null)&& (!inIPadd.equals("") ))
> {
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where useripaddress = ? order by
> timestamp desc");
> ps.setString(1, inIPadd);
> //out.println("inIPadd is not empty!");
> ValueEntered = true;
> }else
> if ((inDate != null)&& (!inDate.equals("") ))
> {
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where timestamp >= ? order by
> timestamp desc");
> ps.setString(1, inDate);
> //out.println("inDate is not empty!");
> ValueEntered = true;
> }else
> if (((inUser != null) && !inUser.equals("")) &&
> ((inIPadd != null) && !inIPadd.equals("")))
> {
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where username = ? and useripaddress
> = ? order by timestamp desc");
> ps.setString(1, inUser);
> ps.setString(2, inIPadd);
> //out.println("inUser & inIPadd are not empty!");
> ValueEntered = true;
>
> }else
>
> if (((inUser != null) && !inUser.equals("")) &&
> ((inDate != null) && !inDate.equals("")))
> {
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where username = ? and timestamp >=
> ? order by timestamp desc");
> ps.setString(1, inUser);
> ps.setString(2, inDate);
> //out.println("inUser & inDate are not empty!");
> ValueEntered = true;
> }else
>
> if (((inIPadd != null) && !inIPadd.equals("")) &&
> ((inDate != null) && !inDate.equals("")))
> {
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where username = ? and useripaddress
> = ? order by timestamp desc");
> ps.setString(1, inUser);
> ps.setString(2, inIPadd);
> //out.println("inIPadd & inDate are not empty!");
> ValueEntered = true;
> }
>
> }
> 	if(ValueEntered)
> 	{
> 	  ValueEntered = false;
> 	ResultSet returnedRecord = ps.executeQuery();
>
>
> 	String Attempt = "0";
> 	String dUser = "";
> 	String userIP = "";
> 	String timestamper = "";
> 	int counter = 0;
>
> 	if (returnedRecord.next())
> 	{
> %>
>
> 	<html>
> 	<head>
> 	<LINK REL=STYLESHEET HREF="general.css"
> TYPE="text/css">
> 	</head>
> 	<body>
> 		<table align="center" bgcolor=grey width="90%">
> 		<tr bgcolor=#8090aa>
> <td width="2%">Number</td>
> <td width="25%">Username</td>
> <td width="25%">IP</td>
> <td width="5%">Logins</td>
> <td width="25%">Stamp</td>
> </tr>
>
> <%}  //end testReturned.
> returnedRecord.previous(); //keep here to make sure
> you reset the cursor!
>
> 	boolean isGrey = false;
> 	String cellcolor = "#ee00ff";
> 	try{
> 	    while(returnedRecord.next())
> 	    {
>         	dUser = returnedRecord.getString("username");
>         	userIP =
> returnedRecord.getString("useripaddress");
>         	Attempt =
> returnedRecord.getString("DataBaseTableName");
>         	timestamper =
> returnedRecord.getString("timestamp");
> 					if (counter % 2 == 0)
> 						cellcolor = "#aaffee";
> 					else cellcolor = "#aaff80";
>
> 					counter++;
> 					%>
> 					<tr bgcolor ="<%=cellcolor%>">
> 					<td><%=counter%></td>
> 					<td><%=dUser%></td>
> 					<td><%=userIP%></td>
> 					<td><%=Attempt%></td>
> 					<td><%=timestamper%></td>
> 					</tr>
>
> 					<%
> 						isGrey = true;
> 				}
>
> 	}catch(java.lang.IndexOutOfBoundsException iobe){
>
> 	}catch (java.lang.NullPointerException npe){}
>
>
> %>
> </table>
> </body>
> </html>
> <%}
>
>  	ps.close();
>   thisManager.returnConnection(myConn);
>
> 	/* End Log user access count to the system */
> }%>
>
> ===================== End JSP =================
> --- "Craig R. McClanahan" <cr...@apache.org> wrote:
> >
> >
> > On Mon, 19 Aug 2002, Luminous Heart wrote:
> >
> > > Date: Mon, 19 Aug 2002 08:14:08 -0700 (PDT)
> > > From: Luminous Heart <lu...@yahoo.com>
> > > Reply-To: Tomcat Users List
> > <to...@jakarta.apache.org>
> > > To: Tomcat Users List
> > <to...@jakarta.apache.org>
> > > Subject: It would be great IF somebody answered
> > me, ONCE, for change :(
> > >
> > > I keep on asking this question but noone helps. Is
> > it
> > > a bug in TC?
> > >
> >
> > Since Tomcat doesn't do any database processing of
> > its own, this issue is
> > virtually guaranteed to be a bug in your code, or
> > (much less likely, but
> > possible) a bug in the postgres or poolman packages.
> >  THerefore, asking
> > for help on a Tomcat list isn't likely to be useful
> > -- especially since
> > you don't include any of the code on your page that
> > illustrates what you
> > are trying to do.
> >
> > Craig
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: It would be great IF somebody answered me, ONCE, for change :(

Posted by Luminous Heart <lu...@yahoo.com>.
Mike,
Yes I am returning the connection to the pool after
closing the ps. As you can see in the jsp code that I
have attached earlier to Craig, I am closing the
preparedstatement then returning the instance. Here
again the snippet.

%>
</table>
</body>
</html>
<%}
 	
  ps.close();
  thisManager.returnConnection(myConn);

	/* End Log user access count to the system */
}%>

--- Mike Jackson <mj...@cdi-hq.com> wrote:
> You might want to close your database connection, or
> at least return it to
> the pool (I don't see you doing that, it ought to be
> after you close the
> prepared statement).
> 
> --mikej
> -=-----
> mike jackson
> mjackson@cdi-hq.com
> 
> > -----Original Message-----
> > From: Luminous Heart
> [mailto:luminousheart@yahoo.com]
> > Sent: Monday, August 19, 2002 8:36 AM
> > To: Tomcat Users List
> > Subject: Re: It would be great IF somebody
> answered me, ONCE, for change
> > :(
> >
> >
> > Hi Graig,
> > Here is my jsp file. I am not sure what might be
> > wrong. Although the same error happens in a bigger
> > application in a tc cluster of 3 tomcats. Two of
> these
> > tcs fail while one does not get any forwards after
> > that.
> >
> > Please take a look at my code, if you do not mind.
> >
> > Best regards.
> >
> > ===================== JSP =====================
> > <%@ page import="java.io.*" %>
> > <%@ page import="java.util.*" %>
> > <%@ page import="java.text.*" %>
> >
> > <%@ page import="java.util.Properties" %>
> > <%@ page import="java.util.Date" %>
> >
> > <%@ page contentType="text/html"%>
> >
> > <%@ page import="com.codestudio.util.*"%>
> > <%@ page import="java.sql.*"%>
> >
> > <!-- %@ include file="no-cache.jsp" % -->
> >
> > <form action="UserAccount.jsp" method=post
> > name="access_form">
> >   <table width="90%" align="center">
> >   <tr>
> >               <th bgcolor="#CCCCFF" colspan=3>
> <font
> > size=5>User Access</font></th>
> >
> >     <td>&nbsp;</td>
> >     <td>&nbsp;</td>
> >     <td>&nbsp;</td>
> >   </tr>
> >   <tr>
> >     <td>
> >         <center>
> >           <table cellpadding=4 cellspacing=2
> border=0>
> >             <th bgcolor="#CCCCFF" colspan=2> <font
> > size=5>User Access by userid</font></th>
> >             <tr bgcolor="#c8d8f8">
> >               <td valign=top colspan=2> <b>User
> > Name</b><br>
> >                 <input type="text"
> name="byusername"
> > size=25 value=""  maxlength=25>
> >               </td>
> >             </tr>
> >           </table>
> > </center>
> > </td>
> >     <td>
> >         <center>
> >           <table cellpadding=4 cellspacing=2
> border=0>
> >             <th bgcolor="#CCCCFF" colspan=2> <font
> > size=5>User Access by Date</font><font
> size=1></font>
> >             </th>
> >             <tr bgcolor="#c8d8f8">
> >               <td valign=top> <b>Date</b><br>
> >                 <input type="text" name="bydate"
> > value="" size=25  maxlength=125>
> >                 <br>
> >               </td>
> >             </tr>
> >           </table>
> > </center>
> > </td>
> >     <td>
> >         <center>
> >           <table cellpadding=4 cellspacing=2
> border=0>
> >             <th bgcolor="#CCCCFF" colspan=2> <font
> > size=5>USER Access by IP Address</font>
> >             </th>
> >             <tr bgcolor="#c8d8f8">
> >               <td valign=top> <b>IP
> Address</b><br>
> >                 <input type="text"
> name="byipaddress"
> > value="" size=25  maxlength=125>
> >                 <br>
> >               </td>
> >             </tr>
> >           </table>
> > </center>
> > </td>
> >   </tr>
> >   <tr>
> >     <td>&nbsp;</td>
> >     <td align="center" bgcolor="#c8d8f8">
> >       <input type="submit" value="Submit"
> > name="submit">
> >     </td>
> >     <td>&nbsp;</td>
> >   </tr>
> > </table>
> > </form>
> > <%
> > 	String inUser = null;
> > 		String inDate = null;
> > 		String inIPadd = null;
> >
> > 	try{
> > 	   inUser =
> > (request.getParameter("byusername")).trim();
> > 	   if (inUser == null) inUser = "";
> > 	   inDate =
> request.getParameter("bydate").trim();
> > 	   if (inDate == null) inDate = "";
> > 	   inIPadd =
> > request.getParameter("byipaddress").trim();
> > 	   if (inIPadd == null) inIPadd = "";
> >
> > 	}catch(NullPointerException npe){
> > 		out.println("Please choose a query option.");
> >
> > 	}
> >
> > 	  PreparedStatement ps = null;
> >          /* Log user access count to the system */
> >
> >     SQLManager thisManager = null;
> >     if (thisManager == null)
> >       thisManager = SQLManager.getInstance();
> >
> >     Connection myConn = null;
> >
> > 	 if (myConn == null)
> > 	   myConn = thisManager.requestConnection();
> > 	if (((inUser != null) && !inUser.equals("") ) ||
> > ((inDate != null) && !inDate.equals("")) ||
> ((inIPadd
> > != null) && !inIPadd.equals("")))
> > 	{
> >
> >         java.util.Date today = new
> java.util.Date();
> >         java.sql.Timestamp stamp = new
> > java.sql.Timestamp(today.getTime());
> >
> >         String stampStr = stamp.toString();
> >
> >         String timeofday =
> > stampStr.substring(11,stampStr.length());
> >         String date = stampStr.substring(0,11);
> >
> >         String todayatZero = date + "
> 00:00:00.0000";
> >
> >         todayatZero = "2002-08-01 00:00:00.0000";
> >
> > inDate += " 00:00:00.0000";
> >
> > 	boolean ValueEntered = false;
> > if (((inUser != null)&& (inDate != null) &&
> (inIPadd
> > != null)) && (!inUser.equals("") &&
> !inDate.equals("")
> > && !inIPadd.equals("")) )
> > {
> > //out.println("all are not empty and not null!");
> > ps = myConn.prepareStatement ("select * from
> > DataBaseTableName where username = ? and
> useripaddress
> > = ? and timestamp >= ? order by timestamp desc");
> > ps.setString(1, inUser);
> > ps.setString(2, inIPadd);
> > ps.setString(3, inDate);
> > ValueEntered = true;
> >
> > }else{
> > if ((inUser != null)&&	(!inUser.equals("")))
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: It would be great IF somebody answered me, ONCE, for change :(

Posted by Mike Jackson <mj...@cdi-hq.com>.
You might want to close your database connection, or at least return it to
the pool (I don't see you doing that, it ought to be after you close the
prepared statement).

--mikej
-=-----
mike jackson
mjackson@cdi-hq.com

> -----Original Message-----
> From: Luminous Heart [mailto:luminousheart@yahoo.com]
> Sent: Monday, August 19, 2002 8:36 AM
> To: Tomcat Users List
> Subject: Re: It would be great IF somebody answered me, ONCE, for change
> :(
>
>
> Hi Graig,
> Here is my jsp file. I am not sure what might be
> wrong. Although the same error happens in a bigger
> application in a tc cluster of 3 tomcats. Two of these
> tcs fail while one does not get any forwards after
> that.
>
> Please take a look at my code, if you do not mind.
>
> Best regards.
>
> ===================== JSP =====================
> <%@ page import="java.io.*" %>
> <%@ page import="java.util.*" %>
> <%@ page import="java.text.*" %>
>
> <%@ page import="java.util.Properties" %>
> <%@ page import="java.util.Date" %>
>
> <%@ page contentType="text/html"%>
>
> <%@ page import="com.codestudio.util.*"%>
> <%@ page import="java.sql.*"%>
>
> <!-- %@ include file="no-cache.jsp" % -->
>
> <form action="UserAccount.jsp" method=post
> name="access_form">
>   <table width="90%" align="center">
>   <tr>
>               <th bgcolor="#CCCCFF" colspan=3> <font
> size=5>User Access</font></th>
>
>     <td>&nbsp;</td>
>     <td>&nbsp;</td>
>     <td>&nbsp;</td>
>   </tr>
>   <tr>
>     <td>
>         <center>
>           <table cellpadding=4 cellspacing=2 border=0>
>             <th bgcolor="#CCCCFF" colspan=2> <font
> size=5>User Access by userid</font></th>
>             <tr bgcolor="#c8d8f8">
>               <td valign=top colspan=2> <b>User
> Name</b><br>
>                 <input type="text" name="byusername"
> size=25 value=""  maxlength=25>
>               </td>
>             </tr>
>           </table>
> </center>
> </td>
>     <td>
>         <center>
>           <table cellpadding=4 cellspacing=2 border=0>
>             <th bgcolor="#CCCCFF" colspan=2> <font
> size=5>User Access by Date</font><font size=1></font>
>             </th>
>             <tr bgcolor="#c8d8f8">
>               <td valign=top> <b>Date</b><br>
>                 <input type="text" name="bydate"
> value="" size=25  maxlength=125>
>                 <br>
>               </td>
>             </tr>
>           </table>
> </center>
> </td>
>     <td>
>         <center>
>           <table cellpadding=4 cellspacing=2 border=0>
>             <th bgcolor="#CCCCFF" colspan=2> <font
> size=5>USER Access by IP Address</font>
>             </th>
>             <tr bgcolor="#c8d8f8">
>               <td valign=top> <b>IP Address</b><br>
>                 <input type="text" name="byipaddress"
> value="" size=25  maxlength=125>
>                 <br>
>               </td>
>             </tr>
>           </table>
> </center>
> </td>
>   </tr>
>   <tr>
>     <td>&nbsp;</td>
>     <td align="center" bgcolor="#c8d8f8">
>       <input type="submit" value="Submit"
> name="submit">
>     </td>
>     <td>&nbsp;</td>
>   </tr>
> </table>
> </form>
> <%
> 	String inUser = null;
> 		String inDate = null;
> 		String inIPadd = null;
>
> 	try{
> 	   inUser =
> (request.getParameter("byusername")).trim();
> 	   if (inUser == null) inUser = "";
> 	   inDate = request.getParameter("bydate").trim();
> 	   if (inDate == null) inDate = "";
> 	   inIPadd =
> request.getParameter("byipaddress").trim();
> 	   if (inIPadd == null) inIPadd = "";
>
> 	}catch(NullPointerException npe){
> 		out.println("Please choose a query option.");
>
> 	}
>
> 	  PreparedStatement ps = null;
>          /* Log user access count to the system */
>
>     SQLManager thisManager = null;
>     if (thisManager == null)
>       thisManager = SQLManager.getInstance();
>
>     Connection myConn = null;
>
> 	 if (myConn == null)
> 	   myConn = thisManager.requestConnection();
> 	if (((inUser != null) && !inUser.equals("") ) ||
> ((inDate != null) && !inDate.equals("")) || ((inIPadd
> != null) && !inIPadd.equals("")))
> 	{
>
>         java.util.Date today = new java.util.Date();
>         java.sql.Timestamp stamp = new
> java.sql.Timestamp(today.getTime());
>
>         String stampStr = stamp.toString();
>
>         String timeofday =
> stampStr.substring(11,stampStr.length());
>         String date = stampStr.substring(0,11);
>
>         String todayatZero = date + " 00:00:00.0000";
>
>         todayatZero = "2002-08-01 00:00:00.0000";
>
> inDate += " 00:00:00.0000";
>
> 	boolean ValueEntered = false;
> if (((inUser != null)&& (inDate != null) && (inIPadd
> != null)) && (!inUser.equals("") && !inDate.equals("")
> && !inIPadd.equals("")) )
> {
> //out.println("all are not empty and not null!");
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where username = ? and useripaddress
> = ? and timestamp >= ? order by timestamp desc");
> ps.setString(1, inUser);
> ps.setString(2, inIPadd);
> ps.setString(3, inDate);
> ValueEntered = true;
>
> }else{
> if ((inUser != null)&&	(!inUser.equals("")))
> {
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where username = ? order by
> timestamp desc");
> ps.setString(1, inUser);
> //out.println("inUser is not empty!");
> ValueEntered = true;
> }else
> if ((inIPadd != null)&& (!inIPadd.equals("") ))
> {
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where useripaddress = ? order by
> timestamp desc");
> ps.setString(1, inIPadd);
> //out.println("inIPadd is not empty!");
> ValueEntered = true;
> }else
> if ((inDate != null)&& (!inDate.equals("") ))
> {
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where timestamp >= ? order by
> timestamp desc");
> ps.setString(1, inDate);
> //out.println("inDate is not empty!");
> ValueEntered = true;
> }else
> if (((inUser != null) && !inUser.equals("")) &&
> ((inIPadd != null) && !inIPadd.equals("")))
> {
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where username = ? and useripaddress
> = ? order by timestamp desc");
> ps.setString(1, inUser);
> ps.setString(2, inIPadd);
> //out.println("inUser & inIPadd are not empty!");
> ValueEntered = true;
>
> }else
>
> if (((inUser != null) && !inUser.equals("")) &&
> ((inDate != null) && !inDate.equals("")))
> {
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where username = ? and timestamp >=
> ? order by timestamp desc");
> ps.setString(1, inUser);
> ps.setString(2, inDate);
> //out.println("inUser & inDate are not empty!");
> ValueEntered = true;
> }else
>
> if (((inIPadd != null) && !inIPadd.equals("")) &&
> ((inDate != null) && !inDate.equals("")))
> {
> ps = myConn.prepareStatement ("select * from
> DataBaseTableName where username = ? and useripaddress
> = ? order by timestamp desc");
> ps.setString(1, inUser);
> ps.setString(2, inIPadd);
> //out.println("inIPadd & inDate are not empty!");
> ValueEntered = true;
> }
>
> }
> 	if(ValueEntered)
> 	{
> 	  ValueEntered = false;
> 	ResultSet returnedRecord = ps.executeQuery();
>
>
> 	String Attempt = "0";
> 	String dUser = "";
> 	String userIP = "";
> 	String timestamper = "";
> 	int counter = 0;
>
> 	if (returnedRecord.next())
> 	{
> %>
>
> 	<html>
> 	<head>
> 	<LINK REL=STYLESHEET HREF="general.css"
> TYPE="text/css">
> 	</head>
> 	<body>
> 		<table align="center" bgcolor=grey width="90%">
> 		<tr bgcolor=#8090aa>
> <td width="2%">Number</td>
> <td width="25%">Username</td>
> <td width="25%">IP</td>
> <td width="5%">Logins</td>
> <td width="25%">Stamp</td>
> </tr>
>
> <%}  //end testReturned.
> returnedRecord.previous(); //keep here to make sure
> you reset the cursor!
>
> 	boolean isGrey = false;
> 	String cellcolor = "#ee00ff";
> 	try{
> 	    while(returnedRecord.next())
> 	    {
>         	dUser = returnedRecord.getString("username");
>         	userIP =
> returnedRecord.getString("useripaddress");
>         	Attempt =
> returnedRecord.getString("DataBaseTableName");
>         	timestamper =
> returnedRecord.getString("timestamp");
> 					if (counter % 2 == 0)
> 						cellcolor = "#aaffee";
> 					else cellcolor = "#aaff80";
>
> 					counter++;
> 					%>
> 					<tr bgcolor ="<%=cellcolor%>">
> 					<td><%=counter%></td>
> 					<td><%=dUser%></td>
> 					<td><%=userIP%></td>
> 					<td><%=Attempt%></td>
> 					<td><%=timestamper%></td>
> 					</tr>
>
> 					<%
> 						isGrey = true;
> 				}
>
> 	}catch(java.lang.IndexOutOfBoundsException iobe){
>
> 	}catch (java.lang.NullPointerException npe){}
>
>
> %>
> </table>
> </body>
> </html>
> <%}
>
>  	ps.close();
>   thisManager.returnConnection(myConn);
>
> 	/* End Log user access count to the system */
> }%>
>
> ===================== End JSP =================
> --- "Craig R. McClanahan" <cr...@apache.org> wrote:
> >
> >
> > On Mon, 19 Aug 2002, Luminous Heart wrote:
> >
> > > Date: Mon, 19 Aug 2002 08:14:08 -0700 (PDT)
> > > From: Luminous Heart <lu...@yahoo.com>
> > > Reply-To: Tomcat Users List
> > <to...@jakarta.apache.org>
> > > To: Tomcat Users List
> > <to...@jakarta.apache.org>
> > > Subject: It would be great IF somebody answered
> > me, ONCE, for change :(
> > >
> > > I keep on asking this question but noone helps. Is
> > it
> > > a bug in TC?
> > >
> >
> > Since Tomcat doesn't do any database processing of
> > its own, this issue is
> > virtually guaranteed to be a bug in your code, or
> > (much less likely, but
> > possible) a bug in the postgres or poolman packages.
> >  THerefore, asking
> > for help on a Tomcat list isn't likely to be useful
> > -- especially since
> > you don't include any of the code on your page that
> > illustrates what you
> > are trying to do.
> >
> > Craig
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: It would be great IF somebody answered me, ONCE, for change :(

Posted by Luminous Heart <lu...@yahoo.com>.
Hi Graig,
Here is my jsp file. I am not sure what might be
wrong. Although the same error happens in a bigger
application in a tc cluster of 3 tomcats. Two of these
tcs fail while one does not get any forwards after
that.

Please take a look at my code, if you do not mind.

Best regards.

===================== JSP =====================
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>

<%@ page import="java.util.Properties" %>
<%@ page import="java.util.Date" %>

<%@ page contentType="text/html"%>

<%@ page import="com.codestudio.util.*"%>
<%@ page import="java.sql.*"%>

<!-- %@ include file="no-cache.jsp" % -->

<form action="UserAccount.jsp" method=post
name="access_form">
  <table width="90%" align="center">
  <tr> 
              <th bgcolor="#CCCCFF" colspan=3> <font
size=5>User Access</font></th>

    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td>
        <center>
          <table cellpadding=4 cellspacing=2 border=0>
            <th bgcolor="#CCCCFF" colspan=2> <font
size=5>User Access by userid</font></th>
            <tr bgcolor="#c8d8f8"> 
              <td valign=top colspan=2> <b>User
Name</b><br>
                <input type="text" name="byusername"
size=25 value=""  maxlength=25>
              </td>
            </tr>
          </table>
</center>
</td>
    <td>
        <center>
          <table cellpadding=4 cellspacing=2 border=0>
            <th bgcolor="#CCCCFF" colspan=2> <font
size=5>User Access by Date</font><font size=1></font> 
            </th>
            <tr bgcolor="#c8d8f8"> 
              <td valign=top> <b>Date</b><br>
                <input type="text" name="bydate"
value="" size=25  maxlength=125>
                <br>
              </td>
            </tr>
          </table>
</center>
</td>
    <td>
        <center>
          <table cellpadding=4 cellspacing=2 border=0>
            <th bgcolor="#CCCCFF" colspan=2> <font
size=5>USER Access by IP Address</font> 
            </th>
            <tr bgcolor="#c8d8f8"> 
              <td valign=top> <b>IP Address</b><br>
                <input type="text" name="byipaddress"
value="" size=25  maxlength=125>
                <br>
              </td>
            </tr>
          </table>
</center>
</td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
    <td align="center" bgcolor="#c8d8f8"> 
      <input type="submit" value="Submit"
name="submit">
    </td>
    <td>&nbsp;</td>
  </tr>
</table>
</form>
<%
	String inUser = null; 
		String inDate = null; 
		String inIPadd = null;
	
	try{
	   inUser =
(request.getParameter("byusername")).trim();
	   if (inUser == null) inUser = "";
	   inDate = request.getParameter("bydate").trim();
	   if (inDate == null) inDate = "";
	   inIPadd =
request.getParameter("byipaddress").trim();	
	   if (inIPadd == null) inIPadd = "";
	   
	}catch(NullPointerException npe){
		out.println("Please choose a query option.");
	
	}

	  PreparedStatement ps = null;
         /* Log user access count to the system */
 
    SQLManager thisManager = null;
    if (thisManager == null)
      thisManager = SQLManager.getInstance();
        
    Connection myConn = null;
 
	 if (myConn == null)
	   myConn = thisManager.requestConnection();
	if (((inUser != null) && !inUser.equals("") ) ||
((inDate != null) && !inDate.equals("")) || ((inIPadd
!= null) && !inIPadd.equals("")))
	{

        java.util.Date today = new java.util.Date();
        java.sql.Timestamp stamp = new
java.sql.Timestamp(today.getTime());
 
        String stampStr = stamp.toString();
 
        String timeofday =
stampStr.substring(11,stampStr.length());
        String date = stampStr.substring(0,11);
 
        String todayatZero = date + " 00:00:00.0000";
 
        todayatZero = "2002-08-01 00:00:00.0000";

inDate += " 00:00:00.0000";

	boolean ValueEntered = false;
if (((inUser != null)&& (inDate != null) && (inIPadd
!= null)) && (!inUser.equals("") && !inDate.equals("")
&& !inIPadd.equals("")) )
{
//out.println("all are not empty and not null!");
ps = myConn.prepareStatement ("select * from
DataBaseTableName where username = ? and useripaddress
= ? and timestamp >= ? order by timestamp desc");
ps.setString(1, inUser);
ps.setString(2, inIPadd);
ps.setString(3, inDate);
ValueEntered = true;

}else{ 
if ((inUser != null)&&	(!inUser.equals(""))) 
{
ps = myConn.prepareStatement ("select * from
DataBaseTableName where username = ? order by
timestamp desc");
ps.setString(1, inUser);
//out.println("inUser is not empty!");
ValueEntered = true;
}else 
if ((inIPadd != null)&& (!inIPadd.equals("") ))
{
ps = myConn.prepareStatement ("select * from
DataBaseTableName where useripaddress = ? order by
timestamp desc");
ps.setString(1, inIPadd); 
//out.println("inIPadd is not empty!");
ValueEntered = true;
}else
if ((inDate != null)&& (!inDate.equals("") ))
{
ps = myConn.prepareStatement ("select * from
DataBaseTableName where timestamp >= ? order by
timestamp desc");
ps.setString(1, inDate); 
//out.println("inDate is not empty!");
ValueEntered = true;
}else
if (((inUser != null) && !inUser.equals("")) &&
((inIPadd != null) && !inIPadd.equals("")))
{
ps = myConn.prepareStatement ("select * from
DataBaseTableName where username = ? and useripaddress
= ? order by timestamp desc");
ps.setString(1, inUser);
ps.setString(2, inIPadd);
//out.println("inUser & inIPadd are not empty!");
ValueEntered = true;

}else

if (((inUser != null) && !inUser.equals("")) &&
((inDate != null) && !inDate.equals("")))
{
ps = myConn.prepareStatement ("select * from
DataBaseTableName where username = ? and timestamp >=
? order by timestamp desc");
ps.setString(1, inUser);
ps.setString(2, inDate);
//out.println("inUser & inDate are not empty!");
ValueEntered = true;
}else

if (((inIPadd != null) && !inIPadd.equals("")) &&
((inDate != null) && !inDate.equals("")))
{
ps = myConn.prepareStatement ("select * from
DataBaseTableName where username = ? and useripaddress
= ? order by timestamp desc");
ps.setString(1, inUser);
ps.setString(2, inIPadd);
//out.println("inIPadd & inDate are not empty!");
ValueEntered = true;
}

}
	if(ValueEntered)
	{
	  ValueEntered = false;
	ResultSet returnedRecord = ps.executeQuery();

	
	String Attempt = "0";
	String dUser = "";
	String userIP = "";
	String timestamper = "";
	int counter = 0;
	
	if (returnedRecord.next())
	{
%>

	<html>
	<head>
	<LINK REL=STYLESHEET HREF="general.css"
TYPE="text/css">
	</head>
	<body>
		<table align="center" bgcolor=grey width="90%">
		<tr bgcolor=#8090aa>
<td width="2%">Number</td>
<td width="25%">Username</td>
<td width="25%">IP</td>
<td width="5%">Logins</td>
<td width="25%">Stamp</td>
</tr>

<%}  //end testReturned.
returnedRecord.previous(); //keep here to make sure
you reset the cursor!

	boolean isGrey = false;
	String cellcolor = "#ee00ff";
	try{
	    while(returnedRecord.next())
	    {
        	dUser = returnedRecord.getString("username");
        	userIP =
returnedRecord.getString("useripaddress");
        	Attempt =
returnedRecord.getString("DataBaseTableName");
        	timestamper =
returnedRecord.getString("timestamp");
					if (counter % 2 == 0)
						cellcolor = "#aaffee";
					else cellcolor = "#aaff80";

					counter++;
					%>
					<tr bgcolor ="<%=cellcolor%>">
					<td><%=counter%></td>
					<td><%=dUser%></td>
					<td><%=userIP%></td>
					<td><%=Attempt%></td>
					<td><%=timestamper%></td>
					</tr>

					<%
						isGrey = true;
				}

	}catch(java.lang.IndexOutOfBoundsException iobe){

	}catch (java.lang.NullPointerException npe){}

      
%>
</table>
</body>
</html>
<%}
 	
 	ps.close();
  thisManager.returnConnection(myConn);

	/* End Log user access count to the system */
}%>

===================== End JSP =================
--- "Craig R. McClanahan" <cr...@apache.org> wrote:
> 
> 
> On Mon, 19 Aug 2002, Luminous Heart wrote:
> 
> > Date: Mon, 19 Aug 2002 08:14:08 -0700 (PDT)
> > From: Luminous Heart <lu...@yahoo.com>
> > Reply-To: Tomcat Users List
> <to...@jakarta.apache.org>
> > To: Tomcat Users List
> <to...@jakarta.apache.org>
> > Subject: It would be great IF somebody answered
> me, ONCE, for change :(
> >
> > I keep on asking this question but noone helps. Is
> it
> > a bug in TC?
> >
> 
> Since Tomcat doesn't do any database processing of
> its own, this issue is
> virtually guaranteed to be a bug in your code, or
> (much less likely, but
> possible) a bug in the postgres or poolman packages.
>  THerefore, asking
> for help on a Tomcat list isn't likely to be useful
> -- especially since
> you don't include any of the code on your page that
> illustrates what you
> are trying to do.
> 
> Craig
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: It would be great IF somebody answered me, ONCE, for change :(

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 19 Aug 2002, Luminous Heart wrote:

> Date: Mon, 19 Aug 2002 08:14:08 -0700 (PDT)
> From: Luminous Heart <lu...@yahoo.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: It would be great IF somebody answered me, ONCE, for change :(
>
> I keep on asking this question but noone helps. Is it
> a bug in TC?
>

Since Tomcat doesn't do any database processing of its own, this issue is
virtually guaranteed to be a bug in your code, or (much less likely, but
possible) a bug in the postgres or poolman packages.  THerefore, asking
for help on a Tomcat list isn't likely to be useful -- especially since
you don't include any of the code on your page that illustrates what you
are trying to do.

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: It would be great IF somebody answered me, ONCE, for change :(

Posted by Luminous Heart <lu...@yahoo.com>.
I bet you are the Snot, not just Snotty. How was I
being snotty by asking for someone to help. Yes we are
all obligated towards each other. That is the basic
concept of OpenSource, if you have not noticed. We are
a community of highly involved professionals and we
think that we have to be there for eachother. And
trust me. I would reply to you ASAP if I knew the
solution. So if you do not know the solution do not
fill up the bandwidth with your counterproductive
emails.

Best regards.

--- Paul Caton <pa...@mama.stg.brown.edu> wrote:
> Common sense should tell you that posting snotty
> subject-lines will
> not help persuade list users to answer you. You seem
> to think that
> someone has an *obligation* to jump and answer you
> as soon as
> possible, but this is not the case. Be patient and
> polite and I'll bet
> someone responds.
> 
> Paul Caton
> 
> -- 
> 
> Project Analyst/Electronic Publications Editor, WWP
> Scholarly Technology Group
> 
>  e-mail: paul@mail.stg.brown.edu
>     tel: (401) 863-3619
> address: Box 1841, Brown University, Providence RI
> 02912
> 
> 	
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: It would be great IF somebody answered me, ONCE, for change :(

Posted by Paul Caton <pa...@mama.stg.brown.edu>.
Common sense should tell you that posting snotty subject-lines will
not help persuade list users to answer you. You seem to think that
someone has an *obligation* to jump and answer you as soon as
possible, but this is not the case. Be patient and polite and I'll bet
someone responds.

Paul Caton

-- 

Project Analyst/Electronic Publications Editor, WWP
Scholarly Technology Group

 e-mail: paul@mail.stg.brown.edu
    tel: (401) 863-3619
address: Box 1841, Brown University, Providence RI 02912

	


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: It would be great IF somebody answered me, ONCE, for change :(

Posted by micael <ca...@harbornet.com>.
You are getting a null pointer exception because one of your variables 
referencing an object has not been instantiated and has a null value.  That 
is the answer to your question.

At 08:14 AM 8/19/2002 -0700, you wrote:
>I keep on asking this question but noone helps. Is it
>a bug in TC?
>
>Why do I get NullPointerException? If I press refresh
>a couple of times I would go through.
>
>2002-08-19 00:53:32 StandardWrapperValve[jsp]:
>Servlet.service() for servlet jsp threw exception
>java.lang.NullPointerException
>         at
>org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:61)
>         at
>org.postgresql.Connection.ExecSQL(Connection.java:398)
>         at
>org.postgresql.jdbc2.Statement.execute(Statement.java:130)
>         at
>org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54)
>         at
>org.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.java:99)
>         at
>com.codestudio.sql.PoolManPreparedStatement.executeQuery(Unknown
>Source)
>         at
>org.apache.jsp.AccountAccess$jsp._jspService(AccountAccess$jsp.java:207)
>         at
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
>         at
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
>org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
>         at
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
>         at
>org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
>         at
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
>         at
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
>         at
>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
>         at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
>         at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
>         at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
>         at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
>         at
>org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:531)
>         at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
>         at
>org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
>         at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
>         at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
>         at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
>org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
>         at
>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
>         at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
>         at
>org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
>         at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
>         at
>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
>         at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
>         at
>org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
>         at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
>         at
>org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:392)
>         at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
>         at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
>         at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
>         at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
>         at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
>         at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
>org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)
>         at
>org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
>         at java.lang.Thread.run(Thread.java:536)
>
>
>
>__________________________________________________
>Do You Yahoo!?
>HotJobs - Search Thousands of New Jobs
>http://www.hotjobs.com
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>