RE: Tomcat using VERY LARGE Memory (URGENT!!!!!!!!!)

2002-12-16 Thread Jeremy Joslin
The -X VM options will work with Sun VM's, your mileage may vary when used
with others.  You can read all about it here:
http://java.sun.com/docs/hotspot/VMOptions.html

Jeremy

 -Original Message-
 From: Ming Zhao [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 16, 2002 10:19 AM
 To: Tomcat Users List
 Subject: RE: Tomcat using VERY LARGE Memory (URGENT!)
 
 Can it work on Win2k? Thanks,
 
 --- Luc Santeramo [EMAIL PROTECTED]
 wrote:
  Hi,
 
  there is a way to limit memory use by tomcat
  just specify it in your CATALINA_OPTS env var
  here is mine
  CATALINA_OPTS=-server -Xmx220m -Xms220m
  -Dfile.encoding=UTF-8
 
  these are jvm parameter I think
  Xmx is the max mem to use and Xms is the min
 
  hope this helps
 
  Luc
 
  At 11:03 13/12/2002  +0100, Marco Bucciarelli wrote:
  Hi, I have also this problem/doubt: how to limit
  the number of threads
  opened by Tomcat?
  I tried to change a lot of settings in server.xml
  but nothing influenced
  that number.
  I have always 46 new java processes opened by
  Tomcat.
  
  I did this test (Linux RedHat 7.0, Tomcat 4.1.12,
  Apache 1.3.12, Sun JDK
  1.4.1_01):
  - reboot the machine, with tomcat service disabled
  at startup
  - the free command gives me 221.196Kb of memory
  free (Total 256Mk)
  - start tomcat
  - I found 46 new java processes
  - the top command says that every process uses 56Mb
  of RAM
  - the free command now gives me 44.436Kb free
  
  All this without accessing to Apache or Tomcat,
  only before and after the
  start of Tomcat!
  
  Of course I do not have a memory usage of 46*56Mb,
  but I do not have only
  56Mb of RAM used by Tomcat (after the start I have
  only 44Mb of memory free,
  before the start I had 220Mb free).
  
  What is happening?
  
  Bye,
  Marco.
  
  
  From: Galbayar
  Subject:  Re: Tomcat using VERY LARGE Memory
  (URGENT!)
  Date:  Tue, 12 Mar 2002 10:26:21 +0800
  
  it is top result and every java process using 59M
  RAM
  i'm use mod_jk integrated Tomcat with Apache and
  Tomcat
  top result is :
  
  
  110 processes: 109 sleeping, 1 running, 0 zombie, 0
  stopped
  CPU states:  2.3% user,  1.9% system,  0.0% nice,
  95.6% idle
  Mem:  1028860K av,  938924K used,   89936K free,
   116K shrd,
  139628K
  buff
  Swap: 1020116K av,   0K used, 1020116K free
  680228K
  cached
  
 PID USER PRI  NI  SIZE  RSS SHARE STAT %CPU
  %MEM   TIME
  COMMAND
  17862 root  15   0  1092 1092   836 R 1.7
  0.1   0:00 top
  17293 root  13   0 28176  59M  9576 S 1.5
  2.7   0:01 java
  17272 root  10   0 28176  59M  9576 S 0.1
  2.7   0:02 java
  
  and see MEM usage total RAM is 1028860K  938924K
  used,   89936K free
  
  
  - Original Message -
  From: Filip Hanik [EMAIL PROTECTED]
  To: Tomcat Users List
  [EMAIL PROTECTED]
  Sent: Tuesday, March 12, 2002 10:14
  Subject: RE: Tomcat using VERY LARGE Memory
  (URGENT!)
  
  
what you are seeing is that ps or top lists
  one process for
  each
  thread
in Tomcat.
your tomcat is running 59M all together
   
Filip
   
~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
[EMAIL PROTECTED]
www.filip.net
   
-Original Message-
From: Galbayar [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 6:04 PM
To: Tomcat Users List
Subject: Tomcat using VERY LARGE Memory
  (URGENT!)


Hello all
Here is part of top output. Is it usual that
  java
processes eat all of memory? ? At now there are
  50 java
  processes started
that running tomcat and each of them uses 59M
  memory. There
  is running
apache
server with tomcat 4 and mysql. OS is Redhat7.2
  x86 . JDK
  1.4 is
  installed.
how to solve this problem?

106 processes: 105 sleeping, 1 running, 0
  zombie, 0 stopped
CPU states: 0.3% user, 3.4% system, 0.0% nice,
  96.1% idle
Mem: 1028860K av, 1022352K used, 6508K free,
  116K shrd,
  129004K buff
wap: 1020116K av, 0K used, 1020116K free
  762320K cached

3201 root 9 0 60692 59M 28164 S 0.0 5.8 0:03
  java
3202 root 8 0 60692 59M 28164 S 0.0 5.8 0:00
  java
3203 root 9 0 60692 59M 28164 S 0.0 5.8 0:35
  java
3204 root 9 0 60692 59M 28164 S 0.0 5.8 0:00
  java
3205 root 9 0 60692 59M 28164 S 0.0 5.8 0:01
  java
3206 root 9 0 60692 59M 28164 S 0.0 5.8 0:00
  java
3207 root 9 0 60692 59M 28164 S 0.0 5.8 0:00
  java
3208 root 9 0 60692 59M 28164 S 0.0 5.8 0:00
  java
3209 root 9 0 60692 59M 28164 S 0.0 5.8 0:03
  java


   
   
--
To unsubscribe:   mailto:tomcat-user-
  [EMAIL PROTECTED]
For additional commands: mailto:tomcat-user-
  [EMAIL PROTECTED]
Troubles with the list: mailto:tomcat-user-
  [EMAIL PROTECTED]
   
   
   
  
  
  --
  To unsubscribe:   mailto:tomcat-user-
  [EMAIL PROTECTED]
  For additional commands: mailto:tomcat-user-
  [EMAIL PROTECTED]
  Troubles with the list: 

RE: javac Memory Leak: STATUS request

2002-12-16 Thread Jeremy Joslin
I don't know where you can get more information about this but have you
considered using jikes instead of javac?  I don't know of any issues with
jikes and its s much faster than javac :-)

Jeremy

 -Original Message-
 From: Dan Payne [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 16, 2002 2:32 PM
 To: [EMAIL PROTECTED]
 Subject: javac Memory Leak: STATUS request
 
 According to the Tomcat 4.1.12 release notes there is a javac memory leak.
 I've searched the bug watch database at sun and have searched the web as
 well but am having trouble finding the latest info on this. Has it been
 fixed? If so, what version of the JDK? I'm using 1.4.0_01 and my productin
 server is crashing every 4 days with out of memory exceptions.
 
 Does anyone know where I can track this at/get more info at?
 
 Thanks a million. Ya'll have been great.
 
 -Dan
 
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]
 For additional commands, e-mail: mailto:tomcat-user-
 [EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Threads of Control

2002-12-08 Thread Jeremy Joslin
U e...sure you could do that but you should ask yourself is this
the right thing to do?  If the sample code you provided is similar to what
you're trying to implement I would recommend that you right your own
Runnable object and control it's lifetime using a ServeltContextListener
object.  Or at least define the Runnable object as a private inner class of
the Servlet so you're not exposing a public method that isn't intended to be
called from outside the servlet.  Just my 2 cents...

Jeremy

 -Original Message-
 From: micael [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, December 08, 2002 5:17 PM
 To: Tomcat Users List
 Subject: Threads of Control
 
 Can a servlet start an application on a server which is available to a
 user
 on the server machine?  Something, i.e., like the following:
 
 import java.io.*;
 import java.util.*;
 import javax.servlet.*;
 import javax.servlet.http.*;
 
 public class AppCtrl extends HttpServlet implements Runnable {
private boolean change;
private Thread ctrl;
private App [] app;
 
public void init() throws ServletException() {
  ctrl = new Thread(this);
  ctrl.setPriority(Thread.MIN_PRIORITY);
  ctrl.start();
}
 
public void run() {
  while(true) {
if(AppProps.change()) {
  app = AppProps.changes();
  for(int i = 0; i  app.length; i++) {
AppManager.implementChange(app[i]);
try {
  ctrl.sleep(200); // .2 second break between changes.
} catch (InterruptedException ignored) {
}
  }
}
  }
}
 }
 
 
 Micael
 
 ---
 
 This electronic mail  transmission and any accompanying documents contain
 information belonging to the sender which may be confidential and legally
 privileged.  This information is intended only for the use of the
 individual or entity to whom this electronic mail transmission was sent as
 indicated above. If you are not the intended recipient, any disclosure,
 copying, distribution, or action taken in reliance on the contents of the
 information contained in this transmission is strictly prohibited.  If you
 have received this transmission in error, please delete the message.
 Thank you
 
 
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]
 For additional commands, e-mail: mailto:tomcat-user-
 [EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Thread dump

2002-12-06 Thread Jeremy Joslin
There's a whitepaper about it located here:
http://developer.java.sun.com/developer/technicalArticles/Programming/Stackt
race/

Jeremy

 -Original Message-
 From: Ben Ricker [mailto:[EMAIL PROTECTED]]
 Sent: Friday, December 06, 2002 12:58 PM
 To: Tomcat Users List
 Subject: RE: Thread dump
 
 I am intrigued by this feature; it would help with the debugging of a
 application. I tried to test it against tomcat but I get nothing on
 stderr (i.e., nothing in /var/log/messages, terminal, directory I am in,
 catalina.out, or any of the logs for Tomcat).
 
 Could you expand on what behavior you see when you send the -3 to
 Tomcat's PID?
 
 Thanks,
 
 Ben Ricker
 Wellinx.com
 
 On Fri, 2002-12-06 at 12:29, Schnitzer, Jeff wrote:
  FYI, no it doesn't, it just causes the (Sun, at least) JVM to dump a
  list of threads and their stacks to stderr.  Note that it's the real
  stderr, not System.err.  This is a JVM feature.  It can be done anytime
  and is a *really* useful debugging feature.
 
  Jeff
 
   -Original Message-
   From: Manavendra Gupta [mailto:[EMAIL PROTECTED]]
   Sent: Friday, December 06, 2002 8:01 AM
   To: Tomcat Users List
   Subject: RE: Thread dump
  
   Beg your pardon? would that not actually kill the process, rather than
   displaying the thread dump?
  
   And what if one wants to see the thread dump right from the moment
  tomcat
   starts up?
  
   Thanks,
   manav.
  
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
   Sent: Friday, December 06, 2002 9:18 PM
   To: Tomcat Users List
   Subject: Re: Thread dump
  
  
  
   kill -3 pid
  
   RS
  
  
  
 Manavendra
 Gupta   To:   Tomcat Users
   List
 [EMAIL PROTECTED]
   [EMAIL PROTECTED]
  cc:
 12/06/02 09:53 AMSubject:  Thread dump
 Please respond to
 Tomcat Users
 List
  
  
  
  
  
  
   I have tomcat 4.1 running on Linux. How do i see the thread dump? The
   startup.sh on linux just starts it in the background, while i could
  use
   startup.bat on windows and get the thread dump.
  
   thanks,
   manav.
  
  
   --
   To unsubscribe, e-mail:   
   mailto:[EMAIL PROTECTED]
   For additional commands, e-mail: 
   mailto:[EMAIL PROTECTED]
  
  
  
  
  
  
  
   --
   To unsubscribe, e-mail:
   mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
   mailto:[EMAIL PROTECTED]
  
  
   --
   To unsubscribe, e-mail:   mailto:tomcat-user-
   [EMAIL PROTECTED]
   For additional commands, e-mail: mailto:tomcat-user-
   [EMAIL PROTECTED]
  
 
 
  --
  To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]
  For additional commands, e-mail: mailto:tomcat-user-
 [EMAIL PROTECTED]
 
 --
 Ben Ricker [EMAIL PROTECTED]
 Wellinx.com
 
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]
 For additional commands, e-mail: mailto:tomcat-user-
 [EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: How to set JVM memory size?

2002-12-05 Thread Jeremy Joslin
It's important to realize that this is setting the size of the Java heap
within the JVM (which sounds like what you're looking for) and not the
actual size of the JVM itself.  Also note that you're not always going
to get the best performance out of your app by using a large heap size
because while it decreases the frequency of GC's the time each GC takes
is going to increase (more to collect).  So, and I know I'm not the
first to say this, play around with the different settings until you
find the one that suits your app.

Jeremy

 -Original Message-
 From: Brandon Cruz [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 05, 2002 10:27 AM
 To: Tomcat Users List
 Subject: RE: How to set JVM memory size?
 
 Set an environment variable called JAVA_OPTS and set your max and min
to
 whatever you want like this...
 
 -Xmx512m -Xms256m
 
 Brandon
 
 -Original Message-
 From: Ming Zhao [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 05, 2002 11:49 AM
 To: [EMAIL PROTECTED]
 Subject: How to set JVM memory size?
 
 
 Hi,
 
 I have a question to seek for your help. How do I set
 the JVM memory size? I use Apache Tomcat4.1.16 and
 J2SDK1.3. Now it seems that I have a problem of not
 enough memory to implement the java bean. I want to
 set JVM memory with writing some commands to some
 file. So Tomcat can activate J2SDK with set memory
 size. How to do that?
 
 Thanks in advance,
 Ming
 
 __
 Do you Yahoo!?
 New DSL Internet Access from SBC  Yahoo!
 http://sbc.yahoo.com
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]
 For additional commands, e-mail: mailto:tomcat-user-
 [EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: how many linux processes should tomcat create???

2002-12-05 Thread Jeremy Joslin
Java threads under Linux show up as individual processes when you do a
top or anything similar.  The number of threads (Linux processes) that
Tomcat creates will of course depend on the application you're
deploying, i.e. if your app starts up a lot of threads for whatever
reason you're going to see those show up as additional processes.  I
don't know the exact number off the top of my head but I would estimate
that Tomcat itself starts  30 threads, of course this number also
depends on the number of request processors you specify in your
server.xml.  In my experience any app that has 525 threads running needs
to be looked at immediately.  

Having one or more open database connections is okay if you're pooling
the connections in some way.  If the number of physical connections to
your DB is constantly increasing without bound then perhaps you have
another problem to fix.  Using netstat is should be easy to determine
what's going on there.

Jeremy

 -Original Message-
 From: David Brown [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 05, 2002 9:47 AM
 To: Tomcat Users List
 Subject: Re: how many linux processes should tomcat create???
 
 Brandon Cruz writes:
 
  Does anyone know how many processes tomcat should create?  When I
start
 my
  server, there are about 525 processes created.  The number
constantly
 grows
  as time goes on, but I think it is related to a database connection
 being
  left open.
 
  525 seems like a lot to start with though.
 
  Brandon
 
 
  --
  To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]
  For additional commands, e-mail: mailto:tomcat-user-
 [EMAIL PROTECTED]
 
 
 Hello Brandon, i case the gurus have not responded i wil put in $0.02.
i
 have been running tc for a few years and have been running on public
 access
 4 about a year and i monitor (i'm running a linux box) using top all
my
 processes, memory, cpu etc. all the time. i have not really kept any
vital
 stats type records, mostly just eyeball. for whatever it is worth i
ran
 a
 ps -waux on my system and see that i have 45 processes as a result of
 executing catalina.sh (tc server). i have many servlets and jsp
running in
 4
 different virtual hosts. i cannot expertly confirm of course but 525
 processes would in my estimation a run-away condition that needs
 fulltime
 attention until u get this reigned. hope this helps, david.
 
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]
 For additional commands, e-mail: mailto:tomcat-user-
 [EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Mutliuser setup

2002-12-04 Thread Jeremy Joslin
Start out by looking at #4 on the list here:
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/RUNNING.txt

Jeremy

 -Original Message-
 From: Rolf Borgen Guescini [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 04, 2002 8:13 AM
 To: [EMAIL PROTECTED]
 Subject: Mutliuser setup
 
 Does anybody know what to do when setting up tomcat on a UNIX
environment
 for more than one user?
 
 Is the best way to define a directory owned by a group where all the
users
 belong,and then make contexts in server.xml?
 
 Or is there another way of doing it?
 
 RBG
 
 ~\\|//~
 -(o o)-
oOOOo**(_)**oOOOo
* Rolf Borgen Guescini  *
*---*
*   *
*   [EMAIL PROTECTED]*
*   [EMAIL PROTECTED]*
* http://folk.uio.no/rolfbg *
*   *
*   *
* .oooO   Oooo. *
**(   )***(   )**
 \ ( ) /
  \_)   (_/
 
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]
 For additional commands, e-mail: mailto:tomcat-user-
 [EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Redirecting requests back to the webserver from tomcat

2002-12-02 Thread Jeremy Joslin
I don't know what your setup it but it might be worth your while to look
at the Proxy Support how-to located here:
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/proxy-howto.html

Jeremy

  -Original Message-
  From: Prashanth Pushpagiri [mailto:[EMAIL PROTECTED]]
  Sent: 1. desember 2002 02:05
  To: Tomcat Users List
  Subject: Redirecting requests back to the webserver from tomcat
 
 
  Hi
 
  Is there a way to redirect a request that comes to
  tomcat back to the main webserver (IIS or Apache
  etc.). I want to use tomcat to verify the existence of
  a session and then send it back to IIS to serve the
  page out. Is this possible?
 
  Thanks
  Prashanth
 
  __
  Do you Yahoo!?
  Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: How to set Multiple instances for tomcat?

2002-12-02 Thread Jeremy Joslin
This is a pretty vague question so you're going to get a vague answer.
Look at http://jakarta.apache.org/tomcat/tomcat-4.0-doc/RUNNING.txt item
#4.

Jeremy

 -Original Message-
 From: Tushar Kulkarni [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, December 01, 2001 9:19 AM
 To: Tomcat Users List
 Subject: How to set Multiple instances for tomcat?
 
 Hi I want to set multiple instances for tomcat4. How do I do that?
 Thanks
 
 
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]
 For additional commands, e-mail: mailto:tomcat-user-
 [EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Socket GURU'S PLEASE HELP ON OBSCURE PROBLEM

2002-12-02 Thread Jeremy Joslin
Looks like you're trying to implement a small webserver but you're not
obeying the HTTP spec.  You need to read the entire request in from the
client before responding and you should send the appropriate response
header, e.g. HTTP/1.1 200 OK, or your results will be unpredictable.
The reason you see it hang is because it's waiting for a response from
your server, it finally times out (Connection reset by peer) and closes
the connection.  I would suggest using HTTP 1.0 on the server side to
avoid dealing with keep-alives sent by 1.1 clients.  For more
information on the HTTP spec check out RFC 2616.  Good luck on your
homework.

Jeremy
 
 -Original Message-
 From: Jason Johnston [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 02, 2002 9:04 AM
 To: Tomcat Users List
 Subject: Socket GURU'S PLEASE HELP ON OBSCURE PROBLEM
 
 The project that I'm working on is actually much larger and more
 complex, but I've thrown together this class that illustrates my
 problem.  I'm basically starting a socket server on port 80 and then
 connecting with a web browser.  The strange thing is that the
connection
 never terminates and I can't identify where it's hung up.
 
 The code is as follows:
 
 import java.io.*;
 import java.net.*;
 import java.util.*;
 
 public class Lab9 {
ServerSocket ss;
Socket tempSocket;
BufferedReader instream;
PrintWriter outstream;
Socket connection;
 
public Lab9(){
try{
System.out.println(Server Started);
ss=new ServerSocket(80);
tempSocket=ss.accept();
instream=new BufferedReader(new
 InputStreamReader(tempSocket.getInputStream()));
outstream= new PrintWriter(tempSocket.getOutputStream(),true);
ss.close();
String tempString;
System.out.println(Starting to read from client.);
while((tempString=instream.readLine())!=null)
{
//tempString=instream.readLine();
System.out.print(got:);
outstream.print(got:);
System.out.println(tempString);
outstream.println(tempString);
 }
 System.out.println(Done with Input.);
 tempSocket.close();
 instream.close();
 System.out.println(Server Closed.);
}
catch(IOException e){
 System.out.println(Error: +e.getMessage());
}
 
}
 public static void main(String[] args) {
 Lab9 bob=new Lab9();
 }
 }
 
 The strange thing is where the output is concverned.  The browser just
 hangs indefinitely and claims that it's downloading the page.  But on
 the console I'm getting the following:
 
 Server Started
 Starting to read from client.
 got:GET / HTTP/1.1
 got:Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
 application/vnd.ms-powerpoint, application/vnd.ms-excel,
 application/msword, */*
 got:Accept-Language: en-us
 got:Accept-Encoding: gzip, deflate
 got:User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
 got:Host: localhost
 got:Connection: Keep-Alive
 got:
 
 Then it hangs.  This is what's really bugging me.  It never exits the
 while loop and it never iterates the loop again.  It just hangs until
I
 close the browser window.  Then it gives me this:
 
 Error: Connection reset by peer: JVM_recv in socket input stream read
 
 There's obviously something here I'm not understanding.  If the
 inputstream is not null, then in my mind it should continue with the
 loop and keep printing got and the line of input.  Yet, the
connection
 stays alive and the loop stops iterating.  Is this a behavior of the
 BufferedReader, is it a behavior of the Socket?  Is this something
 unique to using browsers?  If anyone has any insight, I would
appreciate
 it.  Thanks.



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Socket GURU'S PLEASE HELP ON OBSCURE PROBLEM [OFFTOPIC]

2002-12-02 Thread Jeremy Joslin
The condition in your while loop is incorrect.
BufferedReader.readLine() is only going to return null when the end of
the stream is reached, i.e. when the client closes the socket either
fully or partially.  What you really need to test for as a condition for
the end of the input are two consecutive line terminators, either
\r\n\r\n or \n\n.  Since the readLine method only reads up to \r\n or \n
you'll have to add in some additional logic to test for this condition.
Hope this helps you out and please try to post only tomcat related
questions to this list.  Thanks.

Jeremy

 -Original Message-
 From: Jason Johnston [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 02, 2002 12:27 PM
 To: [EMAIL PROTECTED]
 Subject: RE: Socket GURU'S PLEASE HELP ON OBSCURE PROBLEM
 
 Thanks Jeremy.
 
 You're right in that I'm not correctly implementing HTTP, but I'm not
 sure that's my problem.  When I kill the lines that write to the
output
 stream prematurely, I still never exit that loop.  My program just
 simply waits forever.  In fact, the client never times out.  I've left
 it this was for hours with no timeout.
 
 I've found some info in the forums on readLine() being a blocking
 thread and I think that's my problem though I'm still having trouble
 resolving the issue.  When I issue a timeout, my program errs out one
 the timeout is reached.
 
 Does anyone know of any way to resolve a readLine() or a read()
 blocking forever?
 
  On a side-note, Lab9 is where I work.  I needed a name :).
 
 
  [EMAIL PROTECTED] 12/02/02 11:48AM 
 Looks like you're trying to implement a small webserver but you're not
 obeying the HTTP spec.  You need to read the entire request in from
 the
 client before responding and you should send the appropriate response
 header, e.g. HTTP/1.1 200 OK, or your results will be unpredictable.
 The reason you see it hang is because it's waiting for a response
 from
 your server, it finally times out (Connection reset by peer) and
 closes
 the connection.  I would suggest using HTTP 1.0 on the server side to
 avoid dealing with keep-alives sent by 1.1 clients.  For more
 information on the HTTP spec check out RFC 2616.  Good luck on your
 homework.
 
 Jeremy
 
  -Original Message-
  From: Jason Johnston [mailto:[EMAIL PROTECTED]]
  Sent: Monday, December 02, 2002 9:04 AM
  To: Tomcat Users List
  Subject: Socket GURU'S PLEASE HELP ON OBSCURE PROBLEM
 
  The project that I'm working on is actually much larger and more
  complex, but I've thrown together this class that illustrates my
  problem.  I'm basically starting a socket server on port 80 and then
  connecting with a web browser.  The strange thing is that the
 connection
  never terminates and I can't identify where it's hung up.
 
  The code is as follows:
 
  import java.io.*;
  import java.net.*;
  import java.util.*;
 
  public class Lab9 {
 ServerSocket ss;
 Socket tempSocket;
 BufferedReader instream;
 PrintWriter outstream;
 Socket connection;
 
 public Lab9(){
 try{
 System.out.println(Server Started);
 ss=new ServerSocket(80);
 tempSocket=ss.accept();
 instream=new BufferedReader(new
  InputStreamReader(tempSocket.getInputStream()));
 outstream= new PrintWriter(tempSocket.getOutputStream(),true);
 ss.close();
 String tempString;
 System.out.println(Starting to read from client.);
 while((tempString=instream.readLine())!=null)
 {
 //tempString=instream.readLine();
 System.out.print(got:);
 outstream.print(got:);
 System.out.println(tempString);
 outstream.println(tempString);
  }
  System.out.println(Done with Input.);
  tempSocket.close();
  instream.close();
  System.out.println(Server Closed.);
 }
 catch(IOException e){
  System.out.println(Error: +e.getMessage());
 }
 
 }
  public static void main(String[] args) {
  Lab9 bob=new Lab9();
  }
  }
 
  The strange thing is where the output is concverned.  The browser
 just
  hangs indefinitely and claims that it's downloading the page.  But
 on
  the console I'm getting the following:
 
  Server Started
  Starting to read from client.
  got:GET / HTTP/1.1
  got:Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
  application/vnd.ms-powerpoint, application/vnd.ms-excel,
  application/msword, */*
  got:Accept-Language: en-us
  got:Accept-Encoding: gzip, deflate
  got:User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
  got:Host: localhost
  got:Connection: Keep-Alive
  got:
 
  Then it hangs.  This is what's really bugging me.  It never exits
 the
  while loop and it never iterates the loop again.  It just hangs
 until
 I
  close the browser window.  Then it gives me this:
 
  Error: Connection reset by peer: JVM_recv in socket input stream
 read
 
  There's obviously something here I'm not understanding.  If the
  inputstream is not null, then in my mind it should continue with the
  loop 

RE: How do I integrate my CLASSPATH on Tomcat?

2002-11-27 Thread Jeremy Joslin
Have a look at the class loader HOW-TO located here:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html,
it should answer most of your questions.  If you're still having trouble
please post a more detailed description.

Jeremy

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
On
 Behalf Of Emma Johansson
 Sent: Wednesday, November 27, 2002 9:35 AM
 To: Tomcat Users List
 Subject: Re: How do I integrate my CLASSPATH on Tomcat?
 
 Sorry, I left some answers to your question out..
 I'm using Tomcat 4.1.12 (unix system)
 
 I have deployed a wsdl file on tomcat and created a jar file by using
the
 java2wsdl2java tool.
 This is a part of my code:
 --
 import netscape.ldap.*;
 
 public class ConnectToMurImpl
 {
  ...
  ...
  ...
  public void add(  )
  {
   LDAPAttributeSet attrib_set = null;
   LDAPAttribute attribute = null;
   LDAPEntry entry = null;
   LDAPConnection ld = null;
 
   try
   {
ld = new LDAPConnection();
 
// Must bind as a user with rights to write to the server
ld.connect(host,port,dn,pwd);
...
...
...
 --
 The jar file containing several class files are located in
 tomcat_home/webapps/axis/WEB-INF/lib. This is the same directory as
where
 the jar
 files for ldap are located.
 
 / Emma
 
 
 David Brown wrote:
 
  Emma Johansson writes:
 
   Hi!
  
   I'm wondering how I should do to make tomcat use the paths that
are in
   my CLASSPATH?
  
   Regards,
   / Emma
  
  
   --
   To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]
   For additional commands, e-mail: mailto:tomcat-user-
 [EMAIL PROTECTED]
  
 
 
  Hello Emma, it should not be necessary to make tomcat use anything
in
 the
  CLASSPATH. is there some question about whether tomcat is using ur
 CLASSPATH
  or not? if tomcat is not using ur CLASSPATH how do u know? more info
is
  required: tomcat version, what r u trying to do? what application
have u
  defined using what implementation?: servlets, jsp, what? david.
 
  --
  To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]
  For additional commands, e-mail: mailto:tomcat-user-
 [EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: War files and config info

2002-04-08 Thread Jeremy Joslin

Try setting a parameter in your web.xml to the value of an external
location for your config file.  Inside your init() method check this
location first for the config file you want to load, if you find it load
it and move on, else load the config file you distributed with your
application.  Hope this helps.

Jeremy Joslin
Software Engineer
Spotlife Inc.

 -Original Message-
 From: Bryan P. Glennon [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, April 08, 2002 3:24 PM
 To: [EMAIL PROTECTED]
 Subject: War files and config info
 
 
 Hi -
 We have a web app that gets distributed in a war file to 
 a tomcat 4.0x server. One of the things in the war file is a 
 configuration file for the app. This is an XML file that we 
 open as a resource (using
 getResourceAsStream()) in our main servlet init() method. So 
 far, so good. But, we need a way to override this file so 
 that we can make config changes without redistributing the 
 entire application. If we don't use a war file, we can just 
 put the override file (using the same
 name) in a directory that is earlier in the class path. But 
 we would like to keep the war file, since it does make 
 distribution a bit easier.
 
 Any ideas on how to make this work?
 
 FYI, the exact call we use to open the config file is  
 InputStream in = 
 this.getClass().getClassLoader().getResourceAsStream(configFile);
 
 TIA,
 Bryan
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: TC Performance Testing

2002-03-28 Thread Jeremy Joslin

 -Original Message-
 From: Dahnke, Eric [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, March 28, 2002 9:14 AM
 To: 'Tomcat Users List'
 Subject: RE: TC Performance Testing
 
 
  I have tested Apache 1.3.x and IIS serving static pages using these 
  parameters and both display about 2x the performance. 
 (twice as many 
  pages served in the same amount of time and half as many 
 errors). IS 
  THERE ANYTHING I CAN DO TO INCREASE TC  PERFORMANCE. (ie. 
  MinSpareServers 5, MaxSpareServers 10, stuff like that).
 
 - Disable access logging if you don't need it
 
 How would I disable access logging?
 
 and anyone know what acceptCount=10 does?

From the docs: The maximum queue length for incoming connection
requests when all possible request processing threads are in use. Any
requests received when the queue is full will be refused. The default
value is 10.
Check out
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/http11.html for
more information on other parameters.

Jeremy

 
 Connector 
 className=org.apache.catalina.connector.http.HttpConnector
   port=80 minProcessors=5 maxProcessors=300
   enableLookups=false redirectPort=8443
   acceptCount=10 connectionTimeout=6 debug=0
   scheme=http secure=false/
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: Tomcat/Struts Profiling results

2002-03-04 Thread Jeremy Joslin



 -Original Message-
 From: TKV Tyler VanGorder [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, March 04, 2002 3:32 PM
 To: '[EMAIL PROTECTED]'
 Subject: Tomcat/Struts Profiling results
 

snip

 
 Software
 
 Database Server  == Oracle 8
 EJB Server   == Weblogic 6.1.0 Service Pack 2
 Servlet Engine 1 == Tomcat 4.0.1 
 Servlet Engine 2 == Weblogic 6.1.0 Service Pack 2
 
 (We did not have a separate web server...tomcat and
 weblogic acted as our web server!)

How were the servers configured?  I didn't see anywhere in your post
where you stated that.  Specifically I'd be interested in the
configuration of your tomcat connector(s).

Jeremy Joslin
Software Engineer
SpotLife Inc.
http://www.spotlife.net


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: Double-byte character support in TC 4.0.1

2002-03-04 Thread Jeremy Joslin

If you're encoding characters  127 using the URLEncoder class it would
be worth your time to examine this bug report:
http://developer.java.sun.com/developer/bugParade/bugs/4354951.html

Jeremy Joslin
Software Engineer
Spotlife Inc.
http://www.spotlife.net

-Original Message-
From: Toru Watanabe [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 04, 2002 7:39 PM
To: Tomcat Users List
Subject: Re: Double-byte character support in TC 4.0.1


Hi Kapasi,

Kapasi Can anyone tell me if Tomcat 4.0.1 supports double-byte 
Kapasi characters?

Yes.

Regards,
Watanabe

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]