Re[2]: Reverse DNS lookup

2001-07-06 Thread wire



Friday, July 06, 2001, 7:02:45 AM, [EMAIL PROTECTED] wrote:


RL The InetAddress...getHostName() call will use the DNS databases.
RL For most computers, however, this won't return anything useful.

That is not true. Most of US IPs have PTR records. That includes your
own IP, that you had when sending your msg. By far, most servers have rDNS,
most dynamic IPs do, most static IPs for cable/DSL do, and even most routers
do.

Asia (particularly Taiwan, China and Korea) is probably the worst, as
far as being able to to rDNS. But even they might be a little over
50%, especially Japan.

RL Randy

 -Original Message-
 From: David Wall [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 06, 2001 12:02 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Reverse DNS lookup
 
 
  InetAddress.getByName(ip address).getHostName() will do what you
  want, if the info is available.
 
 Where would the info have to be available?  Is there anything 
 comparable to
 a dig -x command under Unix?  For most IP addresses, there 
 will not be
 anything configured on my computer, but I know that ARPA 
 reverse lookups are
 possible.
 
 The method you show above still returns the IP address on my 
 system, yet a
 dig -x will show the host name resolved.
 
 David
 
 





Re: creating a instance of a servlet: takes too long!!

2001-07-06 Thread wire



Friday, July 06, 2001, 5:01:37 AM, [EMAIL PROTECTED] wrote:

ps Greetings,

ps why is that my servlet when the first time is invoked, it takes about 30
ps seconds or more to start when the servlets that came in tomcat are
ps instantaneous? After the servlet container instantiated and initialized my
ps servlet, all the following requests are very fast. Is there any advice for
ps what we should do and don't do in init() method? I just initialize some
ps properties and a connection pool
ps Well is it possible that my servlet container at any time my may shutdown my
ps servlet to release memory, and another time it will be requested to start
ps again and take another time too long to start, correct?

ps How can I benchmark the time of instantiation of my servlet and the time of
ps my init method?

ps System configuration:
ps -Tomcat 3.2.1
ps -JDK 1.3
ps -Linux RedHat 6.2 [kernel 2.2.18]
ps -PII400Mhz 256Mbytes

ps thanks.
ps --
ps psalazar/





Re: creating a instance of a servlet: takes too long!!

2001-07-06 Thread wire

If your servlet has changed and needs to be recompiled, then using
jikes instead of javac will save a lot of time.

Friday, July 06, 2001, 5:01:37 AM, [EMAIL PROTECTED] wrote:

ps Greetings,

ps why is that my servlet when the first time is invoked, it takes about 30
ps seconds or more to start when the servlets that came in tomcat are
ps instantaneous? After the servlet container instantiated and initialized my
ps servlet, all the following requests are very fast. Is there any advice for
ps what we should do and don't do in init() method? I just initialize some
ps properties and a connection pool
ps Well is it possible that my servlet container at any time my may shutdown my
ps servlet to release memory, and another time it will be requested to start
ps again and take another time too long to start, correct?

ps How can I benchmark the time of instantiation of my servlet and the time of
ps my init method?

ps System configuration:
ps -Tomcat 3.2.1
ps -JDK 1.3
ps -Linux RedHat 6.2 [kernel 2.2.18]
ps -PII400Mhz 256Mbytes

ps thanks.
ps --
ps psalazar/





Re[2]: creating a instance of a servlet: takes too long!!

2001-07-06 Thread wire



Friday, July 06, 2001, 10:16:05 AM, [EMAIL PROTECTED] wrote:

PD There's another reason for this and it has to do with the 
java.security.SecureRandom class.
From what I can tell, tomcat uses this class to generate a seed value for the
PD session ID.  The first request for a SecureRandom value (eg. new 
SecureRandom().nextLong()) can take many, many seconds to complete.  After the
PD first usage however, it returns immediately.  I'm not sure what goes on when
PD SecureRandom initializes but that seems to be where the slow down occurs.

Yes, good point. I've just been looking at that, too. It reminds me of the time
required to create a secure socket factory when using JSSE. After that
time is initially spent, any other new sockets are created quickly.

For development, I change to using randomClass=java.util.Random

..and have noticed that the attribute randomFile=/dev/urandom is irrelevant
 on win '98 (I assume this file contains a seed for the random generation?)

Also, there seems to be a lot elsewise going on under the hood. When accessing
a jsp, Tomcat seems to me (at this point) to be compiling servlets in the
webapp. Can anybody elaborate on that?

PD As a work around, you could create a low priority thread that instantiates a
PD SecureRandom calls nextLong() then exits, and have this thread get launched by
PD the init() method of a servlet that gets preloaded.  This solution worked for me.

PD Regards,
PD Pete.

PD Thus spake pedro salazar [EMAIL PROTECTED] on Fri, 6 Jul 2001 
10:01:37 +0100:

PS Greetings,
PS 
PS why is that my servlet when the first time is invoked, it takes about 30
PS seconds or more to start when the servlets that came in tomcat are
PS instantaneous? After the servlet container instantiated and initialized my
PS servlet, all the following requests are very fast. Is there any advice for
PS what we should do and don't do in init() method? I just initialize some
PS properties and a connection pool
PS Well is it possible that my servlet container at any time my may shutdown my
PS servlet to release memory, and another time it will be requested to start
PS again and take another time too long to start, correct?
PS 
PS How can I benchmark the time of instantiation of my servlet and the time of
PS my init method?
PS 
PS System configuration:
PS -Tomcat 3.2.1
PS -JDK 1.3
PS -Linux RedHat 6.2 [kernel 2.2.18]
PS -PII400Mhz 256Mbytes
PS 
PS thanks.
PS --
PS psalazar/
PS 
PS 





Re: can't find tomcat.jar ? [solved]

2001-07-06 Thread wire

For the archives:

this problem only occurs when using Jikes. By setting JIKES_PATH to
include ...\lib\tomcat.jar the problem is solved.

Friday, July 06, 2001, 12:05:30 AM, [EMAIL PROTECTED] wrote:

wmc A fresh install of 3.3-m4 (with jdk1.4 on '98), and when I try to access a
wmc jsp I get an error on finding C:\tomcat\lib\tomcat.jar. And
wmc C:\tomcat\lib\tomcat.jar does exist. Thanks for any help.

wmc org.apache.jasper.JasperException: Unable to compile
wmc Found 2 system errors:

wmc *** Error: Could not find package named: 
wmc C:\tomcat\lib\tomcat.jar(java/util), 
wmc C:\tomcat\work\DEFAULT\security/java/util, 
wmc C:\tomcat\lib\common\jasper34_runtime.jar(java/util), 
wmc C:\tomcat\lib\common\jasper-runtime.jar(java/util), 
wmc C:\tomcat\lib\common\core_util.jar(java/util), 
wmc C:\tomcat\lib\common\connector_util.jar(java/util), 
wmc C:\tomcat\lib\common\servlet.jar(java/util) or 
wmc C:\tomcat\lib\common\tomcat_core.jar(java/util)


wmc *** Error: Could not find package named: 
wmc C:\tomcat\lib\tomcat.jar(java/lang), 
wmc C:\tomcat\work\DEFAULT\security/java/lang, 
wmc C:\tomcat\lib\common\jasper34_runtime.jar(java/lang), 
wmc C:\tomcat\lib\common\jasper-runtime.jar(java/lang), 
wmc C:\tomcat\lib\common\core_util.jar(java/lang), 
wmc C:\tomcat\lib\common\connector_util.jar(java/lang), 
wmc C:\tomcat\lib\common\servlet.jar(java/lang) or 
wmc C:\tomcat\lib\common\tomcat_core.jar(java/lang)





Re[4]: Reverse DNS lookup

2001-07-06 Thread wire

Friday, July 06, 2001, 12:15:19 PM, [EMAIL PROTECTED] wrote:

 RL The InetAddress...getHostName() call will use the DNS
DW databases.
 RL For most computers, however, this won't return anything useful.

 That is not true. Most of US IPs have PTR records. That includes your
 own IP, that you had when sending your msg. By far, most servers have
DW rDNS,
 most dynamic IPs do, most static IPs for cable/DSL do, and even most
DW routers
 do.

DW The IP address I was testing is 216.122.43.90 and I am able to do a reverse
DW lookup using dig from the webserver.  It just seems to me that the
DW InetAddress class is perhaps not using whatever it needs to do to use DNS.
DW Does anybody know what the implementation of InetAddress is actually doing
DW under the hood?

Well, the InetAddress methods do work correctly, Dave. Here is a quick demo:

import java.net.*;

public class IPGet {

public static void main(String[] args) {
try {
System.out.println(InetAddress.getByName(args[0]).getHostName());
} catch (Exception e) {
System.out.println(e);
}
}

}

and the console:

C:\testjikes -nowarn IPGet.java

C:\testjava IPGet 216.122.43.90
r90-43-dsl.sea.lightrealm.net

Now, for the kicker... On one run I got the same return as you
did: the IP number instead of hostname - this happens when the lookup
fails. Therefore, I would guess right now that here might be some problem
in the nameservers at lightrealm.

So, a partial dig shows:

Dig [EMAIL PROTECTED] ...
Authoritative Answer
Recursive queries supported by this server
 Query for 90.43.122.216.in-addr.arpa type=255 class=1
  90.43.122.216.in-addr.arpa PTR (Pointer) r90-43-dsl.sea.lightrealm.net
  43.122.216.in-addr.arpa NS (Nameserver) ns1.lightrealm.net

  and next:

07/06/01 12:50:19 ping ns1.lightrealm.net
Ping  failed, no such host  

That looks like a slam dunk. Lightrealm's problem, when they
periodically can't resolve within their domain. Not a Java problem.
HTH.

DW David





Re: RES: filtering IP's on Tomact

2001-07-06 Thread wire



Friday, July 06, 2001, 1:08:12 PM, [EMAIL PROTECTED] wrote:

JEdSJDO -BEGIN PGP SIGNED MESSAGE-

JEdSJDO I think its impossible, since tomcat isnt a firewall.or even a webserver.

It seems the most you can do is accept or deny from within the
servlet, with getRemoteAddr().

JEdSJDO José Euclides Júnior
JEdSJDO __
JEdSJDO E-mail: [EMAIL PROTECTED]
JEdSJDO [EMAIL PROTECTED] 
JEdSJDO http://euclides.8m.com



JEdSJDO - -Mensagem original-
JEdSJDO De: Alberto Torna Jr. [SMTP:[EMAIL PROTECTED]]
JEdSJDO Enviada em: Quinta-feira, 5 de Julho de 2001 15:37
JEdSJDO Para:   [EMAIL PROTECTED]
JEdSJDO Assunto:Re: filtering IP's on Tomact

JEdSJDO What do you mean by filtering?



From: Paulo Roque 
Reply-To: [EMAIL PROTECTED] 
To: [EMAIL PROTECTED] 
Subject: filtering IP's on Tomact 
Date: Thu, 05 Jul 2001 16:35:35 - 
 
Hi, 
 
Could anyone enlight me about if it is possible to filter a set of 
IP 
addresses on Tomcat 3.2.1 ? 
 
Thanks! 
 
 
Paulo Costa 
Portugal 






Re[2]: Problem with stopping Tomcat

2001-07-06 Thread wire



Friday, July 06, 2001, 2:47:01 PM, [EMAIL PROTECTED] wrote:



 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 06, 2001 3:10 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Problem with stopping Tomcat
 
 
 I thought 3.2.2 could use AJP13 instead? Am I wrong on that?
 
RL My understanding is Tomcat 3.1-3 could only use AJP12 to shutdown,
RL maybe you should post to the tomcat-dev list and let us know what you find
RL out.

The doc agrees with you:

  http://jakarta.apache.org/tomcat/tomcat-3.2-doc/mod_jk-howto.html

  The servlet.xml file already has a block similar to this for Ajp12 connections on 
port 8007 (as
   delivered by mod_jserv). Even if you think you're only using Ajp13, you probably 
don't want to
   delete this connector - it's required to shut down Tomcat.





generic exceptions on startup

2001-07-05 Thread wire

This is a partial list of exceptions that I'm getting at startup (Win
98, 3.2.1). Anybody know what's going on?

TOMCAT_HOME is properly set to C:\tomcat   Not Apache nor IIS nor NS
(whatever that is) are not involved in my setup at all.

Thanks.


java.lang.Exception
at org.apache.tomcat.core.ContextManager.getHome(ContextManager.java:224
)
at org.apache.tomcat.core.ContextManager.getAbsolute(ContextManager.java
:1512)
at org.apache.tomcat.context.LoaderInterceptor.contextInit(LoaderInterce
ptor.java:111)
at org.apache.tomcat.core.ContextManager.initContext(ContextManager.java
:491)
at org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
java.lang.Exception
at org.apache.tomcat.core.ContextManager.getHome(ContextManager.java:224
)
at org.apache.tomcat.core.ContextManager.getAbsolute(ContextManager.java
:1512)
at org.apache.tomcat.context.LoaderInterceptor.contextInit(LoaderInterce
ptor.java:116)
at org.apache.tomcat.core.ContextManager.initContext(ContextManager.java
:491)
at org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
java.lang.Exception
at org.apache.tomcat.core.ContextManager.getHome(ContextManager.java:224
)
at org.apache.tomcat.task.ApacheConfig.execute(ApacheConfig.java:92)
at org.apache.tomcat.startup.Tomcat.generateServerConfig(Tomcat.java:217
)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:200)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
java.lang.Exception
at org.apache.tomcat.core.ContextManager.getHome(ContextManager.java:224
)
at org.apache.tomcat.task.IISConfig.execute(IISConfig.java:87)
at org.apache.tomcat.startup.Tomcat.generateServerConfig(Tomcat.java:223
)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:200)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
java.lang.Exception
at org.apache.tomcat.core.ContextManager.getHome(ContextManager.java:224
)
at org.apache.tomcat.task.NSConfig.execute(NSConfig.java:86)
at org.apache.tomcat.startup.Tomcat.generateServerConfig(Tomcat.java:229
)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:200)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)





Re: Remove DNS lookup

2001-07-05 Thread wire



Thursday, July 05, 2001, 11:35:55 PM, [EMAIL PROTECTED] wrote:

DW Is there a class that can do a reverse DNS lookup, giving me the hostname
DW that matches a given IP address?  I'm able to retrieve the IP address of an
DW HTTP request just fine using request.getRemoteAddr() (and getRemoteHost()
DW returns the same IP address dotted numbers), but the java.net package
DW doesn't seem to have
DW anything that returns a name based on an IP address, unless I'm just
DW misreading InetAddress...

InetAddress.getByName(ip address).getHostName() will do what you
want, if the info is available.

getRemoteHost() doesn't work if the webserver is configured not to
spend time doing the lookup for every request, or if no rDNS record
exists for that IP.

DW David





can't find tomcat.jar ?

2001-07-05 Thread wire

A fresh install of 3.3-m4 (with jdk1.4 on '98), and when I try to access a
jsp I get an error on finding C:\tomcat\lib\tomcat.jar. And
C:\tomcat\lib\tomcat.jar does exist. Thanks for any help.

org.apache.jasper.JasperException: Unable to compile
Found 2 system errors:

*** Error: Could not find package named: 
C:\tomcat\lib\tomcat.jar(java/util), 
C:\tomcat\work\DEFAULT\security/java/util, 
C:\tomcat\lib\common\jasper34_runtime.jar(java/util), 
C:\tomcat\lib\common\jasper-runtime.jar(java/util), 
C:\tomcat\lib\common\core_util.jar(java/util), 
C:\tomcat\lib\common\connector_util.jar(java/util), 
C:\tomcat\lib\common\servlet.jar(java/util) or 
C:\tomcat\lib\common\tomcat_core.jar(java/util)


*** Error: Could not find package named: 
C:\tomcat\lib\tomcat.jar(java/lang), 
C:\tomcat\work\DEFAULT\security/java/lang, 
C:\tomcat\lib\common\jasper34_runtime.jar(java/lang), 
C:\tomcat\lib\common\jasper-runtime.jar(java/lang), 
C:\tomcat\lib\common\core_util.jar(java/lang), 
C:\tomcat\lib\common\connector_util.jar(java/lang), 
C:\tomcat\lib\common\servlet.jar(java/lang) or 
C:\tomcat\lib\common\tomcat_core.jar(java/lang)





Re[2]: Does Tomcat needs jdk 1.2.2

2001-07-03 Thread wire



Tuesday, July 03, 2001, 9:35:59 AM, [EMAIL PROTECTED] wrote:

EBN Thanks Randy,

EBN Can you please direct me to the place were SUN says that tools.jar may not
EBN be redistribute?

Sun only lets you distribute the JRE. You couldn't distribute the jdk
if you wanted to.

Note: you might be able to distribute the jikes compiler.

EBN (We are using JSPs. )


EBN Regards,
EBN Eitan

 -Original Message-
 From: Randy Layman [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 03, 2001 1:33 PM
 To: [EMAIL PROTECTED]
 Subject: RE: Does Tomcat needs jdk 1.2.2
 
 
 
   If you are using just servlets, you don't need a JDK.  
 If you are
 deploying JSPs then you need the JavaC compiler (in the 
 tools.jar file in
 the later versions of the JDK), which is the component that 
 Sun indicates
 that you are not supposed to redistribute.
 
   Randy
 
  -Original Message-
  From: Eitan Ben Noach [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, July 03, 2001 8:49 AM
  To: '[EMAIL PROTECTED]'
  Subject: RE: Does Tomcat needs jdk 1.2.2
  
  
  Thanks Sam,
  
  Actually, my intention was to ask if Tomcat need JDK at all. 
  Now it's clear
  that the answer is yes.
  
  I want to be more precise: what parts of the JDK are needed, 
  since we want
  to deploy Tomcat with our product, without the need of full 
  JDK installation
  - only those special resources. What are they?
  
  Thanks,
  
  Eitan
  
   -Original Message-
   From: Sam Newman [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, July 03, 2001 12:36 PM
   To: [EMAIL PROTECTED]
   Subject: Re: Does Tomcat needs jdk 1.2.2
   
   
   erm, my understanding is that Tomcat only requires Java 1.1.7 
   or above. By
   default the server.xml that ships with Tomcat actually 
   comments out those
   areas of code that require Java 1.2/Java 2, e.g. the use of 
  a security
   manager/policies
   
   sam
   - Original Message -
   From: Frans Thamura [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Tuesday, July 03, 2001 11:09 PM
   Subject: Re: Does Tomcat needs jdk 1.2.2
   
   
Ya, JSDK.
   
Because Tomcat is a server based on Java
   
Frans
- Original Message -
From: Eitan Ben Noach [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 03, 2001 1:40 AM
Subject: Does Tomcat needs jdk 1.2.2
   
   
 Hello,

 Does Tomcat needs the installation of JDK 1.2.2?
 If yes, what specific jars ( or any other resources ) 
  are needed?

 Thanks,

 Eitan

   snip