Re: having webapp reachable at two URLs

2004-05-11 Thread Mats Henrikson
Tim, Mike,

> > If you use Apache in front with jk, could you supply two different
> > jkmount directives ?  (I'm actually asking a question, since I don't
> > know).  ;)

> No. Jk can't rewrite the request. But mod_rewrite can.
> 
> In fact - based on the problem below - using mod_rewrite would probably be 
> the "easiest".

Aha, you have figured out what I am trying to do then, and now this
email will get a bit more complex...

I'm using Apache2 and mod_jk to connect to Tomcat. The reason I need the
webapp deployed at two different URL's in Tomcat is that I need two
different  blocks in Apache to deal with two different ways of
authenticating users. 

Like you said though, I haven't found a way to do this using mod_jk,
which would be the best and simplest way to do it otherwise. 

So, I looked into mod_rewrite, and successfully managed to set it up so
that I can reach the webapp from two different URL's, and mod_rewite
then forwards to the same JkMount. However, the mod_rewrite directives
are evaluated very early in the connection process, before any
 blocks are considered. This means that by the time Apache
starts thinking about which  block to use, the URL has already
been rewritten, and so the same block is considered no matter which
initial URL was used by the user, effectively bypassing the extra
 I wanted them to go through.

So I gave up on the mod_rewrite, and started considering if I could
deploy the same context at two different URL's in Tomcat instead, but if
anybody has a better idea which might work please speak up!

Regards,
-- 
Mats Henrikson
Unix Systems Programmer
Systems Development & Support
Oxford University Computing Services


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



RE: tomcat, SSL and multiple urls

2004-05-11 Thread Shane Linley
The SSL protocol demands that the domain recorded within the SSL certificate
is the same as the domain thru which the SSL connection is obtained.
Otherwise the SSL connection negotiation will fail. This is to avoid the
nastiness of hijacking and whatnot. To use the 2 different domains that you
have you will need 2 different SSL certificates, taking into account the
limitations in the web server et all to handle multiple SSL certificates for
different domains etc.

My memory is a little fuzzy on this area as its been a while since I've had
to think about it so take some salt with this :)

Alternativly if you had a redirector or load balancer of some kind sitting
in front of your web server you could have a SSL certifcate bound to a more
generic domain like www.myserver.net, and have the redirector/balancer dish
out the requests to www.myserver1.net and www.myserver2.net while still
supporting the SSL. I don't know how Tomcats load balancing works with
SSL...

But then i'm not a network architect either... so more salt..

Regards,
Shane.


-Original Message-
From: ian [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 12 May 2004 2:41 PM
To: 'Tomcat Users List'
Subject: tomcat, SSL and multiple urls


Hi. Is it possible for tomcat to have multiple domain names connecting
thru SSL? For example, my tomcat-5.0.19 is hosted on a server with
202.10.11.12 as its public IP. This IP can be accessed thru either
www.myserver1.net or www.myserver2.net. All connections can only go thru
SSL (https). Is this possible? If so, how do I configure tomcat's
keystore?
Thanks in advance.

- ian




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


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



tomcat, SSL and multiple urls

2004-05-11 Thread ian
Hi. Is it possible for tomcat to have multiple domain names connecting
thru SSL? For example, my tomcat-5.0.19 is hosted on a server with
202.10.11.12 as its public IP. This IP can be accessed thru either
www.myserver1.net or www.myserver2.net. All connections can only go thru
SSL (https). Is this possible? If so, how do I configure tomcat's
keystore? 
Thanks in advance.

- ian




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



Re: error starting tomcat5

2004-05-11 Thread Bill Barker

"Steven Garrett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Thanks to those of you who helped me with my previous server.xml include
> file issue, that worked out like a charmeventually :)
>
> Anyways, we're testing out tomcat5 on a RedHat 9 box and I keep getting
this
> error message.
>
> java.lang.NoClassDefFoundError: org/apache/commons/modeler/BaseModelMBean
>
> All I've been able to find so far is that this is supposedly part of the
> catalina.jar (not very helpful I know).  all I'm trying to do is to get
> tomcat to start at this point.  Any suggestions on how to debug this or if
> anyone knows what's wrong that would be great.  Please let me know if you
> need any further information.
>

Actually, it is supposed to be part of commons-modeler.jar which should be
living in $CATALINA_HOME/server/lib.

> Thanks,
>
> Steve




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



Re: Tomcat 4.1 HttpServletRequest.getServerPort() returns incorrect port ?

2004-05-11 Thread Bill Barker

"Ryan Lissack" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> In our setup we have a hardware load-balancer which forwards normal
requests
> to our cluster of Tomcat servers.  For SSL requests, the load balancer
first
> forwards to an hardware SSL accelerator and then on to one of our Tomcat
> servers.  Each Tomcat instance has 2 connectors configured.
>
> For normal requests, clients connect to load balancer on port 80 and the
> load balancer then forwards the request to a Tomcat instance on port 8800.
>
> For secure requests, clients connect to the load balancer on port 443, the
> load balancer then forwards to the SSL accelerator and then the load
> balancer forwards to a Tomcat instance on port 8801.
>
> The problem I am having is that the getServerPort method *always* returns
80
> for all requests even though I know they were received on either port 8800
> or 8801 (netstat also confirms this).  If I connect directly to the
servers
> (http://server:8800), the port is correctly reported.
>
> I can access the correct port by inspecting the incoming requests using
> reflection (request.request.connector.port) but this is obviously far from
> ideal (non-portable etc).
>
> Does anyone have an idea why this is occurring or perhaps a way around the
> problem ?

This is occurring because getServerPort returns the value that the request
was sent to (i.e. the value in the 'Host' HTTP header).  This is necessary
so that it is possible to form URLs that refer back to the server (e.g.
response.sendRedirect).

The way around the problem is to upgrade to Tomcat 5, and use
request.getLocalPort.  This returns the port that the request was received
on.

>
> Thanks,
> Ryan.
>
> Tomcat 4.1.24, Sun Java 1.4.2, RedHat 9




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



full URL

2004-05-11 Thread rlipi
Hi,
is it possible to (in servlet or JSP) gain full URL string? It means
protocol, server, "directory", parameters, user identification.

There are methods in the servlet that return parts of the URL. But I
didn't find method that returns full URL string.

Than you,
Lipi




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



Re: [ANN] The Reference Scanner and Jakarta Tomcat - Heap Profiling, Memory Leaks

2004-05-11 Thread Joseph Shraibman
Jacob Kjome wrote:
At 11:47 PM 5/11/2004 -0400, you wrote:

Joerg Baumgaertel wrote:

Hi all,
because often requested,
I added a Jakarta-Tomcat-Howto to the 'jb2works.com' website.
You find the following documents
- How to scan a Java webapplication
  http://jb2works.com/refscan/tomcat.html
- How to scan Jakarta-Tomcat full-space
  http://jb2works.com/refscan/tomcatfull.html


I tried that, but when trying to run tomcat I got:

Due to new licensing guidelines mandated by the Apache Software
Foundation Board of Directors, a JMX implementation can no longer
be distributed with the Apache Tomcat binaries. As a result, you
must download a JMX 1.2 implementation (such as the Sun Reference
Implementation) and copy the JAR containing the API and
implementation of the JMX specification to:
${catalina.home}/bin/jmx.jar
...which confuses me, because jmx.jar is still where it always was. 
Using the bootstrap.jar that came with tomcat works fine.


If you use the latest version of Tomcat5, you'll find that this is not 
an issue.  Download Tomcat-5.0.24.  The implementation of JMX that said 
version of Tomcat comes with is MX4J which is open source so there is no 
problem anymore.

Jake
I am using 5.0.24, and jmx.jar is there.  Tomcat works if I use the
Bootstrap.class that comes with it, but if I recompile Bootstrap.class 
per the instructions on http://jb2works.com/refscan/tomcatfull.html it 
suddenly gives me that error message.

I can post the jar file if you think that will help.

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


Re: strange memory problem

2004-05-11 Thread Joseph Shraibman
java.lang.OutOfMemoryError is also thrown when java can't start up a 
thread because it reached the system limit.  Could that be your problem?

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


strange memory problem

2004-05-11 Thread Arne Schirmacher
I try to run several instances of a large web
application in one Tomcat. My JAVA_OPTS shell variable
is set to "-Xmx700m -Xms700m" and the web application
also reports that 700 MByte RAM are available, and
maybe 180 MByte in use.

After a few hours I got the java.lang.OutOfMemoryError
in catalina.out. At this point the java processes are
no larger than maybe 400 - 450 MByte. There is plenty
of RAM left (the server has 1 GByte). The free memory
as reported by the web application or Tomcat is
nowhere tight, although it is difficult to pick a
point of time right before the crash.

I tried this with Tomcat 4.1.30 and 5.0.19. Java is
j2sdk1.4.2_04. System is Linux 2.4.26 patched with
grsecurity.

Any help is really appreciated.






Mit schönen Grüßen von Yahoo! Mail - http://mail.yahoo.de

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



Re: [ANN] The Reference Scanner and Jakarta Tomcat - Heap Profiling, Memory Leaks

2004-05-11 Thread Jacob Kjome
At 11:47 PM 5/11/2004 -0400, you wrote:
Joerg Baumgaertel wrote:
Hi all,
because often requested,
I added a Jakarta-Tomcat-Howto to the 'jb2works.com' website.
You find the following documents
- How to scan a Java webapplication
  http://jb2works.com/refscan/tomcat.html
- How to scan Jakarta-Tomcat full-space
  http://jb2works.com/refscan/tomcatfull.html
I tried that, but when trying to run tomcat I got:

Due to new licensing guidelines mandated by the Apache Software
Foundation Board of Directors, a JMX implementation can no longer
be distributed with the Apache Tomcat binaries. As a result, you
must download a JMX 1.2 implementation (such as the Sun Reference
Implementation) and copy the JAR containing the API and
implementation of the JMX specification to:
${catalina.home}/bin/jmx.jar
...which confuses me, because jmx.jar is still where it always was. Using 
the bootstrap.jar that came with tomcat works fine.
If you use the latest version of Tomcat5, you'll find that this is not an 
issue.  Download Tomcat-5.0.24.  The implementation of JMX that said 
version of Tomcat comes with is MX4J which is open source so there is no 
problem anymore.

Jake


BTW in your instructions you say to add:

 HttpScanner.start( startupInstance );

... but what is really needed is:

com.jb2works.reference.HttpScanner.start( startupInstance ); // <-- !!

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


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


RE: Requested Resource Not Available

2004-05-11 Thread Jonathan Quinn

You nailed it.  My url was wrong.  How silly..

Thanks for the help!

 Original message 
>Date: Tue, 11 May 2004 13:35:06 -0400
>From: "Shapira, Yoav" <[EMAIL PROTECTED]>  
>Subject: RE: Requested Resource Not Available  
>To: "Tomcat Users List" <[EMAIL PROTECTED]>
>
>
>Hi,
>
>>Having read that similar new users had this kind of problem,
>>I've stared at the mappings for about 16 hours now, and I
>
>Ouch, 16 hours ;)
>
>>   
>>   HelloServlet
>>   /my-hello/hello
>>   
>
>With this mapping, you servlet would be accessible at
>http://yourhost:yourport/yourWebappName/my-hello/hello.  
What URL have
>you been trying for accessing the servlet?
>
>Yoav Shapira
>
>
>
>This e-mail, including any attachments, is a confidential 
business communication, and may contain information that is 
confidential, proprietary and/or privileged.  This e-mail is 
intended only for the individual(s) to whom it is addressed, 
and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, 
please immediately delete this e-mail from your computer 
system and notify the sender.  Thank you.
>
>
>-

>To unsubscribe, e-mail: tomcat-user-
[EMAIL PROTECTED]
>For additional commands, e-mail: tomcat-user-
[EMAIL PROTECTED]
>

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



RE: Multihosting in tomcat

2004-05-11 Thread k e
I too have questions concerning multihosting with Tomcat.

Yoav has mentioned a few times about not needing a connector to IIS or 
Apache.  What I wonder is whether or not the Tomcat Standalone method would 
work in a situation where you have 20+ instances (Windows Services/JVMs) 
running on one installation of Tomcat.

There does not seem to be any documentation for Tomcat in a multihosting 
environment.  The main things which are lacking are the results of setting 
certain parameters too high or too low.

Ex. MaxProcessors (Tomcat 4.1.27)  - we have an issue where one site will 
creep up to 107 thread and be so slow that we have to restart the service 
(JVM Instance.)  Default value is 75 - how does it even get up to 107?  We 
have been constantly modifiying this along with accept count and monitoring 
trying to figure the best fit.  However, I don't know if this is a good 
value to be modifying when you have 20+ sites.

My Questions:

1) Is Tomcat Standalone (4.1.27 or higher) still a viable implementation in 
a multi-instance scenario?
2) What are the ramifications of modifing these parameters in a 
multi-instance scenario?
3) Is anyone willing to join a create a discussion group on this topic or 
should we keep posting our thoughts/concerns here?

So far the testing of standalone tomcat proves to be ok, however, I am weary 
of changing production because test environment and load tests almost never 
provide the same results as real life :)

If anyone has any experience, knowledge or thoughts - please reply.

Thanks.

_
Best Restaurant Giveaway Ever! Vote for your favorites for a chance to win 
$1 million! http://local.msn.com/special/giveaway.asp

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


Re: [ANN] The Reference Scanner and Jakarta Tomcat - Heap Profiling, Memory Leaks

2004-05-11 Thread Joseph Shraibman
Joerg Baumgaertel wrote:
Hi all,

because often requested,
I added a Jakarta-Tomcat-Howto to the 'jb2works.com' website.
You find the following documents
- How to scan a Java webapplication
  http://jb2works.com/refscan/tomcat.html
- How to scan Jakarta-Tomcat full-space
  http://jb2works.com/refscan/tomcatfull.html
I tried that, but when trying to run tomcat I got:

Due to new licensing guidelines mandated by the Apache Software
Foundation Board of Directors, a JMX implementation can no longer
be distributed with the Apache Tomcat binaries. As a result, you
must download a JMX 1.2 implementation (such as the Sun Reference
Implementation) and copy the JAR containing the API and
implementation of the JMX specification to:
${catalina.home}/bin/jmx.jar
...which confuses me, because jmx.jar is still where it always was. 
Using the bootstrap.jar that came with tomcat works fine.

BTW in your instructions you say to add:

 HttpScanner.start( startupInstance );

... but what is really needed is:

com.jb2works.reference.HttpScanner.start( startupInstance ); // <-- !!

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


Re: log in page using tomcat

2004-05-11 Thread QM
On Tue, May 11, 2004 at 07:53:48PM -0600, Arora, Avinash wrote:
:Does tomcat provides any help in creating the "log in" page. I want
: to create a login page, that will accept same username and password
: specified in server.xml particular data source context (for logging to
: database) in the ResourceParams tag.

If I understand your question:
- check the Tomcat docs for "Realms."
- check the servlet spec for authentication.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



log in page using tomcat

2004-05-11 Thread Arora, Avinash
Hi,
   Does tomcat provides any help in creating the "log in" page. I want
to create a login page, that will accept same username and password
specified in server.xml particular data source context (for logging to
database) in the ResourceParams tag. 
Thanks.

Avinash Arora


 

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



Configuration free persistence?

2004-05-11 Thread Will Hartung
This is blasphemy, I know...but...

As far as I know, there is no portable way that a generic Webapp bundled in
a WAR, and dropped into a random container can persist information from one
run of the container to another.

On the one hand, there is no requirement that a WAR be exploded on deploy,
and you certainly can't write to a resource that's bundled in a Jar file.

On the other hand, you can get access to a Temp directory, and persist
information there, but there is no guarantee that the information will be
there when the container restarts.

What this means is that you can not take a portable WAR, plop it into an
arbitrary container, and then let the Webapp "self configure" with either
reasonable defaults, or even through a web page.

So, in order to get any portable persistence, you must:

a) Explode the WAR, change the web.xml to add/change a parameter, and
rebundle it and then deploy it.
b) Require that a database be present and publish the datasource name that
the web app is looking for, and assume that the user will configure their
container properly (and, of course, your web app must be compatible with
that database).
c) set a system property on the command line telling the Webapp its
persistence information
d) create a "less" portable Webapp and rely on container specific behaviors
on which you can make assumptions.

Actually, is there even an API that lets the Webapp identify its container?
There must be something somewhere, I just haven't looked.

So, what are you folks trying/doing to make "easily deployed" WARs that
needs to save setup options or even other real data?

Regards,

Will Hartung
([EMAIL PROTECTED])


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



Tomcat.exe w2k Mem limit?

2004-05-11 Thread Stuart Larking
Anyone hit a limit on TC 4.1.x Mem Usage size (or other unexpected limit)
with tomcat.exe on w2k?  

We are running  TC 4.1.29, which is running as a service using tomcat.exe. 
The -Xmx (on the service in the registry as a JVM Option) is set to 1580m as
the machine has plenty of RAM and lots of  data (app is memory hungry).

When the Windows Task Manager Mem Usage gets above 600mb (sometimes as high
as 700mb), tomcat slows to a crawl and a few requests later the server dies
with the following error in the stderr.log.  The threads get to about
200-260 for the tomcat.exe (MaxProcesses set to 500).


Severe: Caught exception executing
[EMAIL PROTECTED], terminating thread 
java.lang.OutOfMemoryError: unable to create new native thread at
java.lang.Thread.start(Native Method) 
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.(ThreadPool.
java:630) 


We thought it might be related to the native thread pool being set too high,
so set the -Xss to 16k, but same results.  

When we run with the same JVM Options in catalina.bat and launch from the
startup.bat (run it in the console) the Mem Usage scales over the 1gb mark
and the threads go to about 800 without any issue as expected.
Unfortunately running it as a console is not a desirable option for us.


Platform details:

Compaq Proliant server 
4GB Ram 
Windows 2k Server 
java version "1.4.2_03" 
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) 
Java HotSpot(TM) Server VM (build 1.4.2_03-b02, mixed mode)
Apache Tomcat v4.1.29 
-server
-Xms1580
-Xmx1580
-Xss16k

Any help greatly appreciated.


Definitive Documentation for RH9, mod_jk2, Apache2 & Tomcat 5?

2004-05-11 Thread Dan Barron
Hello,

Is anyone aware of any definitive documentation for compiling, installing, 
and configuring mod_jk2 on Red Hat9 with Apache2 and Tomcat5?

Thank you,

Dan Barron

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


RE: symLinks broken in tomcat 5.0.19

2004-05-11 Thread Randy
Thank you for the response,

I have it within the Host. There are no errors or warnings in the log file.

I was assuming it should be inside of the Context. From what I could tell
you can put it in the engine or host and that would override the defaults
for contexts created. I really only want it for this host.

I have tried it both Inside the Context and inside the Host
No errors 



 

 

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 11, 2004 3:00 PM
To: Tomcat Users List
Subject: RE: symLinks broken in tomcat 5.0.19


Hi,

>If I go to
>http://www.mydomain.com:8080/activeedit/ae.jsp I get a 404 If I go to 
>http://www.mydomain.com:8080/activeedit4.0/ae.jsp it works
>
>Activeedit is a symlink to activeedit4.0
>
>In the server.xml I have
>allowLinking="true"  />

Where in server.xml is this?

>Am I missing something??

Yeah, a bunch: your symlink  has the effect of deploying two different
contexts.  You have to be very careful with your configuration if you do
this: check your logs for any warnings or errors.

There are other ways to achieve what you're doing, including options that
were discussed today on the list.

Yoav Shapira



This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


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





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



RE: Streaming pdf document fails

2004-05-11 Thread Summers, Bert W.
Added
  response.setHeader("Pragma", "cache");
  response.setHeader("Cache-Control", "cache");

And now it works.
I was not adding the cache-control, something else must have but did not
override my setting to cache.

