You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lindomar <li...@bol.com.br> on 2003/02/03 14:01:51 UTC
Datasource and connection
Hi everybody!
I'm using datasource of tomcat for get connection.
Well, when i do this:
...
DataSource ds = (DataSource)ctx.lookup( "java:comp/env/jdbc/Anything");
if (ds != null)
connection = ds.getConnection();
...
In the next time, will give tomcat to me a new connection or the same?
I think that is same, but i didn't read anything about this.
And when Tomcat close this connection? Only through the timeout?
Thanks in advanced.
Re: localhost:8080 connection refused
Posted by David Nelson <da...@talkingstone.com>.
Thanks for the reply Bill,
I'm not too savvy regarding the firewall installation. I took the default
settings on install. Additionally, whose logs should I be looking at and
what should I look for?
----- Original Message -----
From: "Bill" <bh...@collaborativefusion.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Wednesday, February 05, 2003 10:30 AM
Subject: Re: localhost:8080 connection refused
> David
>
> Default RH installations have a firewall, did you not install the
> firewall or adjust it to accept connections on port 8080? Just a
> thought...
>
> Also, you havent included any log entries....is there nothing in the
> logs?
>
> -b
>
>
> On Wed, 2003-02-05 at 10:22, David Nelson wrote:
> > I have heard similar posts but after trying everything I can get my
hands
> > on, Tomcat is still refusing to work I get a connection refused.
> >
> > Here are a few system details and what I've done.
> > OS RH 8.0
> > Tomcat 4.1.18
> > Apache 2.0.44
> > mod_jk-2.0.43.so
> > java2 1.4 (tested manually and works)
> > $JAVA_HOME and $CATALINA_HOME are set
> >
> > httpd.conf has
> > LoadModule jk_module modules/mod_jk-2.0.43.so
> > Include /user/local/tomcat/conf/auto/mod_jk.conf
> >
> > incidentally, the mod_jk.conf is not being generated.
> >
> > Inside Tomcat's server.xml
> > <Server port="8005" shutdown="SHUTDOWN" debug="0">
> > <Listener className="org.apache.ajp.Tomcat4.config.ApacheConfig"
> > modJk="/usr/local/apache2/modules/mod_jk-2.0.43.so" />
> > ....
> >
> > <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
> > autoDeploy="true">
> > <Listener className="org.apache.ajp.Tomcat4.config.ApacheConfig"
> > append="true"
> > forwardAll="false"
> > modJk="/usr/local/apache2/modules/mod_jk-2.0.43.so" />
> > ....
> >
> > Any ideas what I'm missing?
> >
> > Thanks for any help.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: localhost:8080 connection refused
Posted by Sean Dockery <se...@sbdconsultants.com>.
I remember an issue with Tomcat (circa 3.3) not being able to load an
Oracle JDBC driver which was packaged in a .zip file. Our solution was to
change the Oracle driver package extension from .zip to .jar.
By the way, does anyone know if the class path case sensitive on
Windows? Would foo.ZIP be different from foo.zip, for example?
At 10:22 2003-02-05 -0600, you wrote:
>After having a look at Catalina.out, here are a few errors:
>
>java.util.zip.ZipException: error in opening zip file
> at java.util.zip.ZipFile.open(Native Method)
> at java.util.zip.ZipFile.<init>(ZipFile.java:112)
> at java.util.jar.JarFile.<init>(JarFile.java:117)
> at java.util.jar.JarFile.<init>(JarFile.java:55)
> at
>org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(Standar
>dClassLoader.java:1082)
> at
>org.apache.catalina.loader.StandardClassLoader.<init>(StandardClassLoader.ja
>va:200)
> at
>org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoader
>Factory.java:202)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:140)
>Bootstrap: Class loader creation threw exception
>java.lang.IllegalArgumentException: addRepositoryInternal:
>java.util.zip.ZipException: error in opening zip file
> at
>org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(Standar
>dClassLoader.java:1110)
> at
>org.apache.catalina.loader.StandardClassLoader.<init>(StandardClassLoader.ja
>va:200)
> at
>org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoader
>Factory.java:202)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:140)
>
>The block above repeats for each time I start Tomcat. It doesn't look too
>promising.
>
>---- Original Message -----
>From: "Bill" <bh...@collaborativefusion.com>
>To: "Tomcat Users List" <to...@jakarta.apache.org>
>Sent: Wednesday, February 05, 2003 10:30 AM
>Subject: Re: localhost:8080 connection refused
>
>
> > David
> >
> > Default RH installations have a firewall, did you not install the
> > firewall or adjust it to accept connections on port 8080? Just a
> > thought...
> >
> > Also, you havent included any log entries....is there nothing in the
> > logs?
> >
> > -b
> >
> >
> > On Wed, 2003-02-05 at 10:22, David Nelson wrote:
> > > I have heard similar posts but after trying everything I can get my
>hands
> > > on, Tomcat is still refusing to work I get a connection refused.
> > >
> > > Here are a few system details and what I've done.
> > > OS RH 8.0
> > > Tomcat 4.1.18
> > > Apache 2.0.44
> > > mod_jk-2.0.43.so
> > > java2 1.4 (tested manually and works)
> > > $JAVA_HOME and $CATALINA_HOME are set
> > >
> > > httpd.conf has
> > > LoadModule jk_module modules/mod_jk-2.0.43.so
> > > Include /user/local/tomcat/conf/auto/mod_jk.conf
> > >
> > > incidentally, the mod_jk.conf is not being generated.
> > >
> > > Inside Tomcat's server.xml
> > > <Server port="8005" shutdown="SHUTDOWN" debug="0">
> > > <Listener className="org.apache.ajp.Tomcat4.config.ApacheConfig"
> > > modJk="/usr/local/apache2/modules/mod_jk-2.0.43.so" />
> > > ....
> > >
> > > <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
> > > autoDeploy="true">
> > > <Listener className="org.apache.ajp.Tomcat4.config.ApacheConfig"
> > > append="true"
> > > forwardAll="false"
> > > modJk="/usr/local/apache2/modules/mod_jk-2.0.43.so" />
> > > ....
> > >
> > > Any ideas what I'm missing?
> > >
> > > Thanks for any help.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Sean Dockery
sean@sbdconsultants.com
Certified Java Web Component Developer
Certified Delphi Programmer
SBD Consultants
http://www.sbdconsultants.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: localhost:8080 connection refused
Posted by David Nelson <da...@talkingstone.com>.
After having a look at Catalina.out, here are a few errors:
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:112)
at java.util.jar.JarFile.<init>(JarFile.java:117)
at java.util.jar.JarFile.<init>(JarFile.java:55)
at
org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(Standar
dClassLoader.java:1082)
at
org.apache.catalina.loader.StandardClassLoader.<init>(StandardClassLoader.ja
va:200)
at
org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoader
Factory.java:202)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:140)
Bootstrap: Class loader creation threw exception
java.lang.IllegalArgumentException: addRepositoryInternal:
java.util.zip.ZipException: error in opening zip file
at
org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(Standar
dClassLoader.java:1110)
at
org.apache.catalina.loader.StandardClassLoader.<init>(StandardClassLoader.ja
va:200)
at
org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoader
Factory.java:202)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:140)
The block above repeats for each time I start Tomcat. It doesn't look too
promising.
---- Original Message -----
From: "Bill" <bh...@collaborativefusion.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Wednesday, February 05, 2003 10:30 AM
Subject: Re: localhost:8080 connection refused
> David
>
> Default RH installations have a firewall, did you not install the
> firewall or adjust it to accept connections on port 8080? Just a
> thought...
>
> Also, you havent included any log entries....is there nothing in the
> logs?
>
> -b
>
>
> On Wed, 2003-02-05 at 10:22, David Nelson wrote:
> > I have heard similar posts but after trying everything I can get my
hands
> > on, Tomcat is still refusing to work I get a connection refused.
> >
> > Here are a few system details and what I've done.
> > OS RH 8.0
> > Tomcat 4.1.18
> > Apache 2.0.44
> > mod_jk-2.0.43.so
> > java2 1.4 (tested manually and works)
> > $JAVA_HOME and $CATALINA_HOME are set
> >
> > httpd.conf has
> > LoadModule jk_module modules/mod_jk-2.0.43.so
> > Include /user/local/tomcat/conf/auto/mod_jk.conf
> >
> > incidentally, the mod_jk.conf is not being generated.
> >
> > Inside Tomcat's server.xml
> > <Server port="8005" shutdown="SHUTDOWN" debug="0">
> > <Listener className="org.apache.ajp.Tomcat4.config.ApacheConfig"
> > modJk="/usr/local/apache2/modules/mod_jk-2.0.43.so" />
> > ....
> >
> > <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
> > autoDeploy="true">
> > <Listener className="org.apache.ajp.Tomcat4.config.ApacheConfig"
> > append="true"
> > forwardAll="false"
> > modJk="/usr/local/apache2/modules/mod_jk-2.0.43.so" />
> > ....
> >
> > Any ideas what I'm missing?
> >
> > Thanks for any help.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: localhost:8080 connection refused
Posted by Bill <bh...@collaborativefusion.com>.
David
Default RH installations have a firewall, did you not install the
firewall or adjust it to accept connections on port 8080? Just a
thought...
Also, you havent included any log entries....is there nothing in the
logs?
-b
On Wed, 2003-02-05 at 10:22, David Nelson wrote:
> I have heard similar posts but after trying everything I can get my hands
> on, Tomcat is still refusing to work I get a connection refused.
>
> Here are a few system details and what I've done.
> OS RH 8.0
> Tomcat 4.1.18
> Apache 2.0.44
> mod_jk-2.0.43.so
> java2 1.4 (tested manually and works)
> $JAVA_HOME and $CATALINA_HOME are set
>
> httpd.conf has
> LoadModule jk_module modules/mod_jk-2.0.43.so
> Include /user/local/tomcat/conf/auto/mod_jk.conf
>
> incidentally, the mod_jk.conf is not being generated.
>
> Inside Tomcat's server.xml
> <Server port="8005" shutdown="SHUTDOWN" debug="0">
> <Listener className="org.apache.ajp.Tomcat4.config.ApacheConfig"
> modJk="/usr/local/apache2/modules/mod_jk-2.0.43.so" />
> ....
>
> <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
> autoDeploy="true">
> <Listener className="org.apache.ajp.Tomcat4.config.ApacheConfig"
> append="true"
> forwardAll="false"
> modJk="/usr/local/apache2/modules/mod_jk-2.0.43.so" />
> ....
>
> Any ideas what I'm missing?
>
> Thanks for any help.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
localhost:8080 connection refused
Posted by David Nelson <da...@talkingstone.com>.
I have heard similar posts but after trying everything I can get my hands
on, Tomcat is still refusing to work I get a connection refused.
Here are a few system details and what I've done.
OS RH 8.0
Tomcat 4.1.18
Apache 2.0.44
mod_jk-2.0.43.so
java2 1.4 (tested manually and works)
$JAVA_HOME and $CATALINA_HOME are set
httpd.conf has
LoadModule jk_module modules/mod_jk-2.0.43.so
Include /user/local/tomcat/conf/auto/mod_jk.conf
incidentally, the mod_jk.conf is not being generated.
Inside Tomcat's server.xml
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Listener className="org.apache.ajp.Tomcat4.config.ApacheConfig"
modJk="/usr/local/apache2/modules/mod_jk-2.0.43.so" />
....
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
autoDeploy="true">
<Listener className="org.apache.ajp.Tomcat4.config.ApacheConfig"
append="true"
forwardAll="false"
modJk="/usr/local/apache2/modules/mod_jk-2.0.43.so" />
....
Any ideas what I'm missing?
Thanks for any help.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
localhost:8080 connection refused
Posted by David Nelson <da...@talkingstone.com>.
I have heard similar posts but after trying everything I can get my hands
on, Tomcat is still refusing to work I get a connection refused.
Here are a few system details and what I've done.
OS RH 8.0
Tomcat 4.1.18
Apache 2.0.44
mod_jk-2.0.43.so
java2 1.4 (tested manually and works)
$JAVA_HOME and $CATALINA_HOME are set
httpd.conf has
LoadModule jk_module modules/mod_jk-2.0.43.so
Include /user/local/tomcat/conf/auto/mod_jk.conf
incidentally, the mod_jk.conf is not being generated.
Inside Tomcat's server.xml
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Listener className="org.apache.ajp.Tomcat4.config.ApacheConfig"
modJk="/usr/local/apache2/modules/mod_jk-2.0.43.so" />
....
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
autoDeploy="true">
<Listener className="org.apache.ajp.Tomcat4.config.ApacheConfig"
append="true"
forwardAll="false"
modJk="/usr/local/apache2/modules/mod_jk-2.0.43.so" />
....
Any ideas what I'm missing?
Thanks for any help.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Datasource and connection
Posted by Lindomar <li...@bol.com.br>.
So so Sean.
Then this is a way of tomcat implements the concept of connection pools.
Right, i only wanted have certain.
Thanks for all.
----- Original Message -----
From: "Sean Dockery" <se...@sbdconsultants.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Monday, February 03, 2003 16:25
Subject: RE: Datasource and connection
> I'm curious as to why you're asking this question. You should be using
the
> connection pool according to the documentation provided, because that is
how
> it is intended to be used. That is...
>
> void doPost(...)
> {
> InitialContext ic = new InitialContext();
> Context jdbcCtx = (Context) ic.lookup("java:comp/env");
> DataSource ds = (DataSource) jdbcCtx.lookup("jdbc/myDataSource");
>
> Connection conn = null;
> Statement stmt = null;
> ResultSet rs = null;
>
> try {
> conn = ds.getConnection();
>
> stmt = ...
>
> rs = ...
> }
> catch(SQLException esql) {
> }
> finally {
> if(rs != null)
> rs.close();
>
> if(stmt != null)
> stmt.close();
>
> if(conn != null)
> conn.close();
> }
> }
>
> What exactly are you THINKING of doing?
>
> -----Original Message-----
> From: Lindomar [mailto:lindomar.silva@bol.com.br]
> Sent: Monday, February 03, 2003 06:02
> To: Tomcat Users List
> Subject: Datasource and connection
>
>
> Hi everybody!
>
> I'm using datasource of tomcat for get connection.
> Well, when i do this:
> ...
> DataSource ds = (DataSource)ctx.lookup( "java:comp/env/jdbc/Anything");
> if (ds != null)
> connection = ds.getConnection();
> ...
>
> In the next time, will give tomcat to me a new connection or the same?
>
> I think that is same, but i didn't read anything about this.
>
> And when Tomcat close this connection? Only through the timeout?
>
> Thanks in advanced.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: Datasource and connection
Posted by Sean Dockery <se...@sbdconsultants.com>.
I'm curious as to why you're asking this question. You should be using the
connection pool according to the documentation provided, because that is how
it is intended to be used. That is...
void doPost(...)
{
InitialContext ic = new InitialContext();
Context jdbcCtx = (Context) ic.lookup("java:comp/env");
DataSource ds = (DataSource) jdbcCtx.lookup("jdbc/myDataSource");
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try {
conn = ds.getConnection();
stmt = ...
rs = ...
}
catch(SQLException esql) {
}
finally {
if(rs != null)
rs.close();
if(stmt != null)
stmt.close();
if(conn != null)
conn.close();
}
}
What exactly are you THINKING of doing?
-----Original Message-----
From: Lindomar [mailto:lindomar.silva@bol.com.br]
Sent: Monday, February 03, 2003 06:02
To: Tomcat Users List
Subject: Datasource and connection
Hi everybody!
I'm using datasource of tomcat for get connection.
Well, when i do this:
...
DataSource ds = (DataSource)ctx.lookup( "java:comp/env/jdbc/Anything");
if (ds != null)
connection = ds.getConnection();
...
In the next time, will give tomcat to me a new connection or the same?
I think that is same, but i didn't read anything about this.
And when Tomcat close this connection? Only through the timeout?
Thanks in advanced.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org