You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Kerrigan, Philip" <ph...@eds.com> on 2003/05/22 12:01:47 UTC

RE: Tomcat is only picking up requests from the localhost address 127 .0.0.1.

John, Sriram,

thanks for the comments. I am using the Coyote connector, and with the
original configuration file which does not have the "address" attribute and
which I understood to mean the connector responds to all configured IP
addresses on the defined port.

I created a connector for each real IP address (I am not using virtual IP or
interested in virtual hosts here) and at tomcat startup I saw it logged 2
connectors listening on port 8080. However not only did I not get any
response on either of these addresses, but 127.0.0.1 no longer responded (I
didn't make a specific connector for it).

However I think this is a red herring as I never remember having to
configure the local network card on previous installations of Tomcat on
other machines.

I would be more inclined to suspect a problem somewhere in the combination
of 2 network interfaces (of which 1 WiFI), Win2000 SP3, and JVM 1.4.1_002.

Can anybody confirm they have a similar configuration that works?

distinti saluti/best regards
Philip Kerrigan, Solutions Consulting
tel +39 02-52029884
mobile: +39 335-780-5151

EDS Italia SpA
Via Medici del Vascello, 26
20138 Milano
ITALY

-----Original Message-----
From: John Turner [mailto:tomcat-user@johnturner.com]
Sent: 20 May 2003 14:30
To: Tomcat Users List
Subject: Re: Tomcat is only picking up requests from the localhost
address 127 .0.0.1.



Tomcat, by default, is configured to listen only to "localhost".  Localhost 
is 127.0.0.1.  If you want Tomcat to listen on other interfaces or FQDN, 
you will need to configure it to do so.  Check the docs for information on 
configuring Tomcat's CoyoteConnector, and also for information on 
configuring virtual hosts.  Out of the box, Tomcat has only one virtual 
host: localhost.

John

On Tue, 20 May 2003 11:26:19 +0100, Kerrigan, Philip 
<ph...@eds.com> wrote:

> Tomcat is only picking up requests from the localhost address 127.0.0.1.
>
> I have a Win2000 SP3 OS (Italian language), JVM 1.4.1_02, Tomcat 4.1.24, 
> and
> 2 interfaces. 1 is a Realtek 10/100 Ethernet (192.168.10.4), the other is 
> a linksys WiFi (10.10.10.1). I installed Jetspeed and discovered that I 
> could
> not access Tomcat over the network, but that from the PC I could still 
> use the localhost address. Note. ping and file sharing work over the WiFi 
> interface,
> so it is not a network connection problem. I can not access Tomcat using 
> these
> IP addresses even from the LOCAL host.
>
> I also tried with the WiFi adapter unplugged (I did not disinstall the
> software however) and it still did not work.
>
> Is this a known problem, or have I made a mistake in configuration? Can
> anybody give advice on further action? The logfile had no useful 
> information.
>
>
>
> distinti saluti/best regards
> Philip Kerrigan, Solutions Consulting
> tel +39 02-52029884
> mobile: +39 335-780-5151
>
> EDS Italia SpA
> Via Medici del Vascello, 26
> 20138 Milano
> ITALY
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: DB pooling and architecture and performance

Posted by Tim Funk <fu...@joedog.org>.
(Sorry of the below is unclear - I wrote this in a minute on my way on an 
appointment)

  DBCP is a database pooling library. It by iteslf will hold all your 
database connections. Then when your servlet is run, the servlet will use 
JNDI to obtain a reference to the datasource (which is implemented by one hte 
dbcp classes). Then from the datasource - your get your Connection. Then when 
your are done with the connection - you close it. Closing it does not really 
close the connection. It actually returns it back to the database pool since 
you are not looking directly at the database connection but a facade.

JNDI lookups are cheap. It will be near the quickness of a hashtable lookup. 
So while obtaining a connectino feels like a lot of code overhead - it is ver 
fast.

In your scenario - you cannot scale since each servlet has its own 
connection. So at most best a servlet can only server one request at a time. 
But with the above scenario, you server serve the number of db connections 
available at a time.

 From a probability point of view - not all the servlets are serving a 
request at the same time. Most likely the same servlet is serving multiple 
requests at the same time. For more info on dbcp with tomcat:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html


-Tim

Munteanu Gabriel wrote:
> I want to reuse DB Connections in my web-application.
> I used dbcp with datasource, I did the configuration, and also I run some
> test servlets. All is ok.
> I have put in all my servlets init() method the code to get a Connection
> from the dbcp datasource.
> 
> Aagin all ok, but I am thinking that I do not reuse anything.
> Once the servlets are running, the method init() is never called, so if I
> have 100 DB Connections
> for my 100 servlets.
> 
> If I would have created the connections in the classic way with
> DriverManager and the rest, and put this code
> in the init() method of all me servlets, I think the performance woub be the
> same at runtime. (the service method would
> have a Connection object either way).
> 
> Now, I am thinking that I must put my datasource getConnection() in the
> service() method and at the end of
> the method retrunConnection(). And this way [ONLY WAY?] I would reuse the
> Connections, because if there is
> a demand simultaneous of 15 pages with DB connections, I could get 15
> Connections from the pool, and give them back after I use them.
> 
> I am waiting for comments.
> any URL where DB-pooling is explained in VERY profound way?
> 
> Gabi
> 
> 
> ---------------------------------------------------------------------
> 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


DB pooling and architecture and performance

Posted by Munteanu Gabriel <gm...@rdslink.ro>.
I want to reuse DB Connections in my web-application.
I used dbcp with datasource, I did the configuration, and also I run some
test servlets. All is ok.
I have put in all my servlets init() method the code to get a Connection
from the dbcp datasource.

Aagin all ok, but I am thinking that I do not reuse anything.
Once the servlets are running, the method init() is never called, so if I
have 100 DB Connections
for my 100 servlets.

If I would have created the connections in the classic way with
DriverManager and the rest, and put this code
in the init() method of all me servlets, I think the performance woub be the
same at runtime. (the service method would
have a Connection object either way).

Now, I am thinking that I must put my datasource getConnection() in the
service() method and at the end of
the method retrunConnection(). And this way [ONLY WAY?] I would reuse the
Connections, because if there is
a demand simultaneous of 15 pages with DB connections, I could get 15
Connections from the pool, and give them back after I use them.

I am waiting for comments.
any URL where DB-pooling is explained in VERY profound way?

Gabi


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org