Mozilla still double downloads, but then 90% of my users are IE.

Thanks.

-Original Message-
From: Sasha Borodin [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 11, 2004 2:23 PM
To: Tomcat Users List
Subject: Re: Streaming pdf document fails


Bert,

I just ran across something similar today, read this document:

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:
80/support/kb/articles/q316/4/31.asp&NoWebContent=1

The way I understand it, IE wants to save the file in cache before letting
you view it; if you're requesting something via SSL (https://...) IE
actually honors the cache defeating tags, which I noticed you have; hence
the error.  Removing the...

> Pragma: No-cache
> Cache-Control: no-cache

...headers should fix your problem, I think.  It worked for me, let me know
if this words for you too.

-Sasha

> From: "Summers, Bert W." <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> Date: Tue, 11 May 2004 12:32:49 -0700
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: RE: Streaming pdf document fails
> 
> This is what tcptrace tells me is being sent back to the browser
> 
> HTTP/1.1 200 OK
> Pragma: No-cache
> Cache-Control: no-cache
> Expires: Thu, 01 Jan 1970 00:00:00 GMT
> Content-disposition: attachment; filename=N77-NTSP-E-70-0203.pdf
> Content-Type: application/pdf
> Content-Length: 443928
> Date: Tue, 11 May 2004 19:29:37 GMT
> Server: Apache-Coyote/1.1
> 
> If I remove the Content-disposition then the PDF opens in the browser 
> ok, but that is not what I want. Secondly Mozilla still asks for the 
> file twice and gets it, but only displays one of them.
> 
> 
> -Original Message-
> From: Christoph Meier [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 11, 2004 12:28 PM
> To: Tomcat Users List
> Subject: Re: Streaming pdf document fails
> 
> 
> As far as i remeber, IE wants to know the content-length to show a 
> PDF. => put the appopriate content-length into your Response-Header, 
> ensure to have set the right content-type and i would expect that the 
> PDF-stream should work then for IE, too.
> 
> _christoph
> 
>> I have a problem that just came up.  I have PDF documents located out 
>> side of my webapps directory. When the user wants one they go to my 
>> servlet which streams it back. This use to work just fine, but now is 
>> broke.
>> 
>> In IE I get Error opening document on TC4.1.30 and unable to open 
>> this Internet site in TC 5.0.19
>> 
>> Mozilla 1.6 does not have a problem opening the file.
>> 
>> What is odd is that Mozilla seems to request the servlet twice from 
>> one click, the first tends to throw this
>> ClientAbortException:  java.net.SocketException: Software caused 
>> connection
>> abort: socket write error
>>at 
>> org.apache.coyote.tomcat4.OutputBuffer.realWriteBytes(OutputBuffer.ja
>> va:410
> )
>>at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:332)
>>at
>> org.apache.coyote.tomcat4.OutputBuffer.writeBytes(OutputBuffer.java:438)
>>at
>> org.apache.coyote.tomcat4.OutputBuffer.write(OutputBuffer.java:425)
>>at
>> org.apache.coyote.tomcat4.CoyoteOutputStream.write(CoyoteOutputStream
>> .java:
> 1
>> 08)
>>at GetPDFDoc.outputFile(GetPDFDoc.java:128)
>>at GetPDFDoc.processRequest(GetPDFDoc.java:86)
>>at GetPDFDoc.doGet(GetPDFDoc.java:147)
>> 
>> Is there anything wrong with what I am doing?
>>  response.setContentType("application/pdf");
>>  response.setDateHeader("Expires", 0);
>> // open pdf outside of browser
>>  response.addHeader("Content-disposition", "attachment; 
>> filename="
>> + ntspNo + ".pdf");
>>  response.setContentLength((int)f.length());
>>  java.io.OutputStream out = response.getOutputStream(); // f is 
>> the pdf on the file system and it does exist
>>  java.io.FileInputStream in = new java.io.FileInputStream(f);
>>  int size = 0;
>>  byte[] buffer = new byte[8192];
>>  while( (size = in.read(buffer, 0, buffer.length)) != -1)
>>  {
>>out.write(buffer, 0, size);
>>  }
>>  in.close();
>>  out.close();
>> 
>> Thanks
>> 
>>  
>> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



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

-
To unsubscribe, e-mail: [EM

error starting tomcat5

2004-05-11 Thread Steven Garrett
Hi,

Thanks to those of you who helped me with my previous server.xml include
file issue, that worked out like a charmeventually :)

Anyways, we're testing out tomcat5 on a RedHat 9 box and I keep getting this
error message.

java.lang.NoClassDefFoundError: org/apache/commons/modeler/BaseModelMBean

All I've been able to find so far is that this is supposedly part of the
catalina.jar (not very helpful I know).  all I'm trying to do is to get
tomcat to start at this point.  Any suggestions on how to debug this or if
anyone knows what's wrong that would be great.  Please let me know if you
need any further information.

Thanks,

Steve

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



Re: Streaming pdf document fails

2004-05-11 Thread Sasha Borodin
Bert,

I just ran across something similar today, read this document:

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:
80/support/kb/articles/q316/4/31.asp&NoWebContent=1

The way I understand it, IE wants to save the file in cache before letting
you view it; if you're requesting something via SSL (https://...) IE
actually honors the cache defeating tags, which I noticed you have; hence
the error.  Removing the...

> Pragma: No-cache
> Cache-Control: no-cache

...headers should fix your problem, I think.  It worked for me, let me know
if this words for you too.

-Sasha

> From: "Summers, Bert W." <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> Date: Tue, 11 May 2004 12:32:49 -0700
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: RE: Streaming pdf document fails
> 
> This is what tcptrace tells me is being sent back to the browser
> 
> HTTP/1.1 200 OK
> Pragma: No-cache
> Cache-Control: no-cache
> Expires: Thu, 01 Jan 1970 00:00:00 GMT
> Content-disposition: attachment; filename=N77-NTSP-E-70-0203.pdf
> Content-Type: application/pdf
> Content-Length: 443928
> Date: Tue, 11 May 2004 19:29:37 GMT
> Server: Apache-Coyote/1.1
> 
> If I remove the Content-disposition then the PDF opens in the browser ok,
> but that is not what I want.
> Secondly Mozilla still asks for the file twice and gets it, but only
> displays one of them.
> 
> 
> -Original Message-
> From: Christoph Meier [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 11, 2004 12:28 PM
> To: Tomcat Users List
> Subject: Re: Streaming pdf document fails
> 
> 
> As far as i remeber, IE wants to know the content-length to show a PDF. =>
> put the appopriate content-length into your Response-Header, ensure
> to have set the right content-type and i would expect that the
> PDF-stream should work then for IE, too.
> 
> _christoph
> 
>> I have a problem that just came up.  I have PDF documents located out
>> side of my webapps directory. When the user wants one they go to my
>> servlet which streams it back. This use to work just fine, but now is
>> broke.
>> 
>> In IE I get Error opening document on TC4.1.30 and unable to open this
>> Internet site in TC 5.0.19
>> 
>> Mozilla 1.6 does not have a problem opening the file.
>> 
>> What is odd is that Mozilla seems to request the servlet twice from one
>> click, the first tends to throw this
>> ClientAbortException:  java.net.SocketException: Software caused
>> connection
>> abort: socket write error
>>at
>> org.apache.coyote.tomcat4.OutputBuffer.realWriteBytes(OutputBuffer.java:410
> )
>>at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:332)
>>at
>> org.apache.coyote.tomcat4.OutputBuffer.writeBytes(OutputBuffer.java:438)
>>at
>> org.apache.coyote.tomcat4.OutputBuffer.write(OutputBuffer.java:425)
>>at
>> org.apache.coyote.tomcat4.CoyoteOutputStream.write(CoyoteOutputStream.java:
> 1
>> 08)
>>at GetPDFDoc.outputFile(GetPDFDoc.java:128)
>>at GetPDFDoc.processRequest(GetPDFDoc.java:86)
>>at GetPDFDoc.doGet(GetPDFDoc.java:147)
>> 
>> Is there anything wrong with what I am doing?
>>  response.setContentType("application/pdf");
>>  response.setDateHeader("Expires", 0);
>> // open pdf outside of browser
>>  response.addHeader("Content-disposition", "attachment; filename="
>> + ntspNo + ".pdf");
>>  response.setContentLength((int)f.length());
>>  java.io.OutputStream out = response.getOutputStream(); // f is
>> the pdf on the file system and it does exist
>>  java.io.FileInputStream in = new java.io.FileInputStream(f);
>>  int size = 0;
>>  byte[] buffer = new byte[8192];
>>  while( (size = in.read(buffer, 0, buffer.length)) != -1)
>>  {
>>out.write(buffer, 0, size);
>>  }
>>  in.close();
>>  out.close();
>> 
>> Thanks
>> 
>>  
>> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



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



apache 2 + omcat 5 with mod_jk2

2004-05-11 Thread Dionisio Ruiz de Zárate
hello my workers2.properties file i include in apache with:
LoadModule jk2_module /usr/lib/apache2/mod_jk2.so
JkSet config.file /etc/apache2/workers2.properties

the properties file has:
[shm]
info=Scoreboard. Requried for reconfiguration and status with multiprocess
servers.
file=anon

# Defines a load balancer named lb. Use even if you only have one machine.
[lb:lb]

# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
group=lb

# Map the Tomcat examples webapp to the Web server uri space
[uri:/examples/*]
group=lb

[status:]
info=Status worker, displays runtime information

[uri:/jkstatus/*]
info=The Tomcat /jkstatus handler
group=status:



But how must i say to the virtual domains, to the apache to redirect the jsp
petitions to the tomcat?
with:
   
   JkUriSet worker ajp13:localhost:8009
   

???
is this all?

i have configured my virtual domains in tomcat and in apache, both resolves
them well.
but what must i to put in the pache con file, for each domain, to redirect
the jsp to the tomcat?

with mod_jk is had this:

JkMount /*.jsp ajp13
but in mod_jk2? how?
i must to modify the workers2.properties for configurint the several virtual
domains?

thanks



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



RE: forwarding across contexts?

2004-05-11 Thread Justin Ruthenbeck
At 01:04 PM 5/11/2004, you wrote:
Justin,

Thanks again for taking the time to think about this with me.

Alas, my customer's deployment platform is windows. So
no symlinks. No Apache (they use IIS). Complicated security
model for everything on the site except for decorative gifs.
So Tomcat does it all!
In that case, I would personally either extend or implement
the DefaultServlet to read resources from a designated local
location (given by a servlet init param).  It seems silly
to add a webApp that consists only of static content in this
case ... but you know how to do it if you deem that best.
Once you decide what you're going to do and implement it, I'd be
curious to get your feedback and/or comments on your method.
If you remember this conversation when you're done, shoot
me/us an email with any observations.
Good luck,
justin
At 03:13 PM 5/11/2004, you wrote:

Fred,

Thanks for the additional info about your app ... it makes it much
easier to talk about these things.  :)  There are many (valid) ways
to proceed, many of which vary in the amount of "standards" they
adhere to (how much you want to align yourself with Tomcat).
I'll just give you my thoughts.
At 09:02 AM 5/11/2004, you wrote:
Let me describe a bit about our application, just in case you
(or anyone else) have some specific advice.
My client is a publisher, and the bulk of the site will be many
thousands of published articles and associated content such
as figure, tables, etc.
The HTML content, however, will be served by tomcat, since
it has some dynamic components.
The biggest question, then, has to do with your security requirements.
Specifically, does this content need to be protected or can it just
sit out there for anyone to grab?
If it need not be protected, this is, IMHO, a textbook example of when
to use Apache.  You've got a large collection of static data and a
relatively small web application associated with it.  You've probably
got different groups working on the different parts (the publisher's
content and the HTML pages), so it makes sense to separate it out and
serve the static content by generating links to your static web server's
content from your dynamic HTML.  Additionally, you could then put the
two pieces on separate machines (one or more with Apache, one or more
with Tomcat) to keep them separated even more cleanly.
If the content needs to be protected, I would create a separate
directory and put the content there.  Symlink this to the base of your
Tomcat webApp and let Tomcat serve it normally, employing whatever
security scheme you're using.  You won't be able to deploy the entire
thing as a single WAR, but it doesn't sound like you really care to
do this anyways.
This is why it's not practical to bundle everything into a war file.
Instead, I need tomcat to point to the file system where many
users will be building the site.
On the other hand, the war file can easily contain the java 
infrastructure
(struts, velocity, configuration information, etc.). I'd like to be able
to keep the small war file, hot deploy, etc., but have the raw content
(static and otherwise) live elsewhere.

Given that, would you solve it with multiple contexts? Or do you
have another suggestion?
Alternately, you could extend the DefaultServlet (if you don't mind tying
yourself to Tomcat and your version) with your own custom static content
servlet that gets data from an arbitrary directory.  If you can't be
tied to Tomcat, use the source as a base to write your own default
servlet.  This solution is more on the "slick" side of things, so it
wouldn't be preferable ... better to stay within the mainstream
boundaries.
If you can, look into symlinking or Apache.  Consider the extend/impl
DefaultServlet idea.  If you're still not satisfied, having two
separate contexts can be made to work.  Perhaps others have additional
ideas.

Fred
Good luck,
justin

At 10:08 AM 5/11/2004, you wrote:

Hi,

>Is there a way, within a single context, to separate out
>the static content to some other file system location.
Of course, there are many ways, none of them advised.  You want to keep
your webapp as a whole, that's the whole point of a WAR file.  You can
symlink (at the filesystem level) or use normal HTTP linking to access
your static content.  But you can't symlink in a WAR, so...
>I believe that Yoav's suggestion is that I set up the empty
>path ("") context for this purpose. However, this is where
>I started, and Justin argued against this "cross-context"
>approach.
And I agree with Justin, just to be clear.  I wasn't advocating 
anything
different from what he said, just showing you that it can technically 
be
done.  If crossContext forwards are the worst design choices on this
list, we'll be in great shape.

Yoav Shapira



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for the 
individual(s) to whom it is ad

RE: forwarding across contexts?

2004-05-11 Thread Fred Toth
Justin,

Thanks again for taking the time to think about this with me.

Alas, my customer's deployment platform is windows. So
no symlinks. No Apache (they use IIS). Complicated security
model for everything on the site except for decorative gifs.
So Tomcat does it all!

Thanks,

Fred

At 03:13 PM 5/11/2004, you wrote:

Fred,

Thanks for the additional info about your app ... it makes it much
easier to talk about these things.  :)  There are many (valid) ways
to proceed, many of which vary in the amount of "standards" they
adhere to (how much you want to align yourself with Tomcat).
I'll just give you my thoughts.
At 09:02 AM 5/11/2004, you wrote:
Let me describe a bit about our application, just in case you
(or anyone else) have some specific advice.
My client is a publisher, and the bulk of the site will be many
thousands of published articles and associated content such
as figure, tables, etc.
The HTML content, however, will be served by tomcat, since
it has some dynamic components.
The biggest question, then, has to do with your security requirements.
Specifically, does this content need to be protected or can it just
sit out there for anyone to grab?
If it need not be protected, this is, IMHO, a textbook example of when
to use Apache.  You've got a large collection of static data and a
relatively small web application associated with it.  You've probably
got different groups working on the different parts (the publisher's
content and the HTML pages), so it makes sense to separate it out and
serve the static content by generating links to your static web server's
content from your dynamic HTML.  Additionally, you could then put the
two pieces on separate machines (one or more with Apache, one or more
with Tomcat) to keep them separated even more cleanly.
If the content needs to be protected, I would create a separate
directory and put the content there.  Symlink this to the base of your
Tomcat webApp and let Tomcat serve it normally, employing whatever
security scheme you're using.  You won't be able to deploy the entire
thing as a single WAR, but it doesn't sound like you really care to
do this anyways.
This is why it's not practical to bundle everything into a war file.
Instead, I need tomcat to point to the file system where many
users will be building the site.
On the other hand, the war file can easily contain the java infrastructure
(struts, velocity, configuration information, etc.). I'd like to be able
to keep the small war file, hot deploy, etc., but have the raw content
(static and otherwise) live elsewhere.
Given that, would you solve it with multiple contexts? Or do you
have another suggestion?
Alternately, you could extend the DefaultServlet (if you don't mind tying
yourself to Tomcat and your version) with your own custom static content
servlet that gets data from an arbitrary directory.  If you can't be
tied to Tomcat, use the source as a base to write your own default
servlet.  This solution is more on the "slick" side of things, so it
wouldn't be preferable ... better to stay within the mainstream
boundaries.
If you can, look into symlinking or Apache.  Consider the extend/impl
DefaultServlet idea.  If you're still not satisfied, having two
separate contexts can be made to work.  Perhaps others have additional
ideas.

Fred
Good luck,
justin

At 10:08 AM 5/11/2004, you wrote:

Hi,

>Is there a way, within a single context, to separate out
>the static content to some other file system location.
Of course, there are many ways, none of them advised.  You want to keep
your webapp as a whole, that's the whole point of a WAR file.  You can
symlink (at the filesystem level) or use normal HTTP linking to access
your static content.  But you can't symlink in a WAR, so...
>I believe that Yoav's suggestion is that I set up the empty
>path ("") context for this purpose. However, this is where
>I started, and Justin argued against this "cross-context"
>approach.
And I agree with Justin, just to be clear.  I wasn't advocating anything
different from what he said, just showing you that it can technically be
done.  If crossContext forwards are the worst design choices on this
list, we'll be in great shape.
Yoav Shapira



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for the 
individual(s) to whom it is addressed, and may not be saved, copied, 
printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your 
computer system and notify the sender.  Thank you.

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


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


__

RE: Streaming pdf document fails

2004-05-11 Thread Bui, Bao-Ha D
I am not using it with all the app server you mentioned but in my mimetype
string is "application/octet-stream" and it works.  However, it also doing
the double request like you mentioned.  When you find out why it's doing
that, please post.

Thanks.

-Original Message-
From: Summers, Bert W. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 11, 2004 1:55 PM
To: [EMAIL PROTECTED]
Subject: Streaming pdf document fails

I have a problem that just came up.  I have PDF documents located out side
of my webapps directory.
When the user wants one they go to my servlet which streams it back.
This use to work just fine, but now is broke.
 
In IE I get Error opening document on TC4.1.30 and unable to open this
Internet site in TC 5.0.19
 
Mozilla 1.6 does not have a problem opening the file.
 
What is odd is that Mozilla seems to request the servlet twice from one
click, the first tends to throw this
ClientAbortException:  java.net.SocketException: Software caused connection
abort: socket write error
at
org.apache.coyote.tomcat4.OutputBuffer.realWriteBytes(OutputBuffer.java:410)
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:332)
at
org.apache.coyote.tomcat4.OutputBuffer.writeBytes(OutputBuffer.java:438)
at
org.apache.coyote.tomcat4.OutputBuffer.write(OutputBuffer.java:425)
at
org.apache.coyote.tomcat4.CoyoteOutputStream.write(CoyoteOutputStream.java:1
08)
at GetPDFDoc.outputFile(GetPDFDoc.java:128)
at GetPDFDoc.processRequest(GetPDFDoc.java:86)
at GetPDFDoc.doGet(GetPDFDoc.java:147)
 
Is there anything wrong with what I am doing?
  response.setContentType("application/pdf");
  response.setDateHeader("Expires", 0);
// open pdf outside of browser
  response.addHeader("Content-disposition", "attachment; filename=" +
ntspNo + ".pdf");
  response.setContentLength((int)f.length());
  java.io.OutputStream out = response.getOutputStream();
// f is the pdf on the file system and it does exist
  java.io.FileInputStream in = new java.io.FileInputStream(f);
  int size = 0;
  byte[] buffer = new byte[8192];
  while( (size = in.read(buffer, 0, buffer.length)) != -1)
  {
out.write(buffer, 0, size);
  }
  in.close();
  out.close();
 
Thanks


* 
This communication may contain information that is proprietary, privileged,
confidential or legally exempt from disclosure.  If you are not a named
addressee, you are notified that you are not authorized to read, print,
retain, copy or disseminate this communication without the consent of the
sender and that doing so may be unlawful. If you have received this
communication in error, please notify the sender via return e-mail and
delete it from your computer. Thank you. St. Jude Medical, Inc. 
*


RE: symLinks broken in tomcat 5.0.19

2004-05-11 Thread Shapira, Yoav

Hi,

>If I go to
>http://www.mydomain.com:8080/activeedit/ae.jsp I get a 404
>If I go to
>http://www.mydomain.com:8080/activeedit4.0/ae.jsp it works
>
>Activeedit is a symlink to activeedit4.0
>
>In the server.xml I have
>allowLinking="true"  />

Where in server.xml is this?

>Am I missing something??

Yeah, a bunch: your symlink has the effect of deploying two different
contexts.  You have to be very careful with your configuration if you do
this: check your logs for any warnings or errors.

There are other ways to achieve what you're doing, including options
that were discussed today on the list.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Manager language is wrong

2004-05-11 Thread Yansheng Lin
Hahaha, did you click on the Japanese link by mistake:).

Seriously though, I was working on w2k with Japanese IME installed for a
long time, I know if you set you default locale to Japanese locale, some of
the pages will display things in Japanese.  Maybe that's the case with your
system, that your default locale is Japanese and tomcat uses resource bundle
for Japanese.

-Yan

-Original Message-
From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]

Sent: May 11, 2004 02:04
To: [EMAIL PROTECTED]
Subject: Manager language is wrong


I've just installed Tomcat 5.0.19 on an 'English' Windows 2000 machine with
the Japanese IME also installed.

Tomcat display it index and admin pages in English but when I access the
manager the page is displayed in Japanese. This happens under both IE and
N7.

Can anyone tell me how to 'fix' this so the manager appears in English?

Thanks,

Jc


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


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



symLinks broken in tomcat 5.0.19

2004-05-11 Thread Randy
 hello

I have just updated to tomcat 5.0.19

It appears that symLinks are broken

If I go to 
http://www.mydomain.com:8080/activeedit/ae.jsp I get a 404
If I go to 
http://www.mydomain.com:8080/activeedit4.0/ae.jsp it works

Activeedit is a symlink to activeedit4.0

In the server.xml I have 


Am I missing something??

Thanks for any information



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



Re: Streaming pdf document fails

2004-05-11 Thread Christoph Meier
I never used >>Content-disposition<<, yet. But it worked.
What is the "Content-disposition" for? to let the client sto store the 
PDF under the name which is after "filename="? ...



This is what tcptrace tells me is being sent back to the browser

HTTP/1.1 200 OK
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-disposition: attachment; filename=N77-NTSP-E-70-0203.pdf
Content-Type: application/pdf
Content-Length: 443928
Date: Tue, 11 May 2004 19:29:37 GMT
Server: Apache-Coyote/1.1
If I remove the Content-disposition then the PDF opens in the browser ok,
but that is not what I want.
Secondly Mozilla still asks for the file twice and gets it, but only
displays one of them.
-Original Message-
From: Christoph Meier [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 11, 2004 12:28 PM
To: Tomcat Users List
Subject: Re: Streaming pdf document fails

As far as i remeber, IE wants to know the content-length to show a PDF. =>
put the appopriate content-length into your Response-Header, ensure 
to have set the right content-type and i would expect that the 
PDF-stream should work then for IE, too.

_christoph

 

I have a problem that just came up.  I have PDF documents located out 
side of my webapps directory. When the user wants one they go to my 
servlet which streams it back. This use to work just fine, but now is 
broke.

In IE I get Error opening document on TC4.1.30 and unable to open this 
Internet site in TC 5.0.19

Mozilla 1.6 does not have a problem opening the file.

What is odd is that Mozilla seems to request the servlet twice from one 
click, the first tends to throw this
ClientAbortException:  java.net.SocketException: Software caused 
connection
abort: socket write error
  at
org.apache.coyote.tomcat4.OutputBuffer.realWriteBytes(OutputBuffer.java:410
   

)
 

  at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:332)
  at
org.apache.coyote.tomcat4.OutputBuffer.writeBytes(OutputBuffer.java:438)
  at
org.apache.coyote.tomcat4.OutputBuffer.write(OutputBuffer.java:425)
  at
org.apache.coyote.tomcat4.CoyoteOutputStream.write(CoyoteOutputStream.java:
   

1
 

08)
  at GetPDFDoc.outputFile(GetPDFDoc.java:128)
  at GetPDFDoc.processRequest(GetPDFDoc.java:86)
  at GetPDFDoc.doGet(GetPDFDoc.java:147)
Is there anything wrong with what I am doing?
response.setContentType("application/pdf");
response.setDateHeader("Expires", 0);
// open pdf outside of browser
response.addHeader("Content-disposition", "attachment; filename=" 
+ ntspNo + ".pdf");
response.setContentLength((int)f.length());
java.io.OutputStream out = response.getOutputStream(); // f is 
the pdf on the file system and it does exist
java.io.FileInputStream in = new java.io.FileInputStream(f);
int size = 0;
byte[] buffer = new byte[8192];
while( (size = in.read(buffer, 0, buffer.length)) != -1)
{
  out.write(buffer, 0, size);
}
in.close();
out.close();

Thanks



   



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



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


RE: Streaming pdf document fails

2004-05-11 Thread Summers, Bert W.
This is what tcptrace tells me is being sent back to the browser

HTTP/1.1 200 OK
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-disposition: attachment; filename=N77-NTSP-E-70-0203.pdf
Content-Type: application/pdf
Content-Length: 443928
Date: Tue, 11 May 2004 19:29:37 GMT
Server: Apache-Coyote/1.1

If I remove the Content-disposition then the PDF opens in the browser ok,
but that is not what I want.
Secondly Mozilla still asks for the file twice and gets it, but only
displays one of them.


-Original Message-
From: Christoph Meier [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 11, 2004 12:28 PM
To: Tomcat Users List
Subject: Re: Streaming pdf document fails


As far as i remeber, IE wants to know the content-length to show a PDF. =>
put the appopriate content-length into your Response-Header, ensure 
to have set the right content-type and i would expect that the 
PDF-stream should work then for IE, too.

_christoph

>I have a problem that just came up.  I have PDF documents located out 
>side of my webapps directory. When the user wants one they go to my 
>servlet which streams it back. This use to work just fine, but now is 
>broke.
> 
>In IE I get Error opening document on TC4.1.30 and unable to open this 
>Internet site in TC 5.0.19
> 
>Mozilla 1.6 does not have a problem opening the file.
> 
>What is odd is that Mozilla seems to request the servlet twice from one 
>click, the first tends to throw this
>ClientAbortException:  java.net.SocketException: Software caused 
>connection
>abort: socket write error
>at
>org.apache.coyote.tomcat4.OutputBuffer.realWriteBytes(OutputBuffer.java:410
)
>at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:332)
>at
>org.apache.coyote.tomcat4.OutputBuffer.writeBytes(OutputBuffer.java:438)
>at
>org.apache.coyote.tomcat4.OutputBuffer.write(OutputBuffer.java:425)
>at
>org.apache.coyote.tomcat4.CoyoteOutputStream.write(CoyoteOutputStream.java:
1
>08)
>at GetPDFDoc.outputFile(GetPDFDoc.java:128)
>at GetPDFDoc.processRequest(GetPDFDoc.java:86)
>at GetPDFDoc.doGet(GetPDFDoc.java:147)
> 
>Is there anything wrong with what I am doing?
>  response.setContentType("application/pdf");
>  response.setDateHeader("Expires", 0);
>// open pdf outside of browser
>  response.addHeader("Content-disposition", "attachment; filename=" 
>+ ntspNo + ".pdf");
>  response.setContentLength((int)f.length());
>  java.io.OutputStream out = response.getOutputStream(); // f is 
>the pdf on the file system and it does exist
>  java.io.FileInputStream in = new java.io.FileInputStream(f);
>  int size = 0;
>  byte[] buffer = new byte[8192];
>  while( (size = in.read(buffer, 0, buffer.length)) != -1)
>  {
>out.write(buffer, 0, size);
>  }
>  in.close();
>  out.close();
> 
>Thanks
>
>  
>



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

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



Re: Streaming pdf document fails

2004-05-11 Thread Christoph Meier
As far as i remeber, IE wants to know the content-length to show a PDF.
=> put the appopriate content-length into your Response-Header, ensure 
to have set the right content-type and i would expect that the 
PDF-stream should work then for IE, too.

_christoph

I have a problem that just came up.  I have PDF documents located out side
of my webapps directory.
When the user wants one they go to my servlet which streams it back.
This use to work just fine, but now is broke.
In IE I get Error opening document on TC4.1.30 and unable to open this
Internet site in TC 5.0.19
Mozilla 1.6 does not have a problem opening the file.

What is odd is that Mozilla seems to request the servlet twice from one
click, the first tends to throw this
ClientAbortException:  java.net.SocketException: Software caused connection
abort: socket write error
   at
org.apache.coyote.tomcat4.OutputBuffer.realWriteBytes(OutputBuffer.java:410)
   at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:332)
   at
org.apache.coyote.tomcat4.OutputBuffer.writeBytes(OutputBuffer.java:438)
   at
org.apache.coyote.tomcat4.OutputBuffer.write(OutputBuffer.java:425)
   at
org.apache.coyote.tomcat4.CoyoteOutputStream.write(CoyoteOutputStream.java:1
08)
   at GetPDFDoc.outputFile(GetPDFDoc.java:128)
   at GetPDFDoc.processRequest(GetPDFDoc.java:86)
   at GetPDFDoc.doGet(GetPDFDoc.java:147)
Is there anything wrong with what I am doing?
 response.setContentType("application/pdf");
 response.setDateHeader("Expires", 0);
// open pdf outside of browser
 response.addHeader("Content-disposition", "attachment; filename=" +
ntspNo + ".pdf");
 response.setContentLength((int)f.length());
 java.io.OutputStream out = response.getOutputStream();
// f is the pdf on the file system and it does exist
 java.io.FileInputStream in = new java.io.FileInputStream(f);
 int size = 0;
 byte[] buffer = new byte[8192];
 while( (size = in.read(buffer, 0, buffer.length)) != -1)
 {
   out.write(buffer, 0, size);
 }
 in.close();
 out.close();
Thanks

 



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


RE: forwarding across contexts?

2004-05-11 Thread Justin Ruthenbeck
Fred,

Thanks for the additional info about your app ... it makes it much
easier to talk about these things.  :)  There are many (valid) ways
to proceed, many of which vary in the amount of "standards" they
adhere to (how much you want to align yourself with Tomcat).
I'll just give you my thoughts.
At 09:02 AM 5/11/2004, you wrote:
Let me describe a bit about our application, just in case you
(or anyone else) have some specific advice.
My client is a publisher, and the bulk of the site will be many
thousands of published articles and associated content such
as figure, tables, etc.
The HTML content, however, will be served by tomcat, since
it has some dynamic components.
The biggest question, then, has to do with your security requirements.
Specifically, does this content need to be protected or can it just
sit out there for anyone to grab?
If it need not be protected, this is, IMHO, a textbook example of when
to use Apache.  You've got a large collection of static data and a
relatively small web application associated with it.  You've probably
got different groups working on the different parts (the publisher's
content and the HTML pages), so it makes sense to separate it out and
serve the static content by generating links to your static web server's
content from your dynamic HTML.  Additionally, you could then put the
two pieces on separate machines (one or more with Apache, one or more
with Tomcat) to keep them separated even more cleanly.
If the content needs to be protected, I would create a separate
directory and put the content there.  Symlink this to the base of your
Tomcat webApp and let Tomcat serve it normally, employing whatever
security scheme you're using.  You won't be able to deploy the entire
thing as a single WAR, but it doesn't sound like you really care to
do this anyways.
This is why it's not practical to bundle everything into a war file.
Instead, I need tomcat to point to the file system where many
users will be building the site.
On the other hand, the war file can easily contain the java infrastructure
(struts, velocity, configuration information, etc.). I'd like to be able
to keep the small war file, hot deploy, etc., but have the raw content
(static and otherwise) live elsewhere.
Given that, would you solve it with multiple contexts? Or do you
have another suggestion?
Alternately, you could extend the DefaultServlet (if you don't mind tying
yourself to Tomcat and your version) with your own custom static content
servlet that gets data from an arbitrary directory.  If you can't be
tied to Tomcat, use the source as a base to write your own default
servlet.  This solution is more on the "slick" side of things, so it
wouldn't be preferable ... better to stay within the mainstream
boundaries.
If you can, look into symlinking or Apache.  Consider the extend/impl
DefaultServlet idea.  If you're still not satisfied, having two
separate contexts can be made to work.  Perhaps others have additional
ideas.

Fred
Good luck,
justin

At 10:08 AM 5/11/2004, you wrote:

Hi,

>Is there a way, within a single context, to separate out
>the static content to some other file system location.
Of course, there are many ways, none of them advised.  You want to keep
your webapp as a whole, that's the whole point of a WAR file.  You can
symlink (at the filesystem level) or use normal HTTP linking to access
your static content.  But you can't symlink in a WAR, so...
>I believe that Yoav's suggestion is that I set up the empty
>path ("") context for this purpose. However, this is where
>I started, and Justin argued against this "cross-context"
>approach.
And I agree with Justin, just to be clear.  I wasn't advocating anything
different from what he said, just showing you that it can technically be
done.  If crossContext forwards are the worst design choices on this
list, we'll be in great shape.
Yoav Shapira



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for the 
individual(s) to whom it is addressed, and may not be saved, copied, 
printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your 
computer system and notify the sender.  Thank you.

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


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


__
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential. See:
http://www.nextengine.com/confidentiality.php
__
-
To unsub

Streaming pdf document fails

2004-05-11 Thread Summers, Bert W.
I have a problem that just came up.  I have PDF documents located out side
of my webapps directory.
When the user wants one they go to my servlet which streams it back.
This use to work just fine, but now is broke.
 
In IE I get Error opening document on TC4.1.30 and unable to open this
Internet site in TC 5.0.19
 
Mozilla 1.6 does not have a problem opening the file.
 
What is odd is that Mozilla seems to request the servlet twice from one
click, the first tends to throw this
ClientAbortException:  java.net.SocketException: Software caused connection
abort: socket write error
at
org.apache.coyote.tomcat4.OutputBuffer.realWriteBytes(OutputBuffer.java:410)
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:332)
at
org.apache.coyote.tomcat4.OutputBuffer.writeBytes(OutputBuffer.java:438)
at
org.apache.coyote.tomcat4.OutputBuffer.write(OutputBuffer.java:425)
at
org.apache.coyote.tomcat4.CoyoteOutputStream.write(CoyoteOutputStream.java:1
08)
at GetPDFDoc.outputFile(GetPDFDoc.java:128)
at GetPDFDoc.processRequest(GetPDFDoc.java:86)
at GetPDFDoc.doGet(GetPDFDoc.java:147)
 
Is there anything wrong with what I am doing?
  response.setContentType("application/pdf");
  response.setDateHeader("Expires", 0);
// open pdf outside of browser
  response.addHeader("Content-disposition", "attachment; filename=" +
ntspNo + ".pdf");
  response.setContentLength((int)f.length());
  java.io.OutputStream out = response.getOutputStream();
// f is the pdf on the file system and it does exist
  java.io.FileInputStream in = new java.io.FileInputStream(f);
  int size = 0;
  byte[] buffer = new byte[8192];
  while( (size = in.read(buffer, 0, buffer.length)) != -1)
  {
out.write(buffer, 0, size);
  }
  in.close();
  out.close();
 
Thanks


Re: parse error in application web.xml under 5.0.24 but not 5.0.19

2004-05-11 Thread Jim Hopp
The problem was my webapps needed to have the 'privileged' attribute set 
to true on the Context tag.

Reading the doc on the privileged attribute on the Context tag, it says 
"Set to true to allow this context to use container servlets, like the 
manager servlet."  I've been unable to find any additional information 
on container servlets in the Servlet Spec, and searching the source code 
didn't lead to any insight.

Which leads me to three questions:
1) What is a container servlet?
2) How does Tomcat determine that my webapp is a container servlet?
3) Why didn't I need to set the privileged attribute in 5.0.19?
Thanks,

Jim

Jim Hopp wrote:

I've just upgraded from 5.0.19 to 5.0.24.  My webapps worked fine under 
5.0.19, but Tomcat is throwing the exception below under 5.0.24 when it 
tries to start the webapp.  (The apps also start properly under 5.0.20, 
but fail under 5.0.21 with the same exception so it appears that a 
change made in 5.0.21 is causing the problem.)

My server.xml and web.xml follow the exception trace.

May 10, 2004 3:33:30 PM org.apache.catalina.core.StandardContext start
FINE: Starting tomcat.localhost./property.Context
May 10, 2004 3:33:30 PM org.apache.catalina.core.StandardContext 
createObjectNam
e
FINE: Registering 
j2eeType=WebModule,name=//localhost/property,J2EEApplication=n
one,J2EEServer=none for null
May 10, 2004 3:33:30 PM org.apache.catalina.core.StandardContext start
FINE: Configuring default Resources
May 10, 2004 3:33:30 PM org.apache.catalina.core.StandardContext start
FINE: No realm for this host 
directory:type=Host,host=localhost,path=/property
May 10, 2004 3:33:30 PM org.apache.catalina.core.StandardContext start
FINE: Configuring non-privileged default Loader
May 10, 2004 3:33:30 PM org.apache.catalina.core.StandardContext start
FINE: Processing standard container startup
May 10, 2004 3:33:31 PM org.apache.catalina.core.StandardContext 
setPublicId
FINE: Setting deployment descriptor public ID to '-//Sun Microsystems, 
Inc.//DTD
 Web Application 2.3//EN'
May 10, 2004 3:33:31 PM org.apache.commons.digester.Digester endElement
SEVERE: End event threw exception
java.lang.ClassNotFoundException: org.apache.catalina.Container
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1340)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1189)
at 
org.apache.commons.digester.SetNextRule.end(SetNextRule.java:243)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at 
org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at 
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source
)
at 
org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown
Source)
at 
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S
ource)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown 
Source)

at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(
Unknown Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown 
Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at 
org.apache.catalina.startup.ContextConfig.applicationConfig(ContextCo
nfig.java:263)
at 
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:62
4)
at 
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfi
g.java:216)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
268)
at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)

at 
org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)

at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478
)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:4
76)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:229
8)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(

Re: Apache2/Tomcat5/mod_jk2 problems

2004-05-11 Thread Adrian Barnett
On Wed, 12 May 2004 00:05:09 +0800, Chong Yu Meng <[EMAIL PROTECTED]> wrote:

Hi,

Another way to verify if the connectors are really giving you the problems (as opposed to the application) is to setup Apache as a reverse proxy and proxy all requests to Tomcat. There is documentation on this on the Tomcat site. My suspicion is that it could be your application.
Well, that's what I suspected as well, but then discovered that the same thing 
happens if I repeatedly load the jsp-examples pages that came with tomcat. Memory 
creeps up, tomcat falls over.
Cheers,
Adrian
--

"OK, Sam", sighed Frodo, "I've changed my mind. You can kill him now."



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


Re: having webapp reachable at two URLs

2004-05-11 Thread Tim Funk
No. Jk can't rewrite the request. But mod_rewrite can.

In fact - based on the problem below - using mod_rewrite would probably be 
the "easiest".

-Tim

Mike Curwen wrote:

If you use Apache in front with jk, could you supply two different
jkmount directives ?  (I'm actually asking a question, since I don't
know).  ;)
 



-Original Message-
From: Mats Henrikson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 11, 2004 11:00 AM
To: Tomcat User
Subject: having webapp reachable at two URLs

Hi,

I want to make a certain Tomcat webapp available at two 
different URLs, but still be coming from the same source. I 
seem to remember having seen documentation on how to do this, 
but I can't find it now. I am using Tomcat 4.1.30.

Say I have the following being served by a Tomcat instance:

http://my.server.com/special-webapp/

but I also want the special-webapp to be reachable from:

http://my.server.com/different-url-webapp/

but I don't want to have to deploy the files at two different places in
the $CATALINA_HOME/webapps/ directory. 

Could anybody point me in the right direction please?


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


Re: Do Filters and the servlets part of the same thread?

2004-05-11 Thread Tim Funk
Yes. (Kind of). In the life of a request - you are always one one thread.

BUT -- Many threads many be using the doFilter() method at the same time.

-Tim

tom ly wrote:

Are the servlets and the Filters that filters that particular servlet part of the same thread?
  
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Memory Options

2004-05-11 Thread Paul Mitchell
Posting this again. Anyone run into this problem ever
?

Thanks.
--- Paul Mitchell <[EMAIL PROTECTED]>
wrote:
> Hello All,
>   I am trying to configure Tomcat 4.1.27 on
> Windows XP and for some reason when I set the
> CATALINA_OPTS option in my environment variables,
> the
> "catalina jpda start" command simple refuses to
> start
> Tomcat. When I remove these options, the command
> works
> just fine.
> The same configuration used to work fine on Windows
> 2000. Has anyone else run into this same problem ?
> 
> Thanks,
> Paul.
> 
> 
>   
>   
> __
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs  
> http://hotjobs.sweepstakes.yahoo.com/careermakeover 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 





__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

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



RE: Do Filters and the servlets part of the same thread?

2004-05-11 Thread Shapira, Yoav

Hi,
A request (including its entire pipeline: valves, filters, servlets...)
is processed by one thread in its entirety.

Be careful relying on ThreadLocal-type designs.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: tom ly [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, May 11, 2004 1:49 PM
>To: [EMAIL PROTECTED]
>Subject: Do Filters and the servlets part of the same thread?
>
>Are the servlets and the Filters that filters that particular servlet
part
>of the same thread?
>
>
>-
>Do you Yahoo!?
>Win a $20,000 Career Makeover at Yahoo! HotJobs



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: having webapp reachable at two URLs

2004-05-11 Thread Mike Curwen
If you use Apache in front with jk, could you supply two different
jkmount directives ?  (I'm actually asking a question, since I don't
know).  ;)
 


> -Original Message-
> From: Mats Henrikson [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, May 11, 2004 11:00 AM
> To: Tomcat User
> Subject: having webapp reachable at two URLs
> 
> 
> Hi,
> 
> I want to make a certain Tomcat webapp available at two 
> different URLs, but still be coming from the same source. I 
> seem to remember having seen documentation on how to do this, 
> but I can't find it now. I am using Tomcat 4.1.30.
> 
> Say I have the following being served by a Tomcat instance:
> 
http://my.server.com/special-webapp/

but I also want the special-webapp to be reachable from:

http://my.server.com/different-url-webapp/

but I don't want to have to deploy the files at two different places in
the $CATALINA_HOME/webapps/ directory. 

Could anybody point me in the right direction please?

Mats



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


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



Windows XP and Apache

2004-05-11 Thread Martinez de Pinillos, Joaquin
To All,

 

I am using Apache 1.3.27 and tomcat 3.3.  I am running this on
Windows XP.  I am trying to get Apache and Tomcat to work together
unfortunately I keep running into an issue.  Here are the symptoms.
When I compile the examples JSP pages using Tomcat (port 8080)
everything compiles fine.  However when I try and compile them using
Apache with Tomcat I get a fatal OS exception from Apache.  This does
not occur for static pages.  By the way I am aware of the Windows XP bug
Q317949

documented on the Apache and Windows site.  I have a Windows XP SP 1
installed and the file mentioned in the documentation shows to be of a
later date code so I assume this is okay.  Unfortunately the application
I am working with requires Apache 1.3.x it does not support Apache 2.x.
The Apache error file is as follows. 

 

Mon May 10 01:38:29 2004] [info] master_main: Child processed exited
prematurely. Restarting the child process.

[Mon May 10 01:38:29 2004] [info] Parent: Created child process 2888

[Mon May 10 01:38:29 2004] [info] Parent: Duplicating socket 192 and
sending it to child process 2888

[Mon May 10 01:38:29 2004] [info] BytesRead = 372 WSAProtocolInfo =
2006620

[Mon May 10 01:38:33 2004] [info] master_main: Child processed exited
prematurely. Restarting the child process.

[Mon May 10 01:38:33 2004] [info] Parent: Created child process 524

[Mon May 10 01:38:33 2004] [info] Parent: Duplicating socket 192 and
sending it to child process 524

[Mon May 10 01:38:33 2004] [info] BytesRead = 372 WSAProtocolInfo =
2006620

 

Any help will be greatly appreciated.  

 

Joaquin J. Martinez de Pinillos

Anteon Corporation

(o) 703 253 3425

(f)  703 253 3690

(m) 703 980 8827

 



Re: Bad Cookie Name when NOT using cookies?

2004-05-11 Thread Evgeny Gesin
> Do you have that many applications that might be
> setting cookies?
Those apps are clones of myapplName, and no one set
cookie. May be I need to look at Apache or Tomcat
configuration files, but what directives to search?
Can Apache "redirect" generate such error Path /Value:
/myapplName ?

> Does myapplName ring a bell?

No, myapplName works very well, no errors a long time.

Evgeny
Javadesk


Do you have that many applications that might be
setting cookies?

 From the log posted, the cookie that tomcat seemed to
be complaining 
about was:

Path /Value: /myapplName

It doesn't say anything about what the name of the
cookie is... unless 
that is what Value is showing.
Does myapplName ring a bell?

Evgeny Gesin wrote:

>Of course, I not disabled cookies in Tomcat and my
>program invokes session.getAttribute() and
>session.setAttribute(), but the program not
>creates/reads cookies.
>
>So, I will think about (2), if another appl on my
>server might be setting cookies in the root path...
>By the way how I can check that?
>--
>Evgeny
>Javadesk
>
>Some questions that might help:
>
>1) Do you have cookies turned off completely on all
of
>your contexts? 
>That means that you should be seeing ;jsessionid= in
>any of your URLs 
>unless they are just hard coded html urls, right? In
>other words, if 
>you 
>use response.encodeURL() for links, you should have
>the jsessionid 
>added 
>to the URL.
>Are you doing nothing with sessions?
>session.getAttribute(), or 
>setAttribute() ?
>You couldn't truly be doing anything with them if you
>really have 
>cookies turned off.
>If you do have no session cookie, then either you
have
>jsessionid in 
>all 
>of your request URLs, or else you are creating a new
>session on every 
>request... you could try
>System.out.println(session.getId()) to see if 
>you are getting a new session everytime or reusing an
>old one.
>
>2) Are there other apps at your domain that might be
>setting cookies in 
>the root path, and tomcat just happens to be trying
to
>load them?
>
>Daniel Gibby




__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

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



Do Filters and the servlets part of the same thread?

2004-05-11 Thread tom ly
Are the servlets and the Filters that filters that particular servlet part of the same 
thread?


-
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs 

RE: Requested Resource Not Available

2004-05-11 Thread Shapira, Yoav

Hi,

>Having read that similar new users had this kind of problem,
>I've stared at the mappings for about 16 hours now, and I

Ouch, 16 hours ;)

>   
>   HelloServlet
>   /my-hello/hello
>   

With this mapping, you servlet would be accessible at
http://yourhost:yourport/yourWebappName/my-hello/hello.  What URL have
you been trying for accessing the servlet?

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Requested Resource Not Available

2004-05-11 Thread Jonathan Quinn
Hi, 

I'm a new tomcat user, but not generally a newbie, so I'm 
surprised that I'm so stuck.  I've been trying to get the 
simple hello world servlet running to verify that I've setup 
everything.  (The apps that come pre-setup with the 
distribution are working fine.  I'm trying to get one of "my 
own" working copied from the sample/appdev code.  And the jsp 
version works fine.) 

First clue is that 'ant install' reports a bad pathname 
error.  I can't figure out where that is coming from.  So I 
tried installing the app manually by copying the tree to the 
webapps directory.  Tomcat reports a 404 error in that 
case.   
Having read that similar new users had this kind of problem, 
I've stared at the mappings for about 16 hours now, and I 
must be overlooking something silly.  I have also taken great 
care to make sure that my package declaration is reflected in 
the hierarchy. 

I'm running the new 5.0.24 version on Red Hat Linux 
Enterprise Workstation. 

Below are my web.xml and build.xml files.  Sorry for sending 
them in whole. 

Thanks for your help! 

Jonathan 

http://java.sun.com/dtd/web-app_2_3.dtd "> 

 

   My Hello, World Application 

This is My version of a simple web application with a 
source code organization 
based on the recommendations of the Application 
Developer's Guide. 



   HelloServlet 
   mypackage.Hello 



   HelloServlet 
   /my-hello/hello 


 

 


 

 



 


 

  
  


 


 

  
  
  
  
  
  
  
 http://localhost:8080/manager "/> 
  
  


 


 

  
  
  
  


 

 

  
  
  



 


 

 
 


 

 

  



 




  


  



  


  



 

 

  



 

 

  


  



 

 

  









  


  



 


 

  




  







  



 

 

  



  


 

 

  



  


  



 

 

  



  


 

 

  









  





 




  


 

 

  



  


 

 

  



  


 

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



RE: Passing init parameters to event listener

2004-05-11 Thread Shapira, Yoav

Hola,
You got it...

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Dennis Dai [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, May 11, 2004 1:20 PM
>To: Tomcat Users List
>Subject: Re: Passing init parameters to event listener
>
>Thanks a lot Yoav.
>
>I actually meant ServletContext init parameters (found that out after
>pressing
>the send button) ... :p
>
>So you mean I should also implement ServletContextListener in my
(session
>event)
>listener so I can get the ServletContext (thus the init parameters)
when
>context
>initialized, right? Hmm, actually I think that's pretty good way to get
>init
>parameters for other event listener(s) ...
>
>Thanks again,
>
>Dennis
>
>On 5/7/2004 5:55 AM, Shapira, Yoav wrote:
>
>> Hi,
>> Use ServletContext init parameters (as opposed to attributes).  Those
>> are bound for your contextInitialized event and anything after it.
>>
>> Yoav Shapira
>> Millennium Research Informatics
>>
>>
>>>-Original Message-
>>>From: Dennis Dai [mailto:[EMAIL PROTECTED]
>>>Sent: Friday, May 07, 2004 4:13 AM
>>>To: Tomcat Users List
>>>Subject: Passing init parameters to event listener
>>>
>>>Hi all,
>>>
>>>I'd like to pass init parameters to event listener (in my case, it's
>>>session
>>>listener) instead of hard coding those parameters. But event
listeners
>> do
>>>not
>>>support init parameters like filters do.
>>>
>>>I know that I can get SetvletContext from events (thus getting the
>>>ServletContext attributes for the context), but that'll be at time
when
>>>event
>>>happens, not listener init time.
>>>
>>>Any better way?
>>>
>>>Thanks,
>>>
>>>Dennis
>>>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: Passing init parameters to event listener

2004-05-11 Thread Dennis Dai
Thanks a lot Yoav.

I actually meant ServletContext init parameters (found that out after pressing 
the send button) ... :p

So you mean I should also implement ServletContextListener in my (session event) 
listener so I can get the ServletContext (thus the init parameters) when context 
initialized, right? Hmm, actually I think that's pretty good way to get init 
parameters for other event listener(s) ...

Thanks again,

Dennis

On 5/7/2004 5:55 AM, Shapira, Yoav wrote:

Hi,
Use ServletContext init parameters (as opposed to attributes).  Those
are bound for your contextInitialized event and anything after it.
Yoav Shapira
Millennium Research Informatics

-Original Message-
From: Dennis Dai [mailto:[EMAIL PROTECTED]
Sent: Friday, May 07, 2004 4:13 AM
To: Tomcat Users List
Subject: Passing init parameters to event listener
Hi all,

I'd like to pass init parameters to event listener (in my case, it's
session
listener) instead of hard coding those parameters. But event listeners
do
not
support init parameters like filters do.
I know that I can get SetvletContext from events (thus getting the
ServletContext attributes for the context), but that'll be at time when
event
happens, not listener init time.
Any better way?

Thanks,

Dennis



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


RE: having webapp reachable at two URLs

2004-05-11 Thread Shapira, Yoav

Howdy,

>> You can have a simple redirect filter mapped to /* in one context
that
>> just redirects to the other.
>
>This sounds like a good way to do it, but I can't seem to find any docs
>on how to do redirects from inside a context definition. Am I missing
>something obvious here?

Yeah: my solution isn't just configuration.  It involves code and
deploying a small but real web application on one context (just the
filter) and your other (real) webapp on the other context.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Difference between org.apache.axis.client.Stub.setTimeout() vs. Call.setTimeout()?

2004-05-11 Thread tom ly


tom ly <[EMAIL PROTECTED]> wrote:What's the difference between 
org.apache.axis.client.Stub.setTimeout() vs. org.apache.axis.client.Call.setTimeout()?


-
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs 


-
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs 

Re: Help with Simple JDBC Connection (sry, kinda long)

2004-05-11 Thread PTS
If you did not create a context for the app, it is using the default context. In that 
case you need to add a link statement to the default context in the server.xml  In 
order for any application to be able to see the globalresource it needs a link to tell 
it where it is.



Doug

-Original Message-
From: Keg <[EMAIL PROTECTED]>
Sent: May 11, 2004 10:30 AM
To: Tomcat Users List <[EMAIL PROTECTED]>
Subject: Re: Help with Simple JDBC Connection (sry, kinda long)



Parsons Technical Services wrote:
> Keg,
> 
> Don't see anything at this point.
> 
> Post the context section for this app.
> 
> Doug
> - Original Message - 
> From: "Keg" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Saturday, May 08, 2004 9:47 PM
> Subject: Re: Help with Simple JDBC Connection (sry, kinda long)

What do you mean context section? I posted server.xml, 
webapps/dev1/WEB-INF/web.xml and then java and jsp files. The app is 
listed as being deployed within the Admin application.

Thx,
CC


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



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



Difference between org.apache.axis.client.Stub.setTimeout() vs. org.apache.axis.client.Call.setTimeout()?

2004-05-11 Thread tom ly
What's the difference between org.apache.axis.client.Stub.setTimeout() vs. 
org.apache.axis.client.Call.setTimeout()?


-
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs 

RE: having webapp reachable at two URLs

2004-05-11 Thread Mats Henrikson
Yoav,

> You can have a simple redirect filter mapped to /* in one context that
> just redirects to the other.

This sounds like a good way to do it, but I can't seem to find any docs
on how to do redirects from inside a context definition. Am I missing
something obvious here?

Mats


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



RE: having webapp reachable at two URLs

2004-05-11 Thread Shapira, Yoav

Hi,
You can have a simple redirect filter mapped to /* in one context that
just redirects to the other.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Mats Henrikson [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, May 11, 2004 12:16 PM
>To: Tomcat Users List
>Subject: Re: having webapp reachable at two URLs
>
>Right, I managed to find some more info on this pointing me in the
>direction of setting up two different contexts in server.xml, with the
>same docBase but different path. However, as doing this would also
>double the database connections etc, is there a way of doing this with
>just a single context at two URLs?
>
>Mats
>
>On Tue, 2004-05-11 at 17:00, Mats Henrikson wrote:
>> Hi,
>>
>> I want to make a certain Tomcat webapp available at two different
URLs,
>> but still be coming from the same source. I seem to remember having
seen
>> documentation on how to do this, but I can't find it now. I am using
>> Tomcat 4.1.30.
>>
>> Say I have the following being served by a Tomcat instance:
>>
>> http://my.server.com/special-webapp/
>>
>> but I also want the special-webapp to be reachable from:
>>
>> http://my.server.com/different-url-webapp/
>>
>> but I don't want to have to deploy the files at two different places
in
>> the $CATALINA_HOME/webapps/ directory.
>>
>> Could anybody point me in the right direction please?
>>
>> Mats
>>
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: having webapp reachable at two URLs

2004-05-11 Thread Mats Henrikson
Right, I managed to find some more info on this pointing me in the
direction of setting up two different contexts in server.xml, with the
same docBase but different path. However, as doing this would also
double the database connections etc, is there a way of doing this with
just a single context at two URLs?

Mats

On Tue, 2004-05-11 at 17:00, Mats Henrikson wrote:
> Hi,
> 
> I want to make a certain Tomcat webapp available at two different URLs,
> but still be coming from the same source. I seem to remember having seen
> documentation on how to do this, but I can't find it now. I am using
> Tomcat 4.1.30.
> 
> Say I have the following being served by a Tomcat instance:
> 
> http://my.server.com/special-webapp/
> 
> but I also want the special-webapp to be reachable from:
> 
> http://my.server.com/different-url-webapp/
> 
> but I don't want to have to deploy the files at two different places in
> the $CATALINA_HOME/webapps/ directory. 
> 
> Could anybody point me in the right direction please?
> 
> Mats
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


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



How can you limit the max life-time for a servlet using filters?

2004-05-11 Thread tom ly
Once in a while we're getting out of thread errors with Tomcat.  We have a requirement 
timeout of 5 seconds.  Is there a way to use Filters (or whichever any other method) 
so that we can limit the time that a thread/servlet stays alive.


-
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs 

RE: forwarding across contexts?

2004-05-11 Thread Fred Toth
Yoav,

Let me describe a bit about our application, just in case you
(or anyone else) have some specific advice.
My client is a publisher, and the bulk of the site will be many
thousands of published articles and associated content such
as figure, tables, etc.
The HTML content, however, will be served by tomcat, since
it has some dynamic components.
This is why it's not practical to bundle everything into a war file.
Instead, I need tomcat to point to the file system where many
users will be building the site.
On the other hand, the war file can easily contain the java infrastructure
(struts, velocity, configuration information, etc.). I'd like to be able
to keep the small war file, hot deploy, etc., but have the raw content
(static and otherwise) live elsewhere.
Given that, would you solve it with multiple contexts? Or do you
have another suggestion?
Thanks again,

Fred

At 10:08 AM 5/11/2004, you wrote:

Hi,

>Is there a way, within a single context, to separate out
>the static content to some other file system location.
Of course, there are many ways, none of them advised.  You want to keep
your webapp as a whole, that's the whole point of a WAR file.  You can
symlink (at the filesystem level) or use normal HTTP linking to access
your static content.  But you can't symlink in a WAR, so...
>I believe that Yoav's suggestion is that I set up the empty
>path ("") context for this purpose. However, this is where
>I started, and Justin argued against this "cross-context"
>approach.
And I agree with Justin, just to be clear.  I wasn't advocating anything
different from what he said, just showing you that it can technically be
done.  If crossContext forwards are the worst design choices on this
list, we'll be in great shape.
Yoav Shapira



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for the 
individual(s) to whom it is addressed, and may not be saved, copied, 
printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your 
computer system and notify the sender.  Thank you.

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


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


having webapp reachable at two URLs

2004-05-11 Thread Mats Henrikson
Hi,

I want to make a certain Tomcat webapp available at two different URLs,
but still be coming from the same source. I seem to remember having seen
documentation on how to do this, but I can't find it now. I am using
Tomcat 4.1.30.

Say I have the following being served by a Tomcat instance:

http://my.server.com/special-webapp/

but I also want the special-webapp to be reachable from:

http://my.server.com/different-url-webapp/

but I don't want to have to deploy the files at two different places in
the $CATALINA_HOME/webapps/ directory. 

Could anybody point me in the right direction please?

Mats



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



Re: Apache2/Tomcat5/mod_jk2 problems

2004-05-11 Thread Chong Yu Meng
Hi,

Another way to verify if the connectors are really giving you the 
problems (as opposed to the application) is to setup Apache as a reverse 
proxy and proxy all requests to Tomcat. There is documentation on this 
on the Tomcat site. My suspicion is that it could be your application.



Daniel Gibby wrote:

I *really* wish I knew the answers to your questions. Connectors are 
the most frustrating part of using tomcat. But then again, I haven't 
tried session replication ;-)

I don't know if the problem that I'm having is the same as yours, but 
I have to kill and restart tomcat every other day or so. I've actually 
made a cron that restarts tomcat nightly now. Problem solved, right? 
;-) Now I'll never know if I ever fix it. :-(

See my other post to the similar thread that just started today by 
Beat De Martin:
Subject: apache, mod_jk, tomcat hungs

BTW, I'm using Unix sockets, because I thought I read somewhere that 
they are faster, but I wouldn't count on that being true, since JNI is 
still required for some reason on top of that... maybe they were 
supposed to be faster in theory since you wouldn't have to load JNI, 
but I don't think unix sockets will work without JNI. I would have 
switched to normal TCP Sockets by now, but I keep reading of people 
like you who are having the same problems I'm having.

Daniel Gibby

Adrian Barnett wrote:

Hi,
I'm having an annoying memory leak problem in tomcat5 on Redhat 9. 
The memory gradually creeps up until the JVM runs out of memory. 
(I've been using JMeter to send thousands of requests to tomcat)

Now, if I run the tests against tomcat by itself (via port 8080) it 
is fine and stable, the problem only occurs when I use port 80 to go 
via Apache.

After trying numerous different things, suspicion falls on mod_jk2. 
The docs on mod_jk2 are not very helpful. Some say that mod_jk2 is 
better than mod_jk and should be used in place of it, others say that 
mod_jk2 is not stable enough for production use yet and mod_jk should 
be used instead.

Also, we are using the JNI mode of communication for mod_jk2, rather 
than Unix sockets.

So, my questions are:
1) Which is safest - mod_jk or mod_jk2?


Neither? I'd really say neither would be safest.

2) Are there docs which describe when/why you should JNI or Unix 
sockets (or any other method), and what the advantages/disadvantages 
are?


Probably so, but I can never find them when I need them. And the 
"official" docs don't do the job very well.

3) Anybody got any other clues as to what could cause a leak like 
this? (I've searched many tomcat mail archives but found nothing of use)

Cheers,
Adrian Barnett


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


--
"Guns aren't lawful; nooses give; gas smells awful. So you might as well
live." 
		-- Dorothy Parker
++
| Pascal Chong   |
| email: [EMAIL PROTECTED]  |
||
| Please visit my site at : http://cymulacrum.net|
| If you're using my documentation, please read the Terms and|
| and Conditions at http://cymulacrum.net/terms.html |
++



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


Re: OutOfMemoryError after 5.0.24 update

2004-05-11 Thread Remy Maucherat
Stefan Proels wrote:
Sorry, I wasn't precise enough here. I'm not statically precompiling JSPs 
that way. Sometimes we do need the feature to update a JSPs while the 
application is running. I'm running a simple script which invokes every 
JSP with jsp_precompile=true instead and since this script already ran I 
wonder what "CompilerThread1" still has to do.

I've had several more crashes, all with an OutOfMemoryError in 
"CompilerThread1" without the Java process actually running out of heap. 
I finally went back to 5.0.19 for now. I still hope there is a 
possibility to fix this problem somehow, because 5.0.24 contains several 
bug fixes I was waiting for and thus I'd like to update.
You can disable the background reloading thread, I think.
Use reloading=false and development=false in web.xml.
--
x
Rémy Maucherat
Developer & Consultant
JBoss Group (Europe) SàRL
x
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Filter on url example - Filter out hack attempts

2004-05-11 Thread Nathan Maves
True every alias is subject to the occasional OT question.  I think 
for the most part people are not aware of other areas where information 
is available.

my $.02
On May 11, 2004, at 8:55 AM, Ralph Einfeldt wrote:
It's not always easy easy to find the right list for
a question. The opinions about what is right or wrong
vary with the members of the list. (In my opinion
your question is right in this list, although I can
understand that others have different opinions in this
case)
I have seen questions that where more of topic than yours.

http://forum.java.sun.com/ is not a bad idea as there
you may ask questions about java, jsp, servlets and other
things that are not drectly related with tomcat.
-Original Message-
From: lrnobs [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 11, 2004 4:17 PM
To: Tomcat Users List
Subject: Re: Filter on url example - Filter out hack attempts


I am a newbie to Java and Tomcat, and I did spend two days
with two Tomcat books I bought and Google trying to find
some instructions I could understand before posting a
question to this list. Please let me know if there is a
list more appropriate for new users.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


Re: Filter on url example - Filter out hack attempts

2004-05-11 Thread lrnobs
Yoav,

Ok, thank you.  I appreciate all your help.

Larry Nobs

- Original Message - 
From: "Shapira, Yoav" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, May 11, 2004 9:37 AM
Subject: RE: Filter on url example - Filter out hack attempts


>
> Hi,
>
> >I have been looking at the Access Logs daily.
> >
> >Anytime a legitimate user accesses my site everything is preceded with
> a
> >GET
> >or POST and a jsp or gif that I can recognize.  Initially a session
> starts
> >off with a plain GET / HTTP/1.1 or 1.0 so I should allow these, but all
> >other legitimate usage mentions my files.  It sounds like you are
> saying
> >that there are other requests that are not in the access log?
>
> No, that's not what I'm saying.  I'm saying you have a lot to learn with
> regards to the Servlet API.  The information returned from the
> getRequestURI method in HttpServletRequest is not the same information
> that is logged in the access logs.  (And for that matter, the latter is
> highly configurable whereas the former is strictly defined).  So that's
> why I said you should read and understand the HttpServletRequest
> interface and its methods.
>
> Yoav Shapira
>
>
>
> This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>



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



RE: Tomcat 4.0.6 and Japanese chars urgent

2004-05-11 Thread Yansheng Lin
Next time please do not put the word "urgent" in your msg title...

What happens if you add a page directive on top of the jsp page?

<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>

I am a bit weary of TC4.0's.  But give that a try with Shift-JIS encoding.
And let me know if it works.

-Yan
Sun Certified J2EE Web Component Developer
http://j2e-translate.sourceforge.net (need help)


-Original Message-
From: jyotsna [mailto:[EMAIL PROTECTED] 
Sent: May 11, 2004 06:08
To: [EMAIL PROTECTED]
Subject: Tomcat 4.0.6 and Japanese chars urgent


Hello all

I am facing the following problem with tomcat 4.0.6 when using Japanese
characters :

1. The default encoding of the browser is not being set to the Japanese
charset (shift-jis). I have to change the setting manually to see the chars.

2. My japanese chars though being displayed in the JSP are not the same as
that inseretd in DB.

Can any one please help me .

Best Regds
Jyotsna



-Original Message-
From: jyotsna [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 11, 2004 4:27 PM
To:
tomcat-user-sc.1084271614.dfpfnaekknkbnhfjfcno-jyotsna.bharadwaj=baypack
[EMAIL PROTECTED]
Subject: RE: confirm subscribe to [EMAIL PROTECTED]




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 11, 2004 4:04 PM
To: [EMAIL PROTECTED]
Subject: confirm subscribe to [EMAIL PROTECTED]


Hi! This is the ezmlm program. I'm managing the
[EMAIL PROTECTED] mailing list.

I'm working for my owner, who can be reached
at [EMAIL PROTECTED]

To confirm that you would like

   [EMAIL PROTECTED]

added to the tomcat-user mailing list, please send
an empty reply to this address:


tomcat-user-sc.1084271614.dfpfnaekknkbnhfjfcno-jyotsna.bharadwaj=baypackets.
[EMAIL PROTECTED]

Usually, this happens when you just hit the "reply" button.
If this does not work, simply copy the address and paste it into
the "To:" field of a new message.

or click here:

mailto:tomcat-user-sc.1084271614.dfpfnaekknkbnhfjfcno-jyotsna.bharadwaj=bayp
[EMAIL PROTECTED]

This confirmation serves two purposes. First, it verifies that I am able
to get mail through to you. Second, it protects you in case someone
forges a subscription request in your name.

Some mail programs are broken and cannot handle long addresses. If you
cannot reply to this request, instead send a message to
<[EMAIL PROTECTED]> and put the
entire address listed above into the "Subject:" line.


--- Administrative commands for the tomcat-user list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
   <[EMAIL PROTECTED]>

To remove your address from the list, send a message to:
   <[EMAIL PROTECTED]>

Send mail to the following for info and FAQ for this list:
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>

Similar addresses exist for the digest list:
   <[EMAIL PROTECTED]>
   <[EMAIL PROTECTED]>

To get messages 123 through 145 (a maximum of 100 per request), mail:
   <[EMAIL PROTECTED]>

To get an index with subject and author for messages 123-456 , mail:
   <[EMAIL PROTECTED]>

They are always returned as sets of 100, max 2000 per request,
so you'll actually get 100-499.

To receive all messages with the same subject as message 12345,
send an empty message to:
   <[EMAIL PROTECTED]>

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example "[EMAIL PROTECTED]", just add a hyphen and your
address (with '=' instead of '@') after the command word:
<[EMAIL PROTECTED]>

To stop subscription for this address, mail:
<[EMAIL PROTECTED]>

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

If despite following these instructions, you do not get the
desired results, please contact my owner at
[EMAIL PROTECTED] Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: <[EMAIL PROTECTED]>
Received: (qmail 36374 invoked by uid 98); 11 May 2004 10:33:34 -
Received: from [EMAIL PROTECTED] by hermes.apache.org by uid
82 with qmail-scanner-1.20
 (clamuko: 0.70.  Clear:RC:0(203.196.139.114):.
 Processed in 1.058051 secs); 11 May 2004 10:33:34 -
X-Qmail-Scanner-Mail-From: [EMAIL PROTECTED] via
hermes.apache.org
X-Qmail-Scanner: 1.20 (Clear:RC:0(203.196.139.114):. Processed in 1.058051
secs)
Received: from unknown (HELO mailhost.baypackets.com) (203.196.139.114)
  by hermes.apache.org with SMTP; 11 May 2004 10:33:33 -
Received: from jyotsana (jyotsana [192.168.9.156])
by mailhost.baypackets.com (8.9.3+Sun/8.9.3) with SMTP id PAA12318
for <[EMAIL PROTECTED]>; Tue, 11 May 2004
15:24:36
+0530 (IST)
Reply-To: <[EMAIL PROTECTED]>
From: "jyotsna" <[E

Re: apache, mod_jk, tomcat hungs

2004-05-11 Thread QM
On Tue, May 11, 2004 at 12:26:47PM +0200, Beat De Martin wrote:
: I'm using Tomcat 3.3.1, Apache 1.3.27 and mod_jk 1.2.4.
   ^
Do you have a test system on which you can try out Tomcat 4.1 or 5?
Even if you've found a legit Tomcat 3.x bug, IIRC that product is not
under active development...


: Every two days my Tomcat hungs and I have to restart it.
: Before Tomcat hungs I can see the following in mod_jk.log:
:  ERROR: can't receive the response message from tomcat, network problems or
: tomcat is down. err=-1
:   [jk_ajp_common.c (1137)]: Error reading reply from tomcat. Tomcat is down
: or network problems.
:   [jk_ajp_common.c (1290)]: ERROR: Receiving from tomcat failed, recoverable
: operation. err=0
:  [jk_ajp_common.c (1309)]: sending request to tomcat failed in send loop.
: err=0

Before you restart, what sort of forensics do you do? e.g.
- check whether the Tomcat process really is unavailable
- check network connectivity between Apache/Tomcat
- check limits on the Tomcat and Apache processes, such as number
  of open sockets

etc., etc., etc.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



Re: Bad Cookie Name when NOT using cookies?

2004-05-11 Thread Daniel Gibby
Do you have that many applications that might be setting cookies?

From the log posted, the cookie that tomcat seemed to be complaining 
about was:

Path /Value: /myapplName

It doesn't say anything about what the name of the cookie is... unless 
that is what Value is showing.
Does myapplName ring a bell?

Evgeny Gesin wrote:

Of course, I not disabled cookies in Tomcat and my
program invokes session.getAttribute() and
session.setAttribute(), but the program not
creates/reads cookies.
So, I will think about (2), if another appl on my
server might be setting cookies in the root path...
By the way how I can check that?
--
Evgeny
Javadesk
Some questions that might help:

1) Do you have cookies turned off completely on all of
your contexts? 
That means that you should be seeing ;jsessionid= in
any of your URLs 
unless they are just hard coded html urls, right? In
other words, if 
you 
use response.encodeURL() for links, you should have
the jsessionid 
added 
to the URL.
Are you doing nothing with sessions?
session.getAttribute(), or 
setAttribute() ?
You couldn't truly be doing anything with them if you
really have 
cookies turned off.
If you do have no session cookie, then either you have
jsessionid in 
all 
of your request URLs, or else you are creating a new
session on every 
request... you could try
System.out.println(session.getId()) to see if 
you are getting a new session everytime or reusing an
old one.

2) Are there other apps at your domain that might be
setting cookies in 
the root path, and tomcat just happens to be trying to
load them?

Daniel Gibby

	
		
__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

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



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


Re: apache, mod_jk, tomcat hungs

2004-05-11 Thread Daniel Gibby
Well, I just started restarting nightly last night. My lockups have been 
happening less often than that, so I'm guessing that this will prevent 
further lockups, unless my site usage goes up significantly.

Daniel

Beat De Martin wrote:

Thank for being in te same boat ...
Do you mean restarting nightly could help getting less of these locks ?
Kind regards
Beat De Martin
Switzerland
 

All I can say is you are not alone. Requests of our sort never seem to 
be answered, and we've been asking them for months.
Actually, by being answered I'm not saying that people don't post 
replies, I just mean that I don't know of anyone who has fixed this 
issue on their system.

It sure sounds like the same issue that I'm having with mod_jk2 2.0.2, 
apache 2.0.40, tomcat 4.1.30 or tomcat 4.1.27... but I can't be sure 
that it is the same issue. My bet is that most of the tomcat developers 
don't use connectors because they would rather keep things stable, and 
introducing apache into the mix just means one more point of failure.

Sorry I can't be of more help right now. I've tried using JMeter to 
reproduce my lockups, and that hasn't helped me yet.
Is there someone out there who would like to be paid to run a profiler 
on some of my applications? Please contact me off-list, and if you can 
solve my issue, I'll post the results to the list... I'm in contact with 
two or three people from this list that are having the same type of 
issues, and more requests for help come into the list weekly. We'd all 
be happy for the help.

Daniel Gibby

Beat De Martin wrote:

   

Hello folks
I'm using Tomcat 3.3.1, Apache 1.3.27 and mod_jk 1.2.4.
Every two days my Tomcat hungs and I have to restart it.
Before Tomcat hungs I can see the following in mod_jk.log:
ERROR: can't receive the response message from tomcat, network problems
 

or
   

tomcat is down. err=-1
[jk_ajp_common.c (1137)]: Error reading reply from tomcat. Tomcat is
 

down
   

or network problems.
[jk_ajp_common.c (1290)]: ERROR: Receiving from tomcat failed,
 

recoverable
   

operation. err=0
[jk_ajp_common.c (1309)]: sending request to tomcat failed in send loop.
err=0
Any ideas ?
Cheers
Beat


 

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

 



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


RE: Manager access problems

2004-05-11 Thread Yansheng Lin
Yeah, that makes sense.  You may want to take a look on how to set up a
virtual host in tomcat, it's part of the server configuration.  Just
remember that your ip-address is the same as a server
name(www.myCompany.com).

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/host.html

Hope this helps:)

-Yan

-Original Message-
From: Greg Adams [mailto:[EMAIL PROTECTED] 
Sent: May 10, 2004 19:50
To: Tomcat Users List
Subject: RE: Manager access problems


There's multiple connectors configured in tomcat/conf/server.xml. I have
to do JkMount for each webapp I want mapped into Apache in httpd.conf, but
I can still access the regular tomcat page on port 8080, just like when
tomcat is running as a standalone http server. I never shut off the
standalone http server running on port 8080, and I would like to be able
to access the manager application using port 8080 (directly through the
tomcat standalone http server, not using apache and mod_jk, so I don't
have manager and admin JkMounted into apache. Even before I installed and
configured mod_jk, I was running tomcat in standalone mode and I couldn't
access manager from a remote host, but I can access it from the localhost.
I anticipated finding one of those ... entries in
manager.xml that only allows you to access it from certain hosts, but
there was no such entry, so I'm stumped as to why it's possible to access
it using mod_jk, but I get that access denied error when using tomcat's
standalone http server.

Am I making any sense?

Greg


> No, it's not needed.
>
> Anyways, why do you think you would be able to access the webapp on
> http://:8080/manager/html/?
>
> 8080 is the port tomcat listens to.  It has nothing to do with what you
> define in httpd.conf.
>
> 80 is the port apache listens to.  It talks with tomcat through port 8009
> you defined in workers.properties.
>
> By default, 80 is the default port that apache uses.
>
> If virtual host and jk2 are working for you, you should be able to access
> your webapp without defining any port.
>
> There are a lot of good posts on port 8080 and 80.  You may want to do a
> search on the archieve.
>
> Cheers:)
>
> -Yan
>
> -Original Message-
> From: Greg Adams [mailto:[EMAIL PROTECTED]
> Sent: May 10, 2004 14:49
> To: Tomcat Users List
> Subject: RE: Manager access problems
>
>
> yes. Would it be helpful to post the entire httpd.conf? It's pretty
> long...
>
>> Your apache listens on port 80, no?
>>
>> -Yan
>>
>> -Original Message-
>> From: Greg Adams [mailto:[EMAIL PROTECTED]
>> Sent: May 10, 2004 10:23
>> To: [EMAIL PROTECTED]
>> Subject: Manager access problems
>>
>>
>> I've installed tomcat 5.0.19 on solaris 2.8. I've also installed
>> jk-1.2.5
>> to connect tomcat to apache 1.3.27. I'm having no problems with jk, my
>> problem is when trying to access the manager application. If I access it
>> on the localhost using port 8080, http://localhost:8080/manager/html/, I
>> have no problem, but when I try to access it on port 8080 from another
>> host, http://:8080/manager/html/, I get a "HTTP Status 403 -
>> Access to the requested resource has been denied" error message. If I
>> access it through the jk connector from another host,
>> http:///manager/html/, I get no error message...
>>
>> From looking at the FAQ's and the Manager how-to, I've looked at the
>> following:
>>
>> /conf/Catalina/localhost/manager.xml:
>>
>

>> 
>>
>>
>> > debug="0" privileged="true">
>>
>>   
>>   > type="org.apache.catalina.UserDatabase"/>
>>
>> 
>>
>

>>
>> relevant section from httpd.conf
>>
>

>> LoadModule jk_module  libexec/mod_jk.so
>> AddModule mod_jk.c
>> # Configure mod_jk
>> #
>> JkWorkersFile conf/workers.properties
>> JkLogFile logs/mod_jk.log
>> JkLogLevel info
>>
>> # Tomcat Virtual Host
>> #
>> 
>>   DocumentRoot /usr/local/apache/htdocs
>>   ServerName yoda.ddm.apm.bpm.eds.com
>>   JkMount /servlets-examples/* ajp13
>>   JkMount /manager/* ajp13
>> 
>>
>

>>
>> workers.properties
>>
>

>> worker.list= ajp13
>>
>> worker.ajp13.host=yoda.ddm.apm.bpm.eds.com
>> worker.ajp13.port=8009
>> worker.ajp13.type=ajp13
>>
>

>>
>> server.xml - I'm using the default server.xml bundled with tomcat 5.0.19
>>
>> Thanks for any ideas...
>>
>> Greg
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL 

Re: apache, mod_jk, tomcat hungs

2004-05-11 Thread Beat De Martin
Thank for being in te same boat ...
Do you mean restarting nightly could help getting less of these locks ?
Kind regards
Beat De Martin
Switzerland

> All I can say is you are not alone. Requests of our sort never seem to 
> be answered, and we've been asking them for months.
> Actually, by being answered I'm not saying that people don't post 
> replies, I just mean that I don't know of anyone who has fixed this 
> issue on their system.
> 
> It sure sounds like the same issue that I'm having with mod_jk2 2.0.2, 
> apache 2.0.40, tomcat 4.1.30 or tomcat 4.1.27... but I can't be sure 
> that it is the same issue. My bet is that most of the tomcat developers 
> don't use connectors because they would rather keep things stable, and 
> introducing apache into the mix just means one more point of failure.
> 
> Sorry I can't be of more help right now. I've tried using JMeter to 
> reproduce my lockups, and that hasn't helped me yet.
> Is there someone out there who would like to be paid to run a profiler 
> on some of my applications? Please contact me off-list, and if you can 
> solve my issue, I'll post the results to the list... I'm in contact with 
> two or three people from this list that are having the same type of 
> issues, and more requests for help come into the list weekly. We'd all 
> be happy for the help.
> 
> Daniel Gibby
> 
> Beat De Martin wrote:
> 
> >Hello folks
> >I'm using Tomcat 3.3.1, Apache 1.3.27 and mod_jk 1.2.4.
> >Every two days my Tomcat hungs and I have to restart it.
> >Before Tomcat hungs I can see the following in mod_jk.log:
> > ERROR: can't receive the response message from tomcat, network problems
> or
> >tomcat is down. err=-1
> >  [jk_ajp_common.c (1137)]: Error reading reply from tomcat. Tomcat is
> down
> >or network problems.
> >  [jk_ajp_common.c (1290)]: ERROR: Receiving from tomcat failed,
> recoverable
> >operation. err=0
> > [jk_ajp_common.c (1309)]: sending request to tomcat failed in send loop.
> >err=0
> >
> >Any ideas ?
> >Cheers
> >Beat
> >
> >  
> >
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
NEU : GMX Internet.FreeDSL
Ab sofort DSL-Tarif ohne Grundgebühr: http://www.gmx.net/dsl


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



Re: Apache2/Tomcat5/mod_jk2 problems

2004-05-11 Thread QM
On Tue, May 11, 2004 at 11:05:34AM +0100, Adrian Barnett wrote:
: After trying numerous different things, suspicion falls on mod_jk2. The 
: docs on mod_jk2 are not very helpful. Some say that mod_jk2 is better than 
: mod_jk and should be used in place of it, others say that mod_jk2 is not 
: stable enough for production use yet and mod_jk should be used instead.

Why not just try mod_jk and rerun your tests?
If you don't experience a memory leak in that case, then you'll know
that mod_jk2 (in its current state) isn't stable enough for your site.


: Also, we are using the JNI mode of communication for mod_jk2, rather than 
: Unix sockets.

What happens when you use sockets?

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



RE: Can you ever update a sessions access time?

2004-05-11 Thread Balunas, Jay
Thanks for all the responses here are my thoughts:

the "-1" idea causes a problem because a user could just close the browser and we 
would not know when to invalidate the session (memory leak)

the html page sends a pseudo request is a good one, but we really only wanted to have 
the keep alive when the remote app was open and the html does not know that.

We may change our paradigm that the keep alive is from the html page, and might 
simplify this.

Thanks again,

Jay

-Original Message-
From: Dale, Matt [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 11, 2004 10:43 AM
To: Tomcat Users List
Subject: RE: Can you ever update a sessions access time?



One method i've used to maintain a session is a meta refresh on the html pages, this 
may or may not be appropriate to your app though.

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: 11 May 2004 15:36
To: Tomcat Users List
Subject: RE: Can you ever update a sessions access time?



Hi,

>   Our need for this is that we have a java application that is
launched
>remotely by a control web-page.  As long as the remove application is
>active we do not want to the session that launched it to die.
>Unfortunately these were the requirements given to me, I just need to
see
>if it is possible.

You should probably scream a bit at the person who gave you the
requirements ;)

What about setting session-timeout to -1 in your web.xml?  That means
sessions won't timeout due to inactivity, and will become invalid only
if you explicitly invalidate them.  Then you don't have to worry about a
kludge keep-alive solution.

Yoav



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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


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



Re: Bad Cookie Name when NOT using cookies?

2004-05-11 Thread Evgeny Gesin
Of course, I not disabled cookies in Tomcat and my
program invokes session.getAttribute() and
session.setAttribute(), but the program not
creates/reads cookies.

So, I will think about (2), if another appl on my
server might be setting cookies in the root path...
By the way how I can check that?
--
Evgeny
Javadesk

Some questions that might help:

1) Do you have cookies turned off completely on all of
your contexts? 
That means that you should be seeing ;jsessionid= in
any of your URLs 
unless they are just hard coded html urls, right? In
other words, if 
you 
use response.encodeURL() for links, you should have
the jsessionid 
added 
to the URL.
Are you doing nothing with sessions?
session.getAttribute(), or 
setAttribute() ?
You couldn't truly be doing anything with them if you
really have 
cookies turned off.
If you do have no session cookie, then either you have
jsessionid in 
all 
of your request URLs, or else you are creating a new
session on every 
request... you could try
System.out.println(session.getId()) to see if 
you are getting a new session everytime or reusing an
old one.

2) Are there other apps at your domain that might be
setting cookies in 
the root path, and tomcat just happens to be trying to
load them?

Daniel Gibby




__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

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



RE: Filter on url example - Filter out hack attempts

2004-05-11 Thread Ralph Einfeldt

It's not always easy easy to find the right list for 
a question. The opinions about what is right or wrong
vary with the members of the list. (In my opinion
your question is right in this list, although I can
understand that others have different opinions in this 
case)

I have seen questions that where more of topic than yours.

http://forum.java.sun.com/ is not a bad idea as there
you may ask questions about java, jsp, servlets and other 
things that are not drectly related with tomcat.

> -Original Message-
> From: lrnobs [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 11, 2004 4:17 PM
> To: Tomcat Users List
> Subject: Re: Filter on url example - Filter out hack attempts
> 
> 
> 
> I am a newbie to Java and Tomcat, and I did spend two days 
> with two Tomcat books I bought and Google trying to find 
> some instructions I could understand before posting a 
> question to this list. Please let me know if there is a 
> list more appropriate for new users.
> 

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



Re: Filter on url example - Filter out hack attempts

2004-05-11 Thread lrnobs
Adam,

Thanks for the additional links.

I'm a twenty year IT professional and I feel like I am in kindergarden all
over again.

It is hard to make the switch from Microsoft products and not lose the house
in the process.  I've taken a Unix class and a Java class at the local
community college, and have gotten some basic Samba servers going, after
crawling through the documentation for hours.

I appreciate any help I can get from this list.

Larry Nobs




- Original Message - 
From: "Adam Buglass" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, May 11, 2004 9:30 AM
Subject: Re: Filter on url example - Filter out hack attempts


> Hi Larry, as someone who has only been using tomcat (apart from the
> deploy tool) since August and who has had to greatly improve my Java
> skills since the same time...
>
> I suggest the best way to learn is to get your hands dirty, so to speak.
> Thoroughly read the provided Tomcat docs including any ReadMe files you
> can get your hands on. Get you hands on any example server.xml files
> that you can (there'll probably be some in your books and on the web).
> As for Java, find some good books to teach you Java and JSPs. I found
> Java a very steep learning curve at first. I have also found the
> following Java site very useful (and the book that goes with it):
> http://javagently.cs.up.ac.za/  and these pages:
> http://java.sun.com/j2se/1.3/docs/api/
> I expect you'll find all the pages quoted by Nathan as being useful
> also.
>
> I've found the best way is to dive in and use them, preferably install
> Suns Java compiler and Tomcat onto a system somewhere where they can't
> do major harm if they go wrong (ie. not a server that's already in use!)
> and just have a go.
> I've had to do a lot of it on an up and running server but I don't
> advise this!!
>
> Anyway those are just some thoughts and suggestions that may or may not
> work for you.
>
> Hope it helps.
> Adam.
>
>
>



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



Re: Bad Cookie Name when NOT using cookies?

2004-05-11 Thread Daniel Gibby
Some questions that might help:

1) Do you have cookies turned off completely on all of your contexts? 
That means that you should be seeing ;jsessionid= in any of your URLs 
unless they are just hard coded html urls, right? In other words, if you 
use response.encodeURL() for links, you should have the jsessionid added 
to the URL.
Are you doing nothing with sessions? session.getAttribute(), or 
setAttribute() ?
You couldn't truly be doing anything with them if you really have 
cookies turned off.
If you do have no session cookie, then either you have jsessionid in all 
of your request URLs, or else you are creating a new session on every 
request... you could try System.out.println(session.getId()) to see if 
you are getting a new session everytime or reusing an old one.

2) Are there other apps at your domain that might be setting cookies in 
the root path, and tomcat just happens to be trying to load them?

Daniel Gibby

Patrick Willart wrote:

Too bad you didn't get a reply on this. My log file is full with similar
messages and had hoped to learn what was causing them.
Anyone?

Patrick

-Original Message-
From: Evgeny Gesin [mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 1:49 PM
To: Tomcat Users List
Subject: Bad Cookie Name when NOT using cookies?
I not remember, if I asked this before, but it
happened again.
I DON'T USE cookies in my application. But sometimes I
see the following error messages in catalina log
files.
Can you comment and how to solve that?
Evgeny
Javadesk
2004-05-09 23:57:53 CoyoteAdapter Bad Cookie Name:
Path /Value: /myapplName
java.lang.IllegalArgumentException: Cookie name Path
is a reserved token
   at
javax.servlet.http.Cookie.(Cookie.java:185)
   at
org.apache.coyote.tomcat4.CoyoteAdapter.parseCookies(CoyoteAdapter.java:413)
   at
org.apache.coyote.tomcat4.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:
304)
   at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
   at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:324)
   at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:395)
   at
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:673)
   at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:615)
   at
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786)
   at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:683)
   at java.lang.Thread.run(Thread.java:534)


__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



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


RE: Can you ever update a sessions access time?

2004-05-11 Thread Dale, Matt

One method i've used to maintain a session is a meta refresh on the html pages, this 
may or may not be appropriate to your app though.

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: 11 May 2004 15:36
To: Tomcat Users List
Subject: RE: Can you ever update a sessions access time?



Hi,

>   Our need for this is that we have a java application that is
launched
>remotely by a control web-page.  As long as the remove application is
>active we do not want to the session that launched it to die.
>Unfortunately these were the requirements given to me, I just need to
see
>if it is possible.

You should probably scream a bit at the person who gave you the
requirements ;)

What about setting session-timeout to -1 in your web.xml?  That means
sessions won't timeout due to inactivity, and will become invalid only
if you explicitly invalidate them.  Then you don't have to worry about a
kludge keep-alive solution.

Yoav



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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

Any opinions expressed in this E-mail may be those of the individual and not 
necessarily the company. This E-mail and any files transmitted with it are 
confidential and solely for the use of the intended recipient. If you are not the 
intended recipient or the person responsible for delivering to the intended recipient, 
be advised that you have received this E-mail in error and that any use or copying is 
strictly prohibited. If you have received this E-mail in error please notify the 
beCogent postmaster at [EMAIL PROTECTED]
Unless expressly stated, opinions in this email are those of the individual sender and 
not beCogent Ltd. You must take full responsibility for virus checking this email and 
any attachments.
Please note that the content of this email or any of its attachments may contain data 
that falls within the scope of the Data Protection Acts and that you must ensure that 
any handling or processing of such data by you is fully compliant with the terms and 
provisions of the Data Protection Act 1984 and 1998.


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

RE: Filter on url example - Filter out hack attempts

2004-05-11 Thread Shapira, Yoav

Hi,

>I have been looking at the Access Logs daily.
>
>Anytime a legitimate user accesses my site everything is preceded with
a
>GET
>or POST and a jsp or gif that I can recognize.  Initially a session
starts
>off with a plain GET / HTTP/1.1 or 1.0 so I should allow these, but all
>other legitimate usage mentions my files.  It sounds like you are
saying
>that there are other requests that are not in the access log?

No, that's not what I'm saying.  I'm saying you have a lot to learn with
regards to the Servlet API.  The information returned from the
getRequestURI method in HttpServletRequest is not the same information
that is logged in the access logs.  (And for that matter, the latter is
highly configurable whereas the former is strictly defined).  So that's
why I said you should read and understand the HttpServletRequest
interface and its methods.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: JVM startup options for Windows Service

2004-05-11 Thread Hector Adolfo Alonso
Damon:
  I've developed the following scripts for install/deinstall Tomcat 
5.0.19.
 They are based on bin\service bat in Tomcat distribution, and Apache 
Commons Daemon project info.
  Modify as you need. I hope this help you.

Hector./

ServiceInstall.bat

@echo off

set PATH=
set CLASSPATH=
set CATALINA_HOME=E:\JavaStuff\jakarta-tomcat-5.0.19
set CATALINA_BASE=%CATALINA_HOME%set JVM_HOME=E:\Progra~1\JDK142
set EXECUTABLE=%CATALINA_HOME%\bin\tomcat.exe
set SERVICE_NAME=Tomcat5019-142X
set DISPLAY_NAME=Tomcat 5.0.19 with JDK 1.4.2.X
set DESCRIPTION=Apache Tomcat Server 5.0.19 with JDK 1.4.2.X
set IMAGE_PATH=%CATALINA_HOME%\bin\bootstrap.jar
set ARGUMENTS=
set WORKING_PATH=%CATALINA_HOME%\bin
set JVM_LIBRARY=%JVM_HOME%\jre\bin\server\jvm.dll
set JVM_OPTIONS=-server#-verbose:gc#-Xms256m#-Xmx512m#-Xrs#-Xloggc:"%CATALINA_BASE%\logs\GC.log"#-Djava.endorsed.dirs="%CATALINA_HOME%\common\endorsed"#-Dcatalina.base="%CATALINA_BASE%"#-Dcatalina.home="%CATALINA_HOME%"#-DJava.io.tmpdir="%CATALINA_BASE%\temp"
set STARTUP_CLASS=org.apache.catalina.startup.Bootstrap;main;start
set SHUTDOWN_CLASS=org.apache.catalina.startup.Bootstrap;main;stop
set STDIN_FILE=
set STDOUT_FILE=%CATALINA_BASE%\logs\SystemOut.log
set STDERR_FILE=%CATALINA_BASE%\logs\SystemErr.log
set STARTUP=auto
set USER=
set PASSWORD=
set INSTALL="%EXECUTABLE%" 

"%EXECUTABLE%" "//IS//%SERVICE_NAME%" --DisplayName "%DISPLAY_NAME%" --Description "%DESCRIPTION%" --ImagePath "%IMAGE_PATH%" --WorkingPath "%WORKING_PATH%" --Java "%JVM_LIBRARY%" --JavaOptions %JVM_OPTIONS% --StartupClass "%STARTUP_CLASS%" --ShutdownClass "%SHUTDOWN_CLASS%" --StdOutputFile "%STDOUT_FILE%" --StdErrorFile "%STDERR_FILE%" --Startup "%STARTUP%" --Install "%EXECUTABLE%" 

ServiceUninstall.bat

@echo off

set PATH=
set CLASSPATH=
set CATALINA_HOME=E:\JavaStuff\jakarta-tomcat-5.0.19
set SERVICE_NAME=Tomcat5019-142X
set EXECUTABLE=%CATALINA_HOME%\bin\tomcat.exe
"%EXECUTABLE%" "//DS//%SERVICE_NAME%"

Damon Henderson wrote:

I need to know how to specify JVM startup options when 5.0.24 is
installed as a Windows service. Can I add my options to service.bat and
install the service with options? if so how ? Or does Tomcat5.exe call
catalina.bat in which case I can just use JAVA_OPTS=
Thanks 

 



RE: Can you ever update a sessions access time?

2004-05-11 Thread Shapira, Yoav

Hi,

>   Our need for this is that we have a java application that is
launched
>remotely by a control web-page.  As long as the remove application is
>active we do not want to the session that launched it to die.
>Unfortunately these were the requirements given to me, I just need to
see
>if it is possible.

You should probably scream a bit at the person who gave you the
requirements ;)

What about setting session-timeout to -1 in your web.xml?  That means
sessions won't timeout due to inactivity, and will become invalid only
if you explicitly invalidate them.  Then you don't have to worry about a
kludge keep-alive solution.

Yoav



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: Apache2/Tomcat5/mod_jk2 problems

2004-05-11 Thread Daniel Gibby
I *really* wish I knew the answers to your questions. Connectors are the 
most frustrating part of using tomcat. But then again, I haven't tried 
session replication ;-)

I don't know if the problem that I'm having is the same as yours, but I 
have to kill and restart tomcat every other day or so. I've actually 
made a cron that restarts tomcat nightly now. Problem solved, right? ;-) 
Now I'll never know if I ever fix it. :-(

See my other post to the similar thread that just started today by Beat 
De Martin:
Subject: apache, mod_jk, tomcat hungs

BTW, I'm using Unix sockets, because I thought I read somewhere that 
they are faster, but I wouldn't count on that being true, since JNI is 
still required for some reason on top of that... maybe they were 
supposed to be faster in theory since you wouldn't have to load JNI, but 
I don't think unix sockets will work without JNI. I would have switched 
to normal TCP Sockets by now, but I keep reading of people like you who 
are having the same problems I'm having.

Daniel Gibby

Adrian Barnett wrote:

Hi,
I'm having an annoying memory leak problem in tomcat5 on Redhat 9. The 
memory gradually creeps up until the JVM runs out of memory. (I've 
been using JMeter to send thousands of requests to tomcat)

Now, if I run the tests against tomcat by itself (via port 8080) it is 
fine and stable, the problem only occurs when I use port 80 to go via 
Apache.

After trying numerous different things, suspicion falls on mod_jk2. 
The docs on mod_jk2 are not very helpful. Some say that mod_jk2 is 
better than mod_jk and should be used in place of it, others say that 
mod_jk2 is not stable enough for production use yet and mod_jk should 
be used instead.

Also, we are using the JNI mode of communication for mod_jk2, rather 
than Unix sockets.

So, my questions are:
1) Which is safest - mod_jk or mod_jk2?
Neither? I'd really say neither would be safest.

2) Are there docs which describe when/why you should JNI or Unix 
sockets (or any other method), and what the advantages/disadvantages are?
Probably so, but I can never find them when I need them. And the 
"official" docs don't do the job very well.

3) Anybody got any other clues as to what could cause a leak like 
this? (I've searched many tomcat mail archives but found nothing of use)

Cheers,
Adrian Barnett


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


RE: Multihosting in tomcat

2004-05-11 Thread Shapira, Yoav

Hi,
Oh, BTW: JDK 1.4 has a JVM option to ignore explicit System.exit calls.
I forget the exact syntax but you can look it up on Sun's VM Options web
page.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Benjamin Armintor [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, May 11, 2004 10:32 AM
>To: Tomcat Users List
>Subject: RE: Multihosting in tomcat
>
>Michal-
>  We're in exactly the same situation (running 4.1.x), and our solution
>is to isolate the most critical application(s) in their own jvm (and
>tomcat instance).  Because everything is running as a single process,
>it's difficult to get very fine-grained control over an app's resource
>use beyond that.
>
>  I imagine there are steps one could take to add some kind of
>instrumentation on threads, etc., but I'd also have to imagine that
>being an extremely heavyweight solution.  If you come up with a better
>way of doing things, please post.
>
>  Regarding your security manager comment:  You shouldn't need to write
>a custom security manager- you probably just need to customize your
>policy file.  You can isolate webapps by code base or signature (if
>they're deployed from a war file), so you're really just limited by
your
>tolerance for keeping the policy file up-to-date.  The only
>customization of the manager I ever needed to do was to write a kind of
>"open" manager that logged missing permissions instead of throwing
>exceptions:  This was to do development without having to resort to the
>AllPermission "solution" that folks tend to suggest when
>AccessControlExceptions start popping up.
>
>Benjamin J. Armintor
>Systems Analyst
>ITS-Systems: Mainframe Group
>University of Texas - Austin
>tele: (512) 232-6562
>email: [EMAIL PROTECTED]
>
>
>
>-Original Message-
>From: Michal Kwiatek [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, May 11, 2004 9:21 AM
>To: Tomcat Users List
>Subject: RE: Multihosting in tomcat
>
>
>To add another point to my earlier post: I'm not concerned with
>malicious code like "System.exit(1)" because a custom SecurityManager
>will take care of that. What worries me is the abuse of resources
>causing the server to go low on resources and crash. Perhaps installing
>a separate Tomcat instance for every application is a solution?
>
>Cheers,
>Michal.
>
>-Original Message-
>From: Michal Kwiatek
>Sent: Tuesday, May 11, 2004 9:42 AM
>To: [EMAIL PROTECTED]
>Subject: Multihosting in tomcat
>
>Hello all!
>
>I have to set up a multihosting service based on tomcat. What I mean by
>multihosting is that many people are able to deploy their web
>application on the server. The problem is that the applications can be
>badly written (for instance can contain unfinite loops) and thus cause
>the server to go down on resources and crash.
>
>I need a solution for:
> (1) identifing applications consuming to much resources,
> (1) killing them.
>
>I know that it is possible to programatically stop a web application
>deployed on Tomcat. But will it work if Tomcat gets low on resources?
>And how will I know which application to stop in the first place?
>Needless to say, it has to be done automatically.
>
>Thanks very much,
>Michal.
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Multihosting in tomcat

2004-05-11 Thread Shapira, Yoav

Hi,

>To add another point to my earlier post: I'm not concerned with
>malicious code like "System.exit(1)" because a custom SecurityManager
>will take care of that. What worries me is the abuse of resources
>causing the server to go low on resources and crash. Perhaps installing
>a separate Tomcat instance for every application is a solution?

OK, now we're getting more realistic ;)

A separate tomcat instance per application means much less worrying
about them killing each other.  Any one app can only damage itself.
This is great from a security and stability perspective, but can be a
nightmare to administer (although if you have a nice JMX console, you're
in much better shape as you can configure it with all your tomcat
instances and control them from one place).

But since you're already handling some things with a custom security
manager, and are only concerned with the resources, here's one
additional possible approach.

Create a listener (probably the tomcat-specific Lifecycle Listener), but
can be a more portable ServletContextListener tied to the admin or
manager webapps for example, or to a webapp that will always be present
on your server.  Have this listener spawn a (daemon) thread that
monitors memory usage (via Runtime.freeMemory etc.), and when it drops
below a certain percentage takes action.  The action can be to notify
the administrator, or do tomcat specific-things (like accessing the
manager webapp programmatically to stop/restart/undeploy applications).
You will not know which application is causing the problem.  You also
won't be able to monitor CPU usage, which is the problem in cases like
infinite loops.  But it's something.

Yoav Shapira




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: Filter on url example - Filter out hack attempts

2004-05-11 Thread lrnobs
Yoav,

> Make sure you understand what a request URI is for the HTTP protocol.
> It will have neither the GET (method name) nor the protocol spec
> (HTTP/1.1 above).  Read and understand the JavaDocs for the
> HttpServletRequest interface completely.

I have been looking at the Access Logs daily.

Anytime a legitimate user accesses my site everything is preceded with a GET
or POST and a jsp or gif that I can recognize.  Initially a session starts
off with a plain GET / HTTP/1.1 or 1.0 so I should allow these, but all
other legitimate usage mentions my files.  It sounds like you are saying
that there are other requests that are not in the access log?

Thanks,

Larry Nobs



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



Re: Filter on url example - Filter out hack attempts

2004-05-11 Thread Adam Buglass
Hi Larry, as someone who has only been using tomcat (apart from the
deploy tool) since August and who has had to greatly improve my Java
skills since the same time...

I suggest the best way to learn is to get your hands dirty, so to speak.
Thoroughly read the provided Tomcat docs including any ReadMe files you
can get your hands on. Get you hands on any example server.xml files
that you can (there'll probably be some in your books and on the web).
As for Java, find some good books to teach you Java and JSPs. I found
Java a very steep learning curve at first. I have also found the
following Java site very useful (and the book that goes with it):
http://javagently.cs.up.ac.za/  and these pages:
http://java.sun.com/j2se/1.3/docs/api/
I expect you'll find all the pages quoted by Nathan as being useful
also.

I've found the best way is to dive in and use them, preferably install
Suns Java compiler and Tomcat onto a system somewhere where they can't
do major harm if they go wrong (ie. not a server that's already in use!)
and just have a go.
I've had to do a lot of it on an up and running server but I don't
advise this!!

Anyway those are just some thoughts and suggestions that may or may not
work for you.

Hope it helps.
Adam.



On Tue, 2004-05-11 at 15:16, lrnobs wrote:
> Nathan,
> 
> I am a newbie to Java and Tomcat, and I did spend two days with two Tomcat
> books I bought and Google trying to find some instructions I could
> understand before posting a question to this list.  Please let me know if
> there is a list more appropriate for new users.
> 
> Thanks,
> 
> Larry Nobs
> 
> 
> - Original Message - 
> From: "Nathan Maves" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, May 11, 2004 8:56 AM
> Subject: Re: Filter on url example - Filter out hack attempts
> 
> 
> > First of this is not a Tomcat question.  This type of information is
> > always available at http://java.sun.com or http://forum.java.sun.com/
> >
> > To answer your questionYes.  in-fact you can place the class where
> > ever you want as long as it is in your classpath.  Of course you will
> > also have to change the  attribute accordingly.
> >
> > Nathan
> > On May 11, 2004, at 7:42 AM, lrnobs wrote:
> >
> > > Yoav,
> > >
> > > So from what I know so far my
> > > /usr/local/tomcat/webapps/myapplication/WEB-INF/web.xml should look
> > > like the
> > > following:
> > >
> > > 
> > >   
> > > UrlFilter
> > > UrlFilter *Don't know how this should
> > > layout.*
> > >   
> > >
> > >   
> > > UrlFilter
> > > /*
> > >   
> > >
> > >   
> > > index.jsp
> > > index.html
> > >   
> > > 
> > >
> > >
> > > Do I then create
> > > /usr/local/tomcat/webapps/myapplication/WEB-INF/classes/URLFilter.java?
> > >
> > >
> > >  public class UrlFilter implements Filter {
> > >...
> > >public void doFilter(...) {
> > >  if(req instance of HttpServletRequest) {
> > >HttpServletRequest hreq = (HttpServletRequest) req;
> > >String uri = hreq.getRequestURI();
> > >if(allow(uri)){
> > >  chain.doFilter(req, res);
> > >} else {
> > > ...Send to Null
> > >  // Do whatever: error page, redirect, etc.
> > >}
> > >  } else {
> > >// Non-HTTP requests
> > >chain.doFilter(req, res);
> > >  }
> > >}
> > >
> > >  private boolean allow(String uri) {
> > >  // Look up allowed urls in a DB, Collection, whatever
> > >
> > >SubstringTest = False;
> > > SubstringTest = string.indexOf("GET / HTTP/1.1") > 0;
> > >  if(SubstringTest = True) return True;
> > >  Do the same for the rest
> > >  //GET / HTTP/1.0 //page1.jsp //page2.jsp //page3.jsp
> > > //page4.jsp //page5.jsp //graphic1.gif //graphic2.gif
> > >  } }
> > >
> > > Thanks,
> > >
> > > Larry Nobs
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >>
> > >> Hi,
> > >> This is a trivial filter:
> > >> public class URLFilter implements Filter {
> > >>   ...
> > >>   public void doFilter(...) {
> > >> if(req instance of HttpServletRequest) {
> > >>   HttpServletRequest hreq = (HttpServletRequest) req;
> > >>   String uri = hreq.getRequestURI();
> > >>   if(allow(uri)){
> > >> chain.doFilter(req, res);
> > >>   } else {
> > >> // Do whatever: error page, redirect, etc.
> > >>   }
> > >> } else {
> > >>   // Non-HTTP requests
> > >>   chain.doFilter(req, res);
> > >> }
> > >>   }
> > >>
> > >> private boolean allow(String uri) {
> > >>  // Look up allowed urls in a DB, Collection, whatever
> > >> }
> > >> }
> > >>
> > >> I omitted full prototype declarations above due to laziness.  It's the
> > >> javax.servlet.Filter interface.
> > >>
> > >> Take a look at the balancer webapp that ships with tomcat 5.  The
> > >> URLStringMatchRule is pretty close to what you want, and can be easily
> > >> extended with a list of allow patterns an

RE: Can you ever update a sessions access time?

2004-05-11 Thread Balunas, Jay
Thanks for the reply,

The problem is that just setting, getting, or removing an attribute from the 
session will not update the access time.  This is what I was originally going to do, 
but after looking at the tomcat source this is not the case.

I would prefer not to circumvent any tomcat or spec implementation.  I am just 
wondering if there is any other way to do this?

Our need for this is that we have a java application that is launched remotely 
by a control web-page.  As long as the remove application is active we do not want to 
the session that launched it to die.  Unfortunately these were the requirements given 
to me, I just need to see if it is possible.

Thanks again,
Jay

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 11, 2004 10:12 AM
To: Tomcat Users List
Subject: RE: Can you ever update a sessions access time?



Hi,
Why are you doing this at all?  Any time you try to circumvent the Servlet 
Specification this way, you'll get burned in the long run.

More specifically, any solution you come up with here will be specific not only to 
tomcat, but to this tomcat version, as the façade or its implementation may change 
with future releases.

A neater way to do this if you have to, is to get the session, set and then remove an 
attribute in it.  That'll update the access time.


Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Balunas, Jay [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, May 11, 2004 9:29 AM
>To: [EMAIL PROTECTED]
>Subject: Can you ever update a sessions access time?
>
>All,
>
>I need to update a session access time (as if a request had just occurred).
>
>I have a application that sends a "keep-a-live" message to tomcat (with a
>sessionID).  I wrote a session tracker to retrieve the already created
>session (via an earlier web-page request)
>
>When I our servlet receives the keep-a-live message it retrieves the
>session and must mark it as having been accessed.
>
>I have looked through the tomcat source and what I really need to do is to
>access the "ServerSession.touch(long)" method. This is protected within
>"HttpSessionFacade" class.
>
>Is there any other way to do this?
>
>Thanks,
>Jay
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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


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



RE: Bad Cookie Name when NOT using cookies?

2004-05-11 Thread Patrick Willart
Too bad you didn't get a reply on this. My log file is full with similar
messages and had hoped to learn what was causing them.

Anyone?

Patrick

-Original Message-
From: Evgeny Gesin [mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 1:49 PM
To: Tomcat Users List
Subject: Bad Cookie Name when NOT using cookies?


I not remember, if I asked this before, but it
happened again.

I DON'T USE cookies in my application. But sometimes I
see the following error messages in catalina log
files.
Can you comment and how to solve that?

Evgeny
Javadesk

2004-05-09 23:57:53 CoyoteAdapter Bad Cookie Name:
Path /Value: /myapplName
java.lang.IllegalArgumentException: Cookie name Path
is a reserved token
at
javax.servlet.http.Cookie.(Cookie.java:185)
at
org.apache.coyote.tomcat4.CoyoteAdapter.parseCookies(CoyoteAdapter.java:413)
at
org.apache.coyote.tomcat4.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:
304)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:324)
at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:395)
at
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:673)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:615)
at
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:683)
at java.lang.Thread.run(Thread.java:534)




__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover

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


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



RE: Multihosting in tomcat

2004-05-11 Thread Benjamin Armintor
Michal-
  We're in exactly the same situation (running 4.1.x), and our solution
is to isolate the most critical application(s) in their own jvm (and
tomcat instance).  Because everything is running as a single process,
it's difficult to get very fine-grained control over an app's resource
use beyond that.

  I imagine there are steps one could take to add some kind of
instrumentation on threads, etc., but I'd also have to imagine that
being an extremely heavyweight solution.  If you come up with a better
way of doing things, please post.

  Regarding your security manager comment:  You shouldn't need to write
a custom security manager- you probably just need to customize your
policy file.  You can isolate webapps by code base or signature (if
they're deployed from a war file), so you're really just limited by your
tolerance for keeping the policy file up-to-date.  The only
customization of the manager I ever needed to do was to write a kind of
"open" manager that logged missing permissions instead of throwing
exceptions:  This was to do development without having to resort to the
AllPermission "solution" that folks tend to suggest when
AccessControlExceptions start popping up.  

Benjamin J. Armintor
Systems Analyst
ITS-Systems: Mainframe Group
University of Texas - Austin
tele: (512) 232-6562
email: [EMAIL PROTECTED]
 


-Original Message-
From: Michal Kwiatek [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 11, 2004 9:21 AM
To: Tomcat Users List
Subject: RE: Multihosting in tomcat


To add another point to my earlier post: I'm not concerned with
malicious code like "System.exit(1)" because a custom SecurityManager
will take care of that. What worries me is the abuse of resources
causing the server to go low on resources and crash. Perhaps installing
a separate Tomcat instance for every application is a solution?

Cheers,
Michal.

-Original Message-
From: Michal Kwiatek 
Sent: Tuesday, May 11, 2004 9:42 AM
To: [EMAIL PROTECTED]
Subject: Multihosting in tomcat

Hello all!

I have to set up a multihosting service based on tomcat. What I mean by
multihosting is that many people are able to deploy their web
application on the server. The problem is that the applications can be
badly written (for instance can contain unfinite loops) and thus cause
the server to go down on resources and crash.

I need a solution for:
 (1) identifing applications consuming to much resources,
 (1) killing them.

I know that it is possible to programatically stop a web application
deployed on Tomcat. But will it work if Tomcat gets low on resources?
And how will I know which application to stop in the first place?
Needless to say, it has to be done automatically.

Thanks very much,
Michal.



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



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


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



Re: Help with Simple JDBC Connection (sry, kinda long)

2004-05-11 Thread Keg


Parsons Technical Services wrote:
Keg,

Don't see anything at this point.

Post the context section for this app.

Doug
- Original Message - 
From: "Keg" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Saturday, May 08, 2004 9:47 PM
Subject: Re: Help with Simple JDBC Connection (sry, kinda long)
What do you mean context section? I posted server.xml, 
webapps/dev1/WEB-INF/web.xml and then java and jsp files. The app is 
listed as being deployed within the Admin application.

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


FW: Directory recursion with mod_jk2.

2004-05-11 Thread Cox, Charlie

> -Original Message-
> From: Brett Simpson [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 11, 2004 8:55 AM
> To: [EMAIL PROTECTED]
> Cc: Cox, Charlie
> Subject: Re: Directory recursion with mod_jk2.
> 
> On Tuesday 11 May 2004 08:21 am, Cox, Charlie wrote:
> > Did you set the  in web.xml so that it knows to use
> > index.cfm as a welcome page?
> 
> If I set that then it does work but I would rather control it through
Apache
> since that will function much closer to our existing Apache + mod_jrun +
> Coldfusion MX non-j2ee install.
> 
> > Also, I think your  is wrong for Apache. Apache doesn't know
> > about the directories used by tomcat, so it will never match your path.
I
> > think you want something like this:
> >
> > 
> > Options All
> > DirectoryIndex index.cfm
> > 

Ok, now that I reviewed my config, I have DirectoryIndex in the
, not in a . (sorry about that - too many JkUriSets
recently) The problem that you are running into is that Apache does not know
that tomcat is pointing the request to your cfusion directory since tomcat
can point to a context that resides in any directory.

If you set your DirectoryIndex in your  or Main section if you
have no vhost, then it should work correctly. 

> 
> I have my document root set the same as the Directory. If I disable
mod_jk2
> then Apache can browse the files in the
> "/opt/jakarta-tomcat-4.1.30/webapps/cfusion/" folder.
> 
> DocumentRoot "/opt/jakarta-tomcat-4.1.30/webapps/cfusion/"
> 
> 
> Options All
> DirectoryIndex index.cfm
> 

I'm not sure at what point JkUriSet trumps  declarations(does
 matter if the request goes to tomcat since tomcat can serve the
request from a (possibly) completely different directory?). I do know that 

DocumentRoot /myroot
DirectoryIndex index.html

works with tomcat and the index.html request is what is sent to tomcat, not
the directory (/) request.

Charlie


Re: apache, mod_jk, tomcat hungs

2004-05-11 Thread Daniel Gibby
All I can say is you are not alone. Requests of our sort never seem to 
be answered, and we've been asking them for months.
Actually, by being answered I'm not saying that people don't post 
replies, I just mean that I don't know of anyone who has fixed this 
issue on their system.

It sure sounds like the same issue that I'm having with mod_jk2 2.0.2, 
apache 2.0.40, tomcat 4.1.30 or tomcat 4.1.27... but I can't be sure 
that it is the same issue. My bet is that most of the tomcat developers 
don't use connectors because they would rather keep things stable, and 
introducing apache into the mix just means one more point of failure.

Sorry I can't be of more help right now. I've tried using JMeter to 
reproduce my lockups, and that hasn't helped me yet.
Is there someone out there who would like to be paid to run a profiler 
on some of my applications? Please contact me off-list, and if you can 
solve my issue, I'll post the results to the list... I'm in contact with 
two or three people from this list that are having the same type of 
issues, and more requests for help come into the list weekly. We'd all 
be happy for the help.

Daniel Gibby

Beat De Martin wrote:

Hello folks
I'm using Tomcat 3.3.1, Apache 1.3.27 and mod_jk 1.2.4.
Every two days my Tomcat hungs and I have to restart it.
Before Tomcat hungs I can see the following in mod_jk.log:
ERROR: can't receive the response message from tomcat, network problems or
tomcat is down. err=-1
 [jk_ajp_common.c (1137)]: Error reading reply from tomcat. Tomcat is down
or network problems.
 [jk_ajp_common.c (1290)]: ERROR: Receiving from tomcat failed, recoverable
operation. err=0
[jk_ajp_common.c (1309)]: sending request to tomcat failed in send loop.
err=0
Any ideas ?
Cheers
Beat
 



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


RE: Multihosting in tomcat

2004-05-11 Thread Michal Kwiatek
To add another point to my earlier post: I'm not concerned with
malicious code like "System.exit(1)" because a custom SecurityManager
will take care of that. What worries me is the abuse of resources
causing the server to go low on resources and crash. Perhaps installing
a separate Tomcat instance for every application is a solution?

Cheers,
Michal.

-Original Message-
From: Michal Kwiatek 
Sent: Tuesday, May 11, 2004 9:42 AM
To: [EMAIL PROTECTED]
Subject: Multihosting in tomcat

Hello all!

I have to set up a multihosting service based on tomcat. What I mean by
multihosting is that many people are able to deploy their web
application on the server. The problem is that the applications can be
badly written (for instance can contain unfinite loops) and thus cause
the server to go down on resources and crash.

I need a solution for:
 (1) identifing applications consuming to much resources,
 (1) killing them.

I know that it is possible to programatically stop a web application
deployed on Tomcat. But will it work if Tomcat gets low on resources?
And how will I know which application to stop in the first place?
Needless to say, it has to be done automatically.

Thanks very much,
Michal.



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



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



JVM startup options for Windows Service

2004-05-11 Thread Damon Henderson
I need to know how to specify JVM startup options when 5.0.24 is
installed as a Windows service. Can I add my options to service.bat and
install the service with options? if so how ? Or does Tomcat5.exe call
catalina.bat in which case I can just use JAVA_OPTS=
 
 
Thanks 


Re: Filter on url example - Filter out hack attempts

2004-05-11 Thread lrnobs
Nathan,

I am a newbie to Java and Tomcat, and I did spend two days with two Tomcat
books I bought and Google trying to find some instructions I could
understand before posting a question to this list.  Please let me know if
there is a list more appropriate for new users.

Thanks,

Larry Nobs


- Original Message - 
From: "Nathan Maves" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, May 11, 2004 8:56 AM
Subject: Re: Filter on url example - Filter out hack attempts


> First of this is not a Tomcat question.  This type of information is
> always available at http://java.sun.com or http://forum.java.sun.com/
>
> To answer your questionYes.  in-fact you can place the class where
> ever you want as long as it is in your classpath.  Of course you will
> also have to change the  attribute accordingly.
>
> Nathan
> On May 11, 2004, at 7:42 AM, lrnobs wrote:
>
> > Yoav,
> >
> > So from what I know so far my
> > /usr/local/tomcat/webapps/myapplication/WEB-INF/web.xml should look
> > like the
> > following:
> >
> > 
> >   
> > UrlFilter
> > UrlFilter *Don't know how this should
> > layout.*
> >   
> >
> >   
> > UrlFilter
> > /*
> >   
> >
> >   
> > index.jsp
> > index.html
> >   
> > 
> >
> >
> > Do I then create
> > /usr/local/tomcat/webapps/myapplication/WEB-INF/classes/URLFilter.java?
> >
> >
> >  public class UrlFilter implements Filter {
> >...
> >public void doFilter(...) {
> >  if(req instance of HttpServletRequest) {
> >HttpServletRequest hreq = (HttpServletRequest) req;
> >String uri = hreq.getRequestURI();
> >if(allow(uri)){
> >  chain.doFilter(req, res);
> >} else {
> > ...Send to Null
> >  // Do whatever: error page, redirect, etc.
> >}
> >  } else {
> >// Non-HTTP requests
> >chain.doFilter(req, res);
> >  }
> >}
> >
> >  private boolean allow(String uri) {
> >  // Look up allowed urls in a DB, Collection, whatever
> >
> >SubstringTest = False;
> > SubstringTest = string.indexOf("GET / HTTP/1.1") > 0;
> >  if(SubstringTest = True) return True;
> >  Do the same for the rest
> >  //GET / HTTP/1.0 //page1.jsp //page2.jsp //page3.jsp
> > //page4.jsp //page5.jsp //graphic1.gif //graphic2.gif
> >  } }
> >
> > Thanks,
> >
> > Larry Nobs
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >>
> >> Hi,
> >> This is a trivial filter:
> >> public class URLFilter implements Filter {
> >>   ...
> >>   public void doFilter(...) {
> >> if(req instance of HttpServletRequest) {
> >>   HttpServletRequest hreq = (HttpServletRequest) req;
> >>   String uri = hreq.getRequestURI();
> >>   if(allow(uri)){
> >> chain.doFilter(req, res);
> >>   } else {
> >> // Do whatever: error page, redirect, etc.
> >>   }
> >> } else {
> >>   // Non-HTTP requests
> >>   chain.doFilter(req, res);
> >> }
> >>   }
> >>
> >> private boolean allow(String uri) {
> >>  // Look up allowed urls in a DB, Collection, whatever
> >> }
> >> }
> >>
> >> I omitted full prototype declarations above due to laziness.  It's the
> >> javax.servlet.Filter interface.
> >>
> >> Take a look at the balancer webapp that ships with tomcat 5.  The
> >> URLStringMatchRule is pretty close to what you want, and can be easily
> >> extended with a list of allow patterns and/or deny patterns.  Tomcat
> >> has
> >> something similar as the base Valve for the RemoteAddr/RemoteHost
> >> valves.
> >>
> >> Yoav Shapira
> >> Millennium Research Informatics
> >>
> >>
> >>> -Original Message-
> >>> From: lrnobs [mailto:[EMAIL PROTECTED]
> >>> Sent: Saturday, May 08, 2004 9:11 PM
> >>> To: Tomcat Users List
> >>> Subject: Filter on url example - Filter out hack attempts
> >>>
> >>> I have had no luck Googling so far for an example on how to filter
> >> based on
> >>> urls.
> >>>
> >>> I thought I might put this in the AccessLogValve but will do whatever
> >>> works.
> >>>
> >>> I have a limited number of jsp's and graphics on my site and would
> >>> like
> >> to
> >>> filter out all of the hack attempts that fill up my logs.
> >>>
> >>> I would like to do something like this (in plain english)
> >>>
> >>> Accept
> >>> GET / HTTP/1.1
> >>> GET / HTTP/1.0
> >>> *page1.jsp*
> >>> *page2.jsp*
> >>> *page3.jsp*
> >>> *page4.jsp*
> >>> *page5.jsp*
> >>> *graphic1.gif*
> >>> *graphic2.gif*
> >>>
> >>> Drop All Other Requests - they are just hack attempts
> >>>
> >>> Thanks,
> >>>
> >>> Larry Nobs
> >>>
> >>>
> >>>
> >>> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >>
> >> This e-mail, including any attachments, is a confidential business
> > communication, and may contain information that is confidential,
> > proprietary
> > and/or privileged.  This e-mail 

RE: Can you ever update a sessions access time?

2004-05-11 Thread Shapira, Yoav

Hi,
Why are you doing this at all?  Any time you try to circumvent the Servlet 
Specification this way, you'll get burned in the long run.

More specifically, any solution you come up with here will be specific not only to 
tomcat, but to this tomcat version, as the façade or its implementation may change 
with future releases.

A neater way to do this if you have to, is to get the session, set and then remove an 
attribute in it.  That'll update the access time.


Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Balunas, Jay [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, May 11, 2004 9:29 AM
>To: [EMAIL PROTECTED]
>Subject: Can you ever update a sessions access time?
>
>All,
>
>I need to update a session access time (as if a request had just occurred).
>
>I have a application that sends a "keep-a-live" message to tomcat (with a
>sessionID).  I wrote a session tracker to retrieve the already created
>session (via an earlier web-page request)
>
>When I our servlet receives the keep-a-live message it retrieves the
>session and must mark it as having been accessed.
>
>I have looked through the tomcat source and what I really need to do is to
>access the "ServerSession.touch(long)" method. This is protected within
>"HttpSessionFacade" class.
>
>Is there any other way to do this?
>
>Thanks,
>Jay
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: forwarding across contexts?

2004-05-11 Thread Shapira, Yoav

Hi,

>Is there a way, within a single context, to separate out
>the static content to some other file system location.

Of course, there are many ways, none of them advised.  You want to keep
your webapp as a whole, that's the whole point of a WAR file.  You can
symlink (at the filesystem level) or use normal HTTP linking to access
your static content.  But you can't symlink in a WAR, so...

>I believe that Yoav's suggestion is that I set up the empty
>path ("") context for this purpose. However, this is where
>I started, and Justin argued against this "cross-context"
>approach.

And I agree with Justin, just to be clear.  I wasn't advocating anything
different from what he said, just showing you that it can technically be
done.  If crossContext forwards are the worst design choices on this
list, we'll be in great shape.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Filter on url example - Filter out hack attempts

2004-05-11 Thread Shapira, Yoav

Hi,

>First of this is not a Tomcat question.  This type of information is
>always available at http://java.sun.com or http://forum.java.sun.com/

Right, but we do encourage general servlet and JSP related discussions
here too.

>> So from what I know so far my
>> /usr/local/tomcat/webapps/myapplication/WEB-INF/web.xml should look
>> like the
>> following:
>>
>> 
>>   
>> UrlFilter
>> UrlFilter *Don't know how this
should
>> layout.*
>>   
>>
>>   
>> UrlFilter
>> /*
>>   

That's fine.  I'd suggest you put your UrlFilter in a package, e.g.
com.yourclasses.UrlFilter, and change the filter-class accordingly.

>> Do I then create
>>
/usr/local/tomcat/webapps/myapplication/WEB-INF/classes/URLFilter.java?

Sure.  For general help on the source and deployment organization of a
webapp, see
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/index.html.

>>  private boolean allow(String uri) {
>>  // Look up allowed urls in a DB, Collection, whatever
>>
>>SubstringTest = False;
>> SubstringTest = string.indexOf("GET / HTTP/1.1") > 0;

Make sure you understand what a request URI is for the HTTP protocol.
It will have neither the GET (method name) nor the protocol spec
(HTTP/1.1 above).  Read and understand the JavaDocs for the
HttpServletRequest interface completely.

Yoav Shapira




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Looking for debug solutions

2004-05-11 Thread Shapira, Yoav

Hi,
Ask on a linux list: this has much more to do with how the process
listings work in your RH9 kernel and utilities than it does with tomcat.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Randy [mailto:[EMAIL PROTECTED]
>Sent: Monday, May 10, 2004 8:51 PM
>To: 'Tomcat Users List'
>Subject: Looking for debug solutions
>
>Hello,
>
>I have just recently built two new boxes. They are exhibiting some
strange
>behavior and I am unsure how to troubleshoot. I am looking for some
>suggestions.
>
>My old config that ran forever was
>RH7, apache 1.3, mod_jk and tomcat 4.0
>
>My two new boxes are
>Box 1) rh9, apache 2, mod_jk and tomcat 4.1.30
>Box 2) rh9, apache 2, mod_jk2 and tomcat 5.0.19
>
>The problem I am seeing, that my httpd and tomcat count continually
rise.
>That is not to say they never go down.
>
>Like currently :
>Box 1) httpd = 71 and java = 90
>Box 2) httpd = 51 and java = 111
>
>One more thing. These are both "Real Servers - LVS terms". They are
part of
>a Linux Virtual System.  Currently they are not sharing sessions, but
that
>is why box 2 is tomcat 5. I am heading that way.
>
>Box 1 can handle everything fine, if I shut down box 2.
>
>I am not sure if this is making any sense at all. There is really
nothing
>in
>the log files (except I run out of java mem) but that is when I get
over
>250
>httpd processes.
>
>Thanks for anyhelp or any direction in how to debug this
>
>Randy
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Multihosting in tomcat

2004-05-11 Thread Shapira, Yoav

Hi,
Good luck ;)

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Michal Kwiatek [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, May 11, 2004 3:42 AM
>To: [EMAIL PROTECTED]
>Subject: Multihosting in tomcat
>
>Hello all!
>
>I have to set up a multihosting service based on tomcat. What I mean by
>multihosting is that many people are able to deploy their web
>application on the server. The problem is that the applications can be
>badly written (for instance can contain unfinite loops) and thus cause
>the server to go down on resources and crash.
>
>I need a solution for:
> (1) identifing applications consuming to much resources,
> (1) killing them.
>
>I know that it is possible to programatically stop a web application
>deployed on Tomcat. But will it work if Tomcat gets low on resources?
>And how will I know which application to stop in the first place?
>Needless to say, it has to be done automatically.
>
>Thanks very much,
>Michal.
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: Filter on url example - Filter out hack attempts

2004-05-11 Thread Nathan Maves
First of this is not a Tomcat question.  This type of information is 
always available at http://java.sun.com or http://forum.java.sun.com/

To answer your questionYes.  in-fact you can place the class where 
ever you want as long as it is in your classpath.  Of course you will 
also have to change the  attribute accordingly.

Nathan
On May 11, 2004, at 7:42 AM, lrnobs wrote:
Yoav,

So from what I know so far my
/usr/local/tomcat/webapps/myapplication/WEB-INF/web.xml should look 
like the
following:


  
UrlFilter
UrlFilter *Don't know how this should
layout.*
  
  
UrlFilter
/*
  
  
index.jsp
index.html
  

Do I then create
/usr/local/tomcat/webapps/myapplication/WEB-INF/classes/URLFilter.java?
 public class UrlFilter implements Filter {
   ...
   public void doFilter(...) {
 if(req instance of HttpServletRequest) {
   HttpServletRequest hreq = (HttpServletRequest) req;
   String uri = hreq.getRequestURI();
   if(allow(uri)){
 chain.doFilter(req, res);
   } else {
...Send to Null
 // Do whatever: error page, redirect, etc.
   }
 } else {
   // Non-HTTP requests
   chain.doFilter(req, res);
 }
   }
 private boolean allow(String uri) {
 // Look up allowed urls in a DB, Collection, whatever
   SubstringTest = False;
SubstringTest = string.indexOf("GET / HTTP/1.1") > 0;
 if(SubstringTest = True) return True;
 Do the same for the rest
 //GET / HTTP/1.0 //page1.jsp //page2.jsp //page3.jsp
//page4.jsp //page5.jsp //graphic1.gif //graphic2.gif
 } }
Thanks,

Larry Nobs









Hi,
This is a trivial filter:
public class URLFilter implements Filter {
  ...
  public void doFilter(...) {
if(req instance of HttpServletRequest) {
  HttpServletRequest hreq = (HttpServletRequest) req;
  String uri = hreq.getRequestURI();
  if(allow(uri)){
chain.doFilter(req, res);
  } else {
// Do whatever: error page, redirect, etc.
  }
} else {
  // Non-HTTP requests
  chain.doFilter(req, res);
}
  }
private boolean allow(String uri) {
 // Look up allowed urls in a DB, Collection, whatever
}
}
I omitted full prototype declarations above due to laziness.  It's the
javax.servlet.Filter interface.
Take a look at the balancer webapp that ships with tomcat 5.  The
URLStringMatchRule is pretty close to what you want, and can be easily
extended with a list of allow patterns and/or deny patterns.  Tomcat 
has
something similar as the base Valve for the RemoteAddr/RemoteHost
valves.

Yoav Shapira
Millennium Research Informatics

-Original Message-
From: lrnobs [mailto:[EMAIL PROTECTED]
Sent: Saturday, May 08, 2004 9:11 PM
To: Tomcat Users List
Subject: Filter on url example - Filter out hack attempts
I have had no luck Googling so far for an example on how to filter
based on
urls.

I thought I might put this in the AccessLogValve but will do whatever
works.
I have a limited number of jsp's and graphics on my site and would 
like
to
filter out all of the hack attempts that fill up my logs.

I would like to do something like this (in plain english)

Accept
GET / HTTP/1.1
GET / HTTP/1.0
*page1.jsp*
*page2.jsp*
*page3.jsp*
*page4.jsp*
*page5.jsp*
*graphic1.gif*
*graphic2.gif*
Drop All Other Requests - they are just hack attempts

Thanks,

Larry Nobs



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




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, 
proprietary
and/or privileged.  This e-mail is intended only for the individual(s) 
to
whom it is addressed, and may not be saved, copied, printed, disclosed 
or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


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






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


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


RE: forwarding across contexts?

2004-05-11 Thread Fred Toth
Thanks once again. This is very helpful.

Now here's what I really want (it never ends, does it):

Is there a way, within a single context, to separate out
the static content to some other file system location.
I'd like to be able to deploy my war file with library jars,
configuration info, classes, etc., into the "safe" location within
the jboss deploy directory.
But, I'd like to have all of my static content (again, "/images/whatever.gif")
elsewhere on the file system.
I believe that Yoav's suggestion is that I set up the empty
path ("") context for this purpose. However, this is where
I started, and Justin argued against this "cross-context"
approach.
So is there a way to accomplish this separation within
a single context?
Many, many thanks. It's amazing how, even with a stack
of books and google and jakarta and all, there's no substitute
for talking with people.
Fred

At 07:37 AM 5/11/2004, you wrote:

Hi,

>In short, how does one deploy a war file such that it looks
>for content ("/images/whatever.gif") in a configurable location
>in the file system?
Configure the server to serve that WAR file with a context path of ""
(the empty string).  This can be done in tomcat in three ways:
- Add a Context entry in conf/server.xml whose path="" and docBase is
your WAR
- Add an xml file with the Context tag to conf/[engine name]/[host name]
(same path and docBase)
- Put same XML file as above in your WAR file's META-INF directory
instead of under the conf directory (tomcat 5 only).
Yoav Shapira



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for the 
individual(s) to whom it is addressed, and may not be saved, copied, 
printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your 
computer system and notify the sender.  Thank you.

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


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


Re: Filter on url example - Filter out hack attempts

2004-05-11 Thread lrnobs
Yoav,

So from what I know so far my
/usr/local/tomcat/webapps/myapplication/WEB-INF/web.xml should look like the
following:


  
UrlFilter
UrlFilter *Don't know how this should
layout.*
  

  
UrlFilter
/*
  

  
index.jsp
index.html
  



Do I then create
/usr/local/tomcat/webapps/myapplication/WEB-INF/classes/URLFilter.java?


 public class UrlFilter implements Filter {
   ...
   public void doFilter(...) {
 if(req instance of HttpServletRequest) {
   HttpServletRequest hreq = (HttpServletRequest) req;
   String uri = hreq.getRequestURI();
   if(allow(uri)){
 chain.doFilter(req, res);
   } else {
...Send to Null
 // Do whatever: error page, redirect, etc.
   }
 } else {
   // Non-HTTP requests
   chain.doFilter(req, res);
 }
   }

 private boolean allow(String uri) {
 // Look up allowed urls in a DB, Collection, whatever

   SubstringTest = False;
SubstringTest = string.indexOf("GET / HTTP/1.1") > 0;
 if(SubstringTest = True) return True;
 Do the same for the rest
 //GET / HTTP/1.0 //page1.jsp //page2.jsp //page3.jsp
//page4.jsp //page5.jsp //graphic1.gif //graphic2.gif
 } }

Thanks,

Larry Nobs









>
> Hi,
> This is a trivial filter:
> public class URLFilter implements Filter {
>   ...
>   public void doFilter(...) {
> if(req instance of HttpServletRequest) {
>   HttpServletRequest hreq = (HttpServletRequest) req;
>   String uri = hreq.getRequestURI();
>   if(allow(uri)){
> chain.doFilter(req, res);
>   } else {
> // Do whatever: error page, redirect, etc.
>   }
> } else {
>   // Non-HTTP requests
>   chain.doFilter(req, res);
> }
>   }
>
> private boolean allow(String uri) {
>  // Look up allowed urls in a DB, Collection, whatever
> }
> }
>
> I omitted full prototype declarations above due to laziness.  It's the
> javax.servlet.Filter interface.
>
> Take a look at the balancer webapp that ships with tomcat 5.  The
> URLStringMatchRule is pretty close to what you want, and can be easily
> extended with a list of allow patterns and/or deny patterns.  Tomcat has
> something similar as the base Valve for the RemoteAddr/RemoteHost
> valves.
>
> Yoav Shapira
> Millennium Research Informatics
>
>
> >-Original Message-
> >From: lrnobs [mailto:[EMAIL PROTECTED]
> >Sent: Saturday, May 08, 2004 9:11 PM
> >To: Tomcat Users List
> >Subject: Filter on url example - Filter out hack attempts
> >
> >I have had no luck Googling so far for an example on how to filter
> based on
> >urls.
> >
> >I thought I might put this in the AccessLogValve but will do whatever
> >works.
> >
> >I have a limited number of jsp's and graphics on my site and would like
> to
> >filter out all of the hack attempts that fill up my logs.
> >
> >I would like to do something like this (in plain english)
> >
> >Accept
> >GET / HTTP/1.1
> >GET / HTTP/1.0
> >*page1.jsp*
> >*page2.jsp*
> >*page3.jsp*
> >*page4.jsp*
> >*page5.jsp*
> >*graphic1.gif*
> >*graphic2.gif*
> >
> >Drop All Other Requests - they are just hack attempts
> >
> >Thanks,
> >
> >Larry Nobs
> >
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>



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



  1   2   >