Re: Tomcat 6 and javamail

2008-11-25 Thread Rainer Frey
On Tuesday 25 November 2008 15:09:54 Lyallex wrote:
> Hello again
>
> 2008/11/19 Don Millhofer <[EMAIL PROTECTED]>:
> > Are you sure that the mail server, serving the host you are deploying to
> > does not require authentication?  I got this same error trying to go
> > through the Google Mail Server without proper authentication.
>
> I am absolutely sure that the mail server I am using for the
> standalone test is the same one that I am using for the tomcat server.

This is no answer to above question.

> I tried setting mail.smtp.auth = true and the send failed in Eclipse,
> the debug output was exactly the same as when I run the code
> in Tomcat Authentication failure

Are you running Tomcat on the same machine as Eclipse? The mail server may 
require authentication for some machines, but not for others

>
> I then hardcoded properties.put("mail.smtp.auth", "false"); in the
> MailServer constructor  and ran the Eclipse test, it worked, so I ran
> it in Tomcat and it failed with Authentication exception 
>
> In the MailServer constructor I do the following
>
> properties = System.getProperties();
> ...
> properties.put("mail.smtp.auth", "false");
>
> so it looks like a different properties bundle is being used when I
> run this in Tomcat ... does any of this make sense ??

Tomcat does not automagically change your code. If this is passed in your 
code, it is used.

> > You say in Eclipse you use -  (mail.smtp.auth = false) and sends the
> > email.  Try sending authentication.
> >
> >private class SMTPAuthenticator extends javax.mail.Authenticator {
> >@ Override
> >public PasswordAuthentication getPasswordAuthentication() {
> >return new PasswordAuthentication(d_email, d_password);
> >}
> >}

Did you try that? If the mail server says it wants authentication, it's no use 
forcing JavaMail to not authenticate.

>
> Thanks
> lyallex

Rainer

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Updating users

2008-11-25 Thread Caldarale, Charles R
> From: Prastein, Rebeccah H
> [mailto:[EMAIL PROTECTED]
> Subject: RE: Updating users
>
> There must be a way - Managing users is one of the things
> that the admin webapp does.

The admin webapp had access to Tomcat's internal structures, but it has been 
dropped due to bugginess and lack of developer interest.  Using its source code 
will not be portable, not even to later versions of Tomcat, let alone across 
containers.

You could implement your own simple  that persists the updates and 
handles the authentication calls, or you could try this:
http://securityfilter.sourceforge.net/

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Updating users

2008-11-25 Thread Prastein, Rebeccah H
There must be a way - Managing users is one of the things that the admin
webapp does.  Maybe take a look at its source code?  BTW, The admin
webapp doesn't come with the default installation of tomcat any more,
you have to download and install it separately.

Rebeccah 

-Original Message-
From: Cliff Binstock [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 25, 2008 6:16 PM
To: 'Tomcat Users List'
Subject: Updating users

I have one servlet that registers a new user.  The result of this is an
update of conf/tomcat-users.xml

I have an almost out-of-the-box WebdavServlet that requires user
authorization.

The users appear to be cached by Tomcat, and the "new" user can't access
the webdav area until Tomcat is restarted.

Is there a way to refresh/flush the Tomcat cache?  After much searching,
this appears to be a Tomcat limitation, but I find it hard to believe
that this isn't a commonly desired scenario.

Thanks in advance for any assistance,

Cliff


-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
The contents of this message, together with any attachments, are
intended only for the use of the person(s) to which they are
addressed and may contain confidential and/or privileged
information. Further, any medical information herein is
confidential and protected by law. It is unlawful for unauthorized
persons to use, review, copy, disclose, or disseminate confidential
medical information. If you are not the intended recipient,
immediately advise the sender and delete this message and any
attachments. Any distribution, or copying of this message, or any
attachment, is prohibited.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Updating users

2008-11-25 Thread Hassan Schroeder
On Tue, Nov 25, 2008 at 6:16 PM, Cliff Binstock
<[EMAIL PROTECTED]> wrote:
> I have one servlet that registers a new user.  The result of this is an
> update of conf/tomcat-users.xml

> The users appear to be cached by Tomcat, and the "new" user can't access the
> webdav area until Tomcat is restarted.

Uh, yeah. Exactly what it says here:
 

:: along with "not designed for production use".  :-)

Check that page for alternatives.

FWIW,
-- 
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Updating users

2008-11-25 Thread Cliff Binstock
I have one servlet that registers a new user.  The result of this is an
update of conf/tomcat-users.xml

I have an almost out-of-the-box WebdavServlet that requires user
authorization.

The users appear to be cached by Tomcat, and the "new" user can't access the
webdav area until Tomcat is restarted.

Is there a way to refresh/flush the Tomcat cache?  After much searching,
this appears to be a Tomcat limitation, but I find it hard to believe that
this isn't a commonly desired scenario.

Thanks in advance for any assistance,

Cliff


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Http]ServletResponseWrapper.getOutputStream()

2008-11-25 Thread Michael Ludwig
I forgot two important lines; explanation in other posts on this thread.

Michael Ludwig schrieb am 26.11.2008 um 02:14:58 (+0100):
>  public ServletOutputStream getOutputStream() throws IOException {
getResponse().getOutputStream();
>   return stream;
>  }
> 
>  public PrintWriter getWriter() throws IOException {
getResponse().getWriter();
>   return writer;
>  }

Michael Ludwig

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [Http]ServletResponseWrapper.getOutputStream()

2008-11-25 Thread Caldarale, Charles R
> From: Michael Ludwig [mailto:[EMAIL PROTECTED]
> Subject: Re: [Http]ServletResponseWrapper.getOutputStream()
>
> Why exactly would the output methods have to be synchronized?

They don't, unless you've got a weird webapp that itself creates multiple 
threads that generate output.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Re: Tomcat 6 unstable

2008-11-25 Thread Caldarale, Charles R
> From: Michael Ludwig [mailto:[EMAIL PROTECTED]
> Subject: Re: Re: Tomcat 6 unstable
>
> I don't think the file URI scheme without a hostname translates
> into a network request. For what would be the protocol used for
> such a request?

SMB for Windows, SMB or NFS for Linux.  Try putting 
file://[host]/[share]/[file] in an IE address bar.  (Firefox handles the 
file:// protocol somewhat erratically.)

> The file URL scheme is unusual in that it does not specify an
> Internet protocol or access method for such files; as such, its
> utility in network protocols between hosts is limited.
> -- http://www.rfc-editor.org/rfc/rfc1738.txt 3.10 FILES

The above is true in that there's no current standard, but file:// is often 
used.  There's also an smb:// RFC that's been submitted to IETF, don't know if 
or when that will be approved.

> But catalina.properties does not contain any admonitions
> to that effect.

Nor does the Tomcat source code; in either case, you better know what you're 
doing and have good reason to make changes.

> You should be tidy and close all your database objects
> *including* the connection.

It's not just being tidy - it's required.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Http]ServletResponseWrapper.getOutputStream()

2008-11-25 Thread Michael Ludwig
Christopher Schultz schrieb am 25.11.2008 um 09:31:17 (-0500):
> Michael Ludwig wrote:
> > Your argument in favour of the unified buffer sounds perfectly
> > logical to me. In the end, it's all bytes that get written,
> > regardless of whether or not I wrap a PrintWriter around the buffer.
> 
> There's always the case that some output has been written before your
> filter has been called. In that case, you have to make sure that your
> output goes to the correct place.

It's not at my discretion to decide where my output should go. Filter or
servlet, I try calling getWriter() or getOutputStream(), and if it that
throws an exception, I call the other. I am unaware of whether what I'm
writing to is the real thing or just a fake an upstream filter has
supplanted. I'm only responsible for things happening downstream. Sort
of like in real life.

Is this thinking flawed?

> That may mean turning your Writer contents into an OutputStream, or
> vice-versa. I think it's simpler to wrap whichever object the caller
> is actually requesting.

But can it be simpler than this:

package milu;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HttpResponseCatcher extends HttpServletResponseWrapper {
 private OutputStream buffer;
 private CapturedServletOutputStream stream;
 private PrintWriter writer;

 public HttpResponseCatcher( HttpServletResponse res) {
  super( res);
  this.buffer = new ByteArrayOutputStream();
  this.stream = new CapturedServletOutputStream( this.buffer);
  this.writer = new PrintWriter( new OutputStreamWriter( this.stream));
 }

 public ServletOutputStream getOutputStream() throws IOException {
  getResponse().getOutputStream();
  return stream;
 }

 public PrintWriter getWriter() throws IOException {
  getResponse().getWriter();
  return writer;
 }

 public String getCapturedOutput() { return buffer.toString(); }
 public byte[] getByteArray() { return buffer.toString().getBytes(); }
 public char[] getCharArray() { return buffer.toString().toCharArray(); }
}

> > I agree: You never know. And who knows what stuff gets set or
> > tweaked in Tomcat's internals for each one of getWriter() and
> > getOutputStream(). On the other hand, I haven't found any statement
> > to the effect that you have to pass through the calls to the
> > underlying response object.
> 
> No, you don't have to do this, but the benefit of doing it is that you
> have the wrapped request enforcing the "call either getWriter or
> getInputStream" requirement.

Looks like, yes, I *have* to call getWriter() and getOutputStream() on
the underlying object (and so, ultimately, on the real object, at the
end of the chain), in order to get *correct* behaviour in all scenarios,
including the one discussed here:

* static HTML file served by Tomcat's DefaulServlet
* no flush() prior to include()
* PrintWriter used, not ServletOutputStream

Michael Ludwig

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Http]ServletResponseWrapper.getOutputStream()

2008-11-25 Thread Michael Ludwig
Martin Gainty schrieb am 22.11.2008 um 12:02:36 (-0500):
> 
> i agree with the unified buffer but i would also make sure all your
> output methods are synchronized

Thanks for your feedback, Martin.

Why exactly would the output methods have to be synchronized? The
request and response objects aren't shared between requests, and a new
instance of a subclass of HttpServletResponseWrapper is created for each
request. And this has no static mutable data. So why synchronized?

> follow the advice on Writers for incorporating charsets
> and implement encodings
> http://java.sun.com/j2se/1.4.2/docs/api/java/io/OutputStreamWriter.html

It currently looks like this (in case you want to comment):

package milu;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HttpResponseCatcher extends HttpServletResponseWrapper {
 private OutputStream buffer;
 private CapturedServletOutputStream stream;
 private PrintWriter writer;

 // constructor
 public HttpResponseCatcher( HttpServletResponse res) {
  super( res);
  this.buffer = new ByteArrayOutputStream();
  this.stream = new CapturedServletOutputStream( this.buffer);
  this.writer = new PrintWriter( new OutputStreamWriter( this.stream));
 }

 public ServletOutputStream getOutputStream() throws IOException {
  return stream;
 }

 public PrintWriter getWriter() throws IOException {
  return writer;
 }

 public String getCapturedOutput() { return buffer.toString(); }
 public byte[] getByteArray() { return buffer.toString().getBytes(); }
 public char[] getCharArray() { return buffer.toString().toCharArray(); }
}

Michael Ludwig

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Re: Tomcat 6 unstable

2008-11-25 Thread Michael Ludwig
Caldarale, Charles R schrieb am 25.11.2008 um 17:00:24 (-0600):
> > From: Michael Ludwig [mailto:[EMAIL PROTECTED]
> > Subject: Re: Re: Tomcat 6 unstable
> >
> > I've read somewhere that omitting the file:/// URI scheme is wrong.
> > However, it seems to work. At least on Windows. In order to be on
> > the safe side, you should add the "file:///" URI scheme.
> 
> No, you shouldn't.  (Note that the existing settings do not use it.)

My copy of catalina.properties (Tomcat 6.0.18) contains the following
instruction for modification of the "shared.loader":

Please note that for single jars, e.g. bar.jar,
you need the URL form starting with file:.

Anyway, sorry if I've spread misleading information. I had picked this
usage of not only plain "file:", but full-blown "file://" up somewhere
and, lack of prior experience, given it credence. I see it used in some
places, but of course, just because you're blogging on Java from
underneath SUN.com doesn't mean you're infallible.

Miles to go ...: Metro on Tomcat 6.x
http://blogs.sun.com/arungupta/entry/metro_on_tomcat_6_x

> Such a reference turns the local file request into a network one
> rather than a direct reference to the local file system.  The empty
> host name (between the second and third slashes) indicates the file
> should be served by localhost

I don't think the file URI scheme without a hostname translates into a
network request. For what would be the protocol used for such a request?

> and the JRE may be smart enough to short-ciruit the network

Hopefully! This is very vague anyway, and admittedly so:

The file URL scheme is unusual in that it does not specify an
Internet protocol or access method for such files; as such, its
utility in network protocols between hosts is limited.
-- http://www.rfc-editor.org/rfc/rfc1738.txt 3.10 FILES

> but regardless, you're adding unnecessary overhead.

I agree. There are (XML) technologies which are designed to be
filesystem-agnostic, and these may require you to use a file URI
instead of a good old pathname, so I may well have been misled.

> In any event, you shouldn't be modifying the classloader settings
> without an extremely good reason.

I believe you. But catalina.properties does not contain any admonitions
to that effect. On the contrary, it contains instructions on how to
proceed in order to modify the classloader settings.

> > If your connection is closed, either explicitly or implicitly
> > by going out of scope, all objects derived from it are also
> > closed.
> 
> Connections do not close when they go out of scope.  They *may* get
> closed when a garbage collection occurs, but you should never write
> code that depends on that happening (it may never happen).

True - I should have known better.

> It is absolutely critical to explicitly close result sets, statements,
> and connections; this is best done by placing all data base access
> inside try/finally blocks and doing the close operations in the
> finally part.

Yes.

> > The whole point of the pool, however, is to *not* close the
> > connection.
> 
> Correct.  But what the pool gives you is a wrapper for the actual
> connection object, and failing to close that means it doesn't get back
> into the pool, resulting in an empty one after a bit.

True - I should have been more explicit. You should be tidy and close
all your database objects *including* the connection.

Thanks for all clarifications and corrections.

Michael Ludwig

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Threadpool doesn't contain any threads

2008-11-25 Thread Caldarale, Charles R
> From: Gattu, Praveen [mailto:[EMAIL PROTECTED]
> Subject: Threadpool doesn't contain any threads
>
> Did anyone else notice this issue. Another minor caveat is,
> we built Tomcat using JDK 1.5 but are running it on JDK 1.6.

Can't answer your primary question, but as for building Tomcat, it must be done 
on 1.5, but it will run properly on 1.5 or 1.6.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Threadpool doesn't contain any threads

2008-11-25 Thread Gattu, Praveen
Hi - I am noticing a weird issue with our Tomcat installation. Here is my 
production environment
Tomcat version - 5.5
JDK run time - 1.6
OS : Redhat Enterprise 3.0

Everyday we are noticing the tomcat not responding on a port. On further 
inspection we noticed that the thread pool that is serving this port has no 
threads. Right around the time tomcat goes into this state, we noticed that 
there is a thread death, and get the following stack trace

org.apache.tomcat.util.threads.ThreadPool: Caught exception 
(java.lang.ThreadDeath) executing 
org.apache.tomcat.util.net[EMAIL PROTECTED],
terminating thread { java.lang.ThreadDeath | at 
org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:488)
 | at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:73)
 | at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:746)
 | at java.lang.Thread.run(Thread.java:619) }

After this the thread pool never gets started again. I see that this exception 
is essentially thrown in PoolTcpEndpoint's acceptSocket function, when the 
function encounters IOException accepting connections on the socket.

Did anyone else notice this issue. Another minor caveat is, we built Tomcat 
using JDK 1.5 but are running it on JDK 1.6. Could this be causing any issue?

Also I used Jconsole and noticed that currentThreadBusy and currentThreadCount 
are both -1.

If anyone can think of any pointers please let me know.

Thanks for any help,
Praveen



RE: Re: Tomcat 6 unstable

2008-11-25 Thread Caldarale, Charles R
> From: Michael Ludwig [mailto:[EMAIL PROTECTED]
> Subject: Re: Re: Tomcat 6 unstable
>
> I've read somewhere that omitting the file:/// URI scheme is wrong.
> However, it seems to work. At least on Windows. In order to be on the
> safe side, you should add the "file:///" URI scheme.

No, you shouldn't.  (Note that the existing settings do not use it.)  Such a 
reference turns the local file request into a network one rather than a direct 
reference to the local file system.  The empty host name (between the second 
and third slashes) indicates the file should be served by localhost and the JRE 
may be smart enough to short-ciruit the network, but regardless, you're adding 
unnecessary overhead.

In any event, you shouldn't be modifying the classloader settings without an 
extremely good reason.

> If your connection is closed, either explicitly or implicitly
> by going out of scope, all objects derived from it are also
> closed.

Connections do not close when they go out of scope.  They *may* get closed when 
a garbage collection occurs, but you should never write code that depends on 
that happening (it may never happen).

It is absolutely critical to explicitly close result sets, statements, and 
connections; this is best done by placing all data base access inside 
try/finally blocks and doing the close operations in the finally part.

> The whole point of the pool, however, is to *not* close the
> connection.

Correct.  But what the pool gives you is a wrapper for the actual connection 
object, and failing to close that means it doesn't get back into the pool, 
resulting in an empty one after a bit.

 -Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Re: Tomcat 6 unstable

2008-11-25 Thread Michael Ludwig
Jabali Acuatico schrieb am 24.11.2008 um 18:02:23 (-0800):
> I read the link you posted me, but the comments in the
> catalinal.properties has no example with "file:///" so I did not write
> like this. I added to this line the path to the db2 jdbc driver. The
> current sentence is this one:
> common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar,/opt/java/jdk/jre/lib/ext/*.jar
> 
> ¿Is this right or do I need to include "file:///"?

I've read somewhere that omitting the file:/// URI scheme is wrong.
However, it seems to work. At least on Windows. In order to be on the
safe side, you should add the "file:///" URI scheme.

> > 2) About an earlier Tomcat: I just downloaded the 6.0.18 version and
> > catalina.sh it's running ok (but I have not put my webapp there
> > yet). 
> 
> Careful! :-)
> I did that because one of you recommend me to do that.  Why do you
> say careful?

Not to be taken seriously. Your web app and container configuration
editing seemed to have the potential of ridding the container of the
Servlet API (like the car of its wheels), so I said "careful", but I
didn't mean it.

> Thanks for all. Now I need to learn how to do a pooling of
> connections. Any comments?

Read the documentation for Tomcat 6:

http://localhost:8080/docs/jndi-resources-howto.html
http://localhost:8080/docs/jndi-datasource-examples-howto.html

Read the documentation for DBCP, which is the connection pooling
implementation Tomcat 6 uses as of now:

http://commons.apache.org/dbcp/configuration.html

Configure the resource in "conf/context.xml".

 

Initially, you don't need to configure the pool. You can accept the
defaults for initialSize, maxActive, maxIdle, minIdle and maxWait.

Then refer to the JNDI name in your application like so:

DataSource ds = null;
try {
Context initCtxt = new InitialContext();
Context envCtxt = (Context) initCtxt.lookup("java:comp/env");
ds = (DataSource) envCtxt.lookup("jdbc/firebird/test");
}
catch ( NamingException ne ) {
...
}
Connection conn = ds.getConnection();
...

As the Tomcat documentation says, it is important to explicitly close
result sets and statements. Why is this important?

If your connection is closed, either explicitly or implicitly by going
out of scope, all objects derived from it are also closed. (That's how
drivers are implemented so they're not too complicated to use.)

The whole point of the pool, however, is to *not* close the connection.
So no automatic tidying up is going to happen: you have to do it
yourself.

Michael Ludwig

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Re: Tomcat 6 unstable

2008-11-25 Thread Michael Ludwig
Caldarale, Charles R schrieb am 24.11.2008 um 21:51:33 (-0600):
> > From: Michael Ludwig [mailto:[EMAIL PROTECTED]
> 
> > Could web app Foo, which brings its own DB2 driver - in spite
> > of the same driver already offered by the common.loader or
> > the bootstrap.loader, by this very fact jeopardize other web
> > applications running in the same container, which rely on the
> > DB2 driver offered by the "common.loader"?
> >
> > Or would web app Foo only harm itself?
> 
> If an object originating in a webapp classloader is passed to code
> from a more global classloader, and then another webapp accesses that
> object, it will not be castable to any type the second webapp has
> access to. (Class myPackage.MyClass loaded by classloader A is not the
> same type as myPackage.MyClass loaded by classloader B.)

That's an interesting fact, and good to know.

The very fact that object leak from one web app into another is a
possibility seems to constitute a strong argument in favour of strict
monitoring, be it only to shield oneself from errors that might be
difficult to track down.

> > Does this mean web apps have to be monitored for the classes they
> > make available in order to make sure none of them has already been
> > made available via the common.loader?
> 
> If a webapp minds its own business, there shouldn't be a problem.  If
> it tries to use Tomcat's DB connection pooling (or logging, or some
> other shared mechanism), but insists on providing its own copy of the
> shared classes, then there are likely to be problems.  (This is a
> problem with servlet containers - not just Tomcat - because it breaks
> the standard Java classloading model of always delegating upwards.  As
> mentioned before, this breaking is pretty much required by the servlet
> spec.)

May I rephrase this into there being a duty for the Tomcat admin to
enforce none of the web apps loaded into his container supply a library
that the container itself already supplies?

Michael Ludwig

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: SingleThreadModel for servlets

2008-11-25 Thread Caldarale, Charles R
> From: Tony Anecito [mailto:[EMAIL PROTECTED]
> Subject: RE: SingleThreadModel for servlets
>
> The question I wanted answered was in general if current real
> life experience still holds true that the mutli-threaded
> single servlet model is still faster than one servlet per
> thread where the servlet is pooled.

For a properly written webapp, I doubt that you'll be able to measure much 
difference in CPU performance, other than the increased likelihood of operand 
cache misses when you have multiple active Servlet objects rather than just 
one.  There would be some increase in Java heap (and therefore RAM) usage as 
well, but given enough real memory that's not likely to be an issue.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



log4j FileAppenders not flushing

2008-11-25 Thread Prastein, Rebeccah H
I'm hoping someone here can help me with this; I've searched all over
the web, and any references to FileAppenders not flushing in the log4j
lists get the response, "not a log4j problem, must be your application."

I have a simple 3-page Spring 2.5 Spring MVC application running under
Tomcat 5.5.  I'm using log4j 1.2.14 for web application logging.  Rather
than configure log4j from a properties file or an xml file, I'm
configuring it manually in a servlet that allows me to reconfigure it in
real time using http commands.  I create two RollingFileAppenders: one
for the rootLogger containing debugging information, and one for a
separate requestLogger that shows input to and output from the
application.

Every time I send a query to the Spring MVC applciation, there should be
a series of log entries in the debug log, and one in the request log.
What I find is that sometimes the log entries show up right away, but
more often, one or the other log will show nothing until I have queried
3, 4, or up to 8 times - and then, all of the backlogged log entries
appear.  At first, I thought maybe my real-time configuration changes
were causing I/O blocking, because I first noticed it when I was testing
that feature.  But, even if I completely leave everything as it was on
web application startup, this happens.  I tried playing with the
settings on the RollingFileAppenders, even though by default IO
buffering is supposed to be off and immediateFlush is supposed to be
true.  I added a System.out.println() following one of my logging call
statements, to tell me what the immediateFlush value is for the logger
that was just written to, and it's "true," as expected.  But it's NOT
flushing.

Is there something in Tomcat that is intercepting these log4j calls and
causing this buffering behavior?  Is there some way to configure it?

Thanks for any help,

Rebeccah
--
The contents of this message, together with any attachments, are
intended only for the use of the person(s) to which they are
addressed and may contain confidential and/or privileged
information. Further, any medical information herein is
confidential and protected by law. It is unlawful for unauthorized
persons to use, review, copy, disclose, or disseminate confidential
medical information. If you are not the intended recipient,
immediately advise the sender and delete this message and any
attachments. Any distribution, or copying of this message, or any
attachment, is prohibited.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Setup Logging for Tomcat 6

2008-11-25 Thread André Warnier

Caldarale, Charles R wrote:

From: dOE [mailto:[EMAIL PROTECTED]
Subject: Re: Setup Logging for Tomcat 6

No further insight as to why Tomcat 6 is not logging "out-of
-the-box"?


Are you still using this "js-wrapper" thingie?  If so, no one will be 
interested.


To put this more diplomatically (and considerably more words) :

The js-wrapper is an application written by other people, and has 
nothing to do with Tomcat itself.  It can, or cannot, be "doing things" 
to intercept the standard Tomcat logging and send it somewhere else.
The people on this list answering Tomcat-related questions are not using 
js-wrapper, so they do not know if it does do something to the logfiles 
or not, and thus they cannot really help you.


The standard Tomcat packages for Windows, as downloaded from the Tomcat 
website, do write logfiles, in the (tomcat_install_dir)/logs directory. 
So they do logging "out-of-the-box".


Yours apparently does not, but the reason for that cannot be determined 
as long as you are running Tomcat under control of js-wrapper.
You should first either ask the supplier of js-wrapper what they are 
doing with the logs, or remove this Tomcat version, install a standard 
one, and then come back here if you have more questions.


Understand, this does not mean that js-wrapper is not a good product. It 
is just that it makes it difficult in this context to answer your questions.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Manager app language

2008-11-25 Thread André Warnier

Caldarale, Charles R wrote:

From: André Warnier [mailto:[EMAIL PROTECTED]
Subject: Re: Manager app language

Attached the page I get.


It got stripped off somewhere along the way.


In the official Tomcat, where is this page hidden ?


The manager pages in 5.5 are generated dynamically by servlets in:
  server/webapps/manager/WEB-INF/lib/catalina-manager.jar

Now that I look in there, I have to correct what I said previously: there are 
indeed German strings available for the manager messages, so something could 
have gotten switched.  Will have to look at the source code to see what 
triggers use of the LocalStrings_de.properties file.


Thanks.
Here is the page.
At least I'm sure this time that I attach it.
Grosse Bruder might still remove it though.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Setup Logging for Tomcat 6

2008-11-25 Thread dOE
Ok, thanks

On Tue, Nov 25, 2008 at 12:52 PM, Caldarale, Charles R <
[EMAIL PROTECTED]> wrote:

> > From: dOE [mailto:[EMAIL PROTECTED]
> > Subject: Re: Setup Logging for Tomcat 6
> >
> > No further insight as to why Tomcat 6 is not logging "out-of
> > -the-box"?
>
> Are you still using this "js-wrapper" thingie?  If so, no one will be
> interested.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: tomcat 6.0.18 clustering.. session getting replicated partially

2008-11-25 Thread rohit aman
Hey Filip,

sorry abt that. here is the example web application zip file:
http://www.yousendit.com/download/TTZuRFFhbEo5eFh2Wmc9PQ

please unzip it, put it in your webapps directory, then you should be able
to access the cart using
https:///clusterex/sessions/carts.jsp


juss FYI...this is how u can reproduce it
1) set the LB for sticky sessions
2) start tomcat1
3) access the cart and add some items (lets say 6 items)
4) now start tomcat2
5) add some more items ( lets say 3 more...so total items would be 6+3=9)
(here request still goes to tomcat 1 because of sticky sessions setup)
6) stop tomcat1
7) add some more items (now request goes to tomcat2, here we can see that
the new item gets added as 7th item to the first 6 items and the 3 items we
added later can not be seen)

Thanks for the help
rohit

On Tue, Nov 25, 2008 at 10:20 AM, Filip Hanik - Dev Lists <
[EMAIL PROTECTED]> wrote:

> you're attachment didn't go through, just post a complete example somewhere
> on the web.
> for free support, you can't expect the other guy (me in this case) to have
> to spend time setting up to replicate your environment
> instead, you do the legwork, and you get help for free, not a bad trade if
> you ask me
> Filip
>
> rohit aman wrote:
>
>> Hi Filip,
>> All I did was to modify sessions application that comes with tomcat.
>> It's just two simple changes shown below.
>>
>>   1) Replace the DummCart.class in
>> \apache-tomcat-6.0.18\webapps\examples\WEB-INF\classes\sessions
>> with the attached one.
>>   2)mark the web.xml in
>> \apache-tomcat-6.0.18\webapps\examples\WEB-INF as distributable
>> by adding  tag
>>   3)then access this by using
>> https://localhost/examples/jsp/sessions/carts.jsp
>>
>> Please let me know...Thanks for doing this
>> Rohit
>>
>>  On Mon, Nov 24, 2008 at 6:55 PM, Filip Hanik - Dev Lists <
>> [EMAIL PROTECTED] > wrote:
>>
>>post a sample app, and we can test it out
>>
>>Filip
>>
>>
>>rohit aman wrote:
>>
>>Hi,
>>
>>  I had setup a tomcat cluster with two nodes. followed the
>>instructions
>>from "tomcat 6 clustering how to" document. I created a sample
>>application to test out my cluster.  This application has a
>>cart where u can
>>add items.
>>
>>now, the problem is, not all session variables are getting
>>replicated. below
>>is the scenario..
>>
>>1)start tomcat 1
>>2)access the cart add items to it ( lets say added 5 items )
>>3)start tomcat 2
>>4)add some more items ( 3 more...so totally 8) ( this is done
>>using tomcat 1
>>again because my LB is configured for sticky sessions)
>>5)stop tomcat 1
>>6)access the cart (now the request goes to tomcat 2)...here *I
>>can only see
>>the first 5 items where as it should be 8. *So, the next three
>>did not get
>>replicated.
>>
>>whichever session or session attribute gets created when both
>>nodes are
>>running is not getting replicated for some reason.
>>
>>I am monitoring both nodes with Jconsole. In Jconsole the
>>number of session
>>for the application =  sessions in node 1 + sessions in node
>>2. So, this
>>says that sessions are being replicated. But, I am not sure
>>why I am not
>>able to access all sessions/sessionAttributes.
>>
>>Any help is very much appreciated.
>>
>>Thanks
>>Rohit
>>
>>
>>
>>
>>-
>>To start a new topic, e-mail: users@tomcat.apache.org
>>
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>> 
>>
>> -
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: j_secuity check and https

2008-11-25 Thread Snaglefrac

I have an tomcat application. I want to use LDAP authentication. I have this
working not problem.

When a user hits the site they are asked to login and they use the
j_security method to do so. No problem. 

Now, when someone logs in they are using an unsecured login screen and there
passwords are sent unencrypted. The solution! HTTPS, no sweat, i have this
working to. The only problem I have is having the https and LDAP security in
one application. Additionally i do not want to have every page locked by
https, only the login screen that get called by the security constraint.

EX directory structure:
Https Secured pages and directories.
/security/login.jsp
/security/loginerr.jsp

LDAP REalm Secured diretories
/gigatronic/*
/gigatronic/index.jsp

so when a user hits /gigatronic/index.jsp they are asked top login because
of the LDAP real copnfig. The pages used for the login I need in HTTPS.
After a secure login it returns back to a regular http for the 
/gigatronic/index.jsp application.

SO how can I use HTTPS for only the j_secutity login portion I specified in
web.xml and enforce LDAP real  for the rest of my app without have the whole
app HTTPS.

I tried specifying the HTTPS for my login but the app would not start.
ex:


https://www.blah.com/secure/login.jsp

https://www.blah.com/secure/loginerr.jsp

This did not work.

Cheers


-- 
View this message in context: 
http://www.nabble.com/j_secuity-check-and-https-tp20603453p20686814.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: SingleThreadModel for servlets

2008-11-25 Thread Tony Anecito
Hi Charles,

Thanks for the prompt answer. I was only giving an example. The question I 
wanted answered was in general if current real life experience still holds true 
that the mutli-threaded single servlet model is still faster than one servlet 
per thread where the servlet is pooled.

Thanks,
-Tony


--- On Tue, 11/25/08, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:

> From: Caldarale, Charles R <[EMAIL PROTECTED]>
> Subject: RE: SingleThreadModel for servlets
> To: "Tomcat Users List" 
> Date: Tuesday, November 25, 2008, 10:58 AM
> > From: Tony Anecito [mailto:[EMAIL PROTECTED]
> > Subject: SingleThreadModel for servlets
> >
> > Reason I ask is if you have a slow service using the
> > multithreaded servlet it might be a bad idea
> especially
> > if there is synchronous methods used anywhere in the
> code
> > for a multithreaded servlet.
> 
> Synchronization should be there for a reason, not just
> because the programmer thought it looked pretty.  If
> something needs to be protected, that requirement will exist
> regardless of whether there are one or many copies of a
> particular Servlet object.  If the programmer has been
> sloppy and is using synchronization on instance variables
> for cases where local variables should have been used,
> you've got a badly written servlet that should be
> corrected.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR
> OTHERWISE PROPRIETARY MATERIAL and is thus for use only by
> the intended recipient. If you received this in error,
> please contact the sender and delete the e-mail and its
> attachments from all computers.
> 
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]


  

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: SingleThreadModel for servlets

2008-11-25 Thread Caldarale, Charles R
> From: Tony Anecito [mailto:[EMAIL PROTECTED]
> Subject: SingleThreadModel for servlets
>
> Reason I ask is if you have a slow service using the
> multithreaded servlet it might be a bad idea especially
> if there is synchronous methods used anywhere in the code
> for a multithreaded servlet.

Synchronization should be there for a reason, not just because the programmer 
thought it looked pretty.  If something needs to be protected, that requirement 
will exist regardless of whether there are one or many copies of a particular 
Servlet object.  If the programmer has been sloppy and is using synchronization 
on instance variables for cases where local variables should have been used, 
you've got a badly written servlet that should be corrected.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Setup Logging for Tomcat 6

2008-11-25 Thread Caldarale, Charles R
> From: dOE [mailto:[EMAIL PROTECTED]
> Subject: Re: Setup Logging for Tomcat 6
>
> No further insight as to why Tomcat 6 is not logging "out-of
> -the-box"?

Are you still using this "js-wrapper" thingie?  If so, no one will be 
interested.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



SingleThreadModel for servlets

2008-11-25 Thread Tony Anecito
Hello All,

I am wondering with the advances in hardware and memory and using servlet 
pooling if using SingleThreadModel is better for performance than multiple 
threads per servlet.
Reason I ask is if you have a slow service using the multithreaded servlet it 
might be a bad idea especially if there is synchronous methods used anywhere in 
the code for a multithreaded servlet.

Regards,
-Tony


  

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Setup Logging for Tomcat 6

2008-11-25 Thread dOE
No further insight as to why Tomcat 6 is not logging "out-of -the-box"?

On Mon, Nov 24, 2008 at 10:25 PM, dOE <[EMAIL PROTECTED]> wrote:

> the JS-wrapper can redirect its output to event viewer.
>
>
> On Mon, Nov 24, 2008 at 7:13 PM, Michael Ludwig <[EMAIL PROTECTED]> wrote:
>
>> André Warnier schrieb am 24.11.2008 um 21:35:50 (+0100):
>> > dOE wrote:
>> > >Its running on win32,
>> > >
>> > >JVM is 1.6
>> > >
>> > >installed via js-wrapper.
>> >
>> > I don't know that js-wrapper, but if this is under Windows, might not
>> > the logs be all redirected in the Windows system logs ?
>>
>> If this is possible, it's not the default. But is it possible? If so,
>> what do I have to do to set it up to use the Windows Event Viewer?
>>
>> > "My computer" icon, right-click, "Manage", then the first "folder"
>> > under "System".
>> > (Can't tell you exactly, this PC is German, and there it's called
>> > "Ereignisanzeige")
>>
>> Shortcut: Hit Windows-r, then type "eventvwr.msc".
>>
>> Michael Ludwig
>>
>> -
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>


log4j.properties file in the WEB-INF/classes directory is not being found and loaded

2008-11-25 Thread William Clar
Hello,

 

I'm migrating from Tomcat 5.5.4 to 6.0.18.  On version 5.5.4 we were
able to create two separate log files: catalina.out for System.err, and
traffic.log for the application.  

In version 6.0.18 I'm unable to recreate this scenario.  I've followed
the Tomcat documentation
(http://tomcat.apache.org/tomcat-6.0-doc/logging.html).  I have a
log4j.properties in $CATALINA_HOME/lib which loads the catalina.out file
correctly.  The traffic.log file is the one causing problems.  Per
Tomcat's documentation, I have a log4j.properties file in the
traffic/WEB-INF/classes directory.  This file is not being loaded for
some reason.

What happens is the output from the traffic webapp is showing up in
catalina.out.  The traffic webapp loads and runs without issue, it just
doesn't have its own log file.

I've checked the classpath by turning on debugging and verified the
traffic/WEB-INF/classes directory is in the classpath.   I've also
turned on log4j debugging with -Dlog4j.debug and verified that only the
the catalina.out properties file is loading.

 

I tried configuring the log4j.properties file manually in java, but the
results are the same:  no traffic.log file.  Here's the snippet I used:

 

File logConfFile= new File("/traffic/WEB-INF/classes/log4j.properties");
  
BasicConfigurator.resetConfiguration();
if(logConfFile.exists())
{
 
PropertyConfigurator.configure(logConfFile.getAbsolutePath());
}
else
{
BasicConfigurator.configure();
}



I've researched the source code for log4j and Tomcat but I haven't found
any leads at this point.  Researching the Tomcat bug database turns up
one bug (https://issues.apache.org/bugzilla/show_bug.cgi?id=41996) but
the answers indicate modifying the catalina.properties file.  I'm not
sure I should I do that.

Bill Clar

Java: 1.6.10
System: Fedora, Release 9 (Sulphur)
Kernel Linux 2.6.27.5-37.fc9.i686



why cant I unsubscribe

2008-11-25 Thread ksh95
the unsubscribe function has failed several times... will a moderater please 
unsubscribe me


  

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat 6.0.18 clustering.. session getting replicated partially

2008-11-25 Thread Filip Hanik - Dev Lists
you're attachment didn't go through, just post a complete example 
somewhere on the web.
for free support, you can't expect the other guy (me in this case) to 
have to spend time setting up to replicate your environment
instead, you do the legwork, and you get help for free, not a bad trade 
if you ask me

Filip

rohit aman wrote:

Hi Filip,
 
   All I did was to modify sessions application that comes with 
tomcat. It's just two simple changes shown below.


   1) Replace the DummCart.class in 
\apache-tomcat-6.0.18\webapps\examples\WEB-INF\classes\sessions 
with the attached one.
   2)mark the web.xml in 
\apache-tomcat-6.0.18\webapps\examples\WEB-INF as 
distributable by adding  tag
   3)then access this by using 
https://localhost/examples/jsp/sessions/carts.jsp


Please let me know...Thanks for doing this
Rohit

On Mon, Nov 24, 2008 at 6:55 PM, Filip Hanik - Dev Lists 
<[EMAIL PROTECTED] > wrote:


post a sample app, and we can test it out

Filip


rohit aman wrote:

Hi,

  I had setup a tomcat cluster with two nodes. followed the
instructions
from "tomcat 6 clustering how to" document. I created a sample
application to test out my cluster.  This application has a
cart where u can
add items.

now, the problem is, not all session variables are getting
replicated. below
is the scenario..

1)start tomcat 1
2)access the cart add items to it ( lets say added 5 items )
3)start tomcat 2
4)add some more items ( 3 more...so totally 8) ( this is done
using tomcat 1
again because my LB is configured for sticky sessions)
5)stop tomcat 1
6)access the cart (now the request goes to tomcat 2)...here *I
can only see
the first 5 items where as it should be 8. *So, the next three
did not get
replicated.

whichever session or session attribute gets created when both
nodes are
running is not getting replicated for some reason.

I am monitoring both nodes with Jconsole. In Jconsole the
number of session
for the application =  sessions in node 1 + sessions in node
2. So, this
says that sessions are being replicated. But, I am not sure
why I am not
able to access all sessions/sessionAttributes.

Any help is very much appreciated.

Thanks
Rohit

 




-
To start a new topic, e-mail: users@tomcat.apache.org

To unsubscribe, e-mail: [EMAIL PROTECTED]

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





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: load-on-startup

2008-11-25 Thread Caldarale, Charles R
> From: André Warnier [mailto:[EMAIL PROTECTED]
> Subject: load-on-startup
>
> 1) In the case of Tomcat 5.5 and higher, is there a way to *prevent* a
> deployed application to be loaded and/or started at Tomcat startup ?

Turn off the deployOnStartup attributes of the  element.  Also consider 
turning off autoDeploy.
http://tomcat.apache.org/tomcat-5.5-doc/config/host.html#Automatic%20Application%20Deployment

> 2) what is the interpretation of a missing  tag ?

Initialization when Tomcat feels like it, which should be at the first 
reference.

> Using the Tomcat Manager app, I can "stop" and "start" an application.

Stopped is deployed but inactive; requests return a 503 status (as opposed to a 
404 when the webapp isn't deployed).  Webapps in a stopped state may be started 
or removed.  The normal cycle is:
  deploy --> start <--> stop --> undeploy
The initial transition from deploy --> start happens automatically when a 
webapp is deployed.

> What really happens there, internally ?

Juha L answered that succintly.  Gotta use all that space in the heap for 
something...

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat 6.0.18 clustering.. session getting replicated partially

2008-11-25 Thread rohit aman
Hi Bhoosan,

   I am using sticky session setup at LB. What do you mean by "use
replicated sessions"? I dont have that kind of configuration setup at my LB.


As far as I know, whatever the configuration at LB is, when cluster
configuration (in server.xml) is correct, session replication should be done
no matter what the LB is setup for.

Thanks
Rohit

On Mon, Nov 24, 2008 at 11:08 PM, Bhooshan Pandit <[EMAIL PROTECTED]>wrote:

> Why don't you use replicated sessions? I believe with sticky sessions the
> session data does not get copied over to other servers in the LB setup, with
> replicated session it does.
>
> -Original Message-
> From: rohit aman <[EMAIL PROTECTED]>
> To: Tomcat Users List 
> Sent: Tue, 25 Nov 2008 6:57 am
> Subject: tomcat 6.0.18 clustering.. session getting replicated partially
>
>
>
>
>
>
>
>
> Hi,
>
>   I had setup a tomcat cluster with two nodes. followed the instructions
> from "tomcat 6 clustering how to" document. I created a sample
> application to test out my cluster.  This application has a cart where u
> can
> add items.
>
> now, the problem is, not all session variables are getting replicated.
> below
> is the scenario..
>
> 1)start tomcat 1
> 2)access the cart add items to it ( lets say added 5 items )
> 3)start tomcat 2
> 4)add some more items ( 3 more...so totally 8) ( this is done using tomcat
> 1
> again because my LB is configured for sticky sessions)
> 5)stop tomcat 1
> 6)access the cart (now the request goes to tomcat 2)...here *I can only see
> the first 5 items where as it should be 8. *So, the next three did not get
> replicated.
>
> whichever session or session attribute gets created when both nodes are
> running is not getting replicated for some reason.
>
> I am monitoring both nodes with Jconsole. In Jconsole the number of session
> for the application =  sessions in node 1 + sessions in node 2. So, this
> says that sessions are being replicated. But, I am not sure why I am not
> able to access all sessions/sessionAttributes.
>
> Any help is very much appreciated.
>
> Thanks
> Rohit
>
>
>
>
>
>
>
>
>
> 
> You are invited to Get a Free AOL Email ID. - http://webmail.aol.in
>


RE: Manager app language

2008-11-25 Thread Caldarale, Charles R
> From: André Warnier [mailto:[EMAIL PROTECTED]
> Subject: Re: Manager app language
>
> Attached the page I get.

It got stripped off somewhere along the way.

> In the official Tomcat, where is this page hidden ?

The manager pages in 5.5 are generated dynamically by servlets in:
  server/webapps/manager/WEB-INF/lib/catalina-manager.jar

Now that I look in there, I have to correct what I said previously: there are 
indeed German strings available for the manager messages, so something could 
have gotten switched.  Will have to look at the source code to see what 
triggers use of the LocalStrings_de.properties file.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Manager app language

2008-11-25 Thread André Warnier

Caldarale, Charles R wrote:

From: André Warnier [mailto:[EMAIL PROTECTED]
Subject: Manager app language

I have a strange happening in Tomcat 5.5, under Linux Debian.


Red flag goes up: real Tomcat, or Debian corruption?


Apparently since today, the Manager app (accessed through
/manager/html) responds with its main page in German.


Pretty cool.

A standard Tomcat does not have any German in it.  (There are French, Japanese, 
and Spanish translations of some messages - and some distributions add other 
languages, but I've never seen one with alternate language web pages.)

Have you been hacked?  (Or perhaps Google translation is more widespread than 
we knew...)

Großer Bruder aufpaßt Sie ie.


Looks like it.
Attached the page I get.
It's cool, but I have no idea where it comes from.

In the official Tomcat, where is this page hidden ?



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: Insert delay between war deployment

2008-11-25 Thread Caldarale, Charles R
> From: Bocalinda [mailto:[EMAIL PROTECTED]
> Subject: Insert delay between war deployment
>
> I'm wondering if it is possible to change the deployment
> order which Tomcat follows.

No.  If your webapps have ordering dependencies, it's up to you to provide the 
necessary synchronization within the webapps.  The servlet spec indicates that 
webapps are independent, and Tomcat treats them that way.

> I more or less found a way to deploy applications at the
> beginning or at the end by appending a .first or .last
> suffix to the name.

A red herring, and not to be relied on.  It likely has more to do with the 
underlying file system hash code value generated for each webapp name in its 
directory.  The order is indeterminate, and whatever you kludge find that works 
today may well operate differently on the next update.

Right now, webapps are initialized serially, but there's nothing to prevent 
them from being done in parallel in the future.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Manager app language

2008-11-25 Thread Caldarale, Charles R
> From: André Warnier [mailto:[EMAIL PROTECTED]
> Subject: Manager app language
>
> I have a strange happening in Tomcat 5.5, under Linux Debian.

Red flag goes up: real Tomcat, or Debian corruption?

> Apparently since today, the Manager app (accessed through
> /manager/html) responds with its main page in German.

Pretty cool.

A standard Tomcat does not have any German in it.  (There are French, Japanese, 
and Spanish translations of some messages - and some distributions add other 
languages, but I've never seen one with alternate language web pages.)

Have you been hacked?  (Or perhaps Google translation is more widespread than 
we knew...)

Großer Bruder aufpaßt Sie ie.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat 6.0.18 clustering.. session getting replicated partially

2008-11-25 Thread rohit aman
Hi Filip,

   All I did was to modify sessions application that comes with tomcat. It's
just two simple changes shown below.

   1) Replace the DummCart.class in
\apache-tomcat-6.0.18\webapps\examples\WEB-INF\classes\sessions
with the attached one.
   2)mark the web.xml in
\apache-tomcat-6.0.18\webapps\examples\WEB-INF as distributable
by adding  tag
   3)then access this by using
https://localhost/examples/jsp/sessions/carts.jsp

Please let me know...Thanks for doing this
Rohit

On Mon, Nov 24, 2008 at 6:55 PM, Filip Hanik - Dev Lists <[EMAIL PROTECTED]
> wrote:

> post a sample app, and we can test it out
>
> Filip
>
>
> rohit aman wrote:
>
>> Hi,
>>
>>   I had setup a tomcat cluster with two nodes. followed the instructions
>> from "tomcat 6 clustering how to" document. I created a sample
>> application to test out my cluster.  This application has a cart where u
>> can
>> add items.
>>
>> now, the problem is, not all session variables are getting replicated.
>> below
>> is the scenario..
>>
>> 1)start tomcat 1
>> 2)access the cart add items to it ( lets say added 5 items )
>> 3)start tomcat 2
>> 4)add some more items ( 3 more...so totally 8) ( this is done using tomcat
>> 1
>> again because my LB is configured for sticky sessions)
>> 5)stop tomcat 1
>> 6)access the cart (now the request goes to tomcat 2)...here *I can only
>> see
>> the first 5 items where as it should be 8. *So, the next three did not get
>> replicated.
>>
>> whichever session or session attribute gets created when both nodes are
>> running is not getting replicated for some reason.
>>
>> I am monitoring both nodes with Jconsole. In Jconsole the number of
>> session
>> for the application =  sessions in node 1 + sessions in node 2. So, this
>> says that sessions are being replicated. But, I am not sure why I am not
>> able to access all sessions/sessionAttributes.
>>
>> Any help is very much appreciated.
>>
>> Thanks
>> Rohit
>>
>>
>>
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: All threads are busy

2008-11-25 Thread Caldarale, Charles R
> From: Rainer Frey [mailto:[EMAIL PROTECTED]
> Subject: Re: All threads are busy
>
> Does the AJP connector support the executor? I thought not.

The doc claims it does, but I haven't looked at the code to verify.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Manager app language

2008-11-25 Thread André Warnier

Hi.
I have a strange happening in Tomcat 5.5, under Linux Debian.
Apparently since today, the Manager app (accessed through /manager/html) 
responds with its main page in German.

This is bizarre, because
- it was not so before
- I have 3 browsers installed on my laptop, and with all3 I have the 
same thing
- my Firefox browser speaks English to me and, as per capture by 
LiveHttpHeaders plugin, is sending the request to the Manager as follows :


GET /manager/html/list HTTP/1.1
...
Accept-Language: en-gb,en;q=0.5

- to my knowledge, we have never installed anything on that system 
specifying German as the language

- the system default locale is en_US_iso8859-15
- the Tomcat startup script sets LC_CTYPE to the same value prior to 
calling Tomcat (this is due to a badly-behaved webapp which does not 
work correctly otherwise)
- I can find nowhere in Tomcat's configuration files, or in the Manager 
webapp setup, a parameter that would indicate German as a language
- Tomcat's help pages are in English, even the Manager's help pages are 
English


About the only thing I can think of that connects to the German language 
is the fact that the host itself is geographically located in Germany.


But where the h.. does Tomcat or the Manager figure that it needs to 
send the "application list" main page in German ?

Where could this be coming from ?

Is there some system property file that I should be looking at ?

Thanks




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Http]ServletResponseWrapper.getOutputStream()

2008-11-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Micheal,

Michael Ludwig wrote:
> Your argument in favour of the unified buffer sounds perfectly logical
> to me. In the end, it's all bytes that get written, regardless of
> whether or not I wrap a PrintWriter around the buffer.

There's always the case that some output has been written before your
filter has been called. In that case, you have to make sure that your
output goes to the correct place. That may mean turning your Writer
contents into an OutputStream, or vice-versa. I think it's simpler to
wrap whichever object the caller is actually requesting.

> I possibly also have to make sure to play by the same rules as the real
> implementation and not allow both getWriter() and getOutputStream() on
> the same resonse.

That's not hard: just make sure you call the wrapped request's getWriter
or getInputStream from your own implementations of the same methods.

> And what do you mean by "caching" it? Just keeping it in an instance
> variable, instead of erroneously creating a new one for each call of
> getWriter(), as I first did?

Yes.

> I agree: You never know. And who knows what stuff gets set or tweaked in
> Tomcat's internals for each one of getWriter() and getOutputStream(). On
> the other hand, I haven't found any statement to the effect that you
> have to pass through the calls to the underlying response object.


No, you don't have to do this, but the benefit of doing it is that you
have the wrapped request enforcing the "call either getWriter or
getInputStream" requirement.

The rule in filters is: only implement what you actually need. Wrap,
baby, wrap. ;)

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkksDDUACgkQ9CaO5/Lv0PDQDwCeL79aNLp4UvJ43UXGU8zHmBqn
HncAn16MaJnKWEDkLQMez+k+44mE8u61
=8el8
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Http]ServletResponseWrapper.getOutputStream()

2008-11-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Micheal,

Michael Ludwig wrote:
> Your argument in favour of the unified buffer sounds perfectly logical
> to me. In the end, it's all bytes that get written, regardless of
> whether or not I wrap a PrintWriter around the buffer.

There's always the case that some output has been written before your
filter has been called. In that case, you have to make sure that your
output goes to the correct place. That may mean turning your Writer
contents into an OutputStream, or vice-versa. I think it's simpler to
wrap whichever object the caller is actually requesting.

> I possibly also have to make sure to play by the same rules as the real
> implementation and not allow both getWriter() and getOutputStream() on
> the same resonse.

That's not hard: just make sure you call the wrapped request's getWriter
or getInputStream from your own implementations of the same methods.

> And what do you mean by "caching" it? Just keeping it in an instance
> variable, instead of erroneously creating a new one for each call of
> getWriter(), as I first did?

Yes.

> I agree: You never know. And who knows what stuff gets set or tweaked in
> Tomcat's internals for each one of getWriter() and getOutputStream(). On
> the other hand, I haven't found any statement to the effect that you
> have to pass through the calls to the underlying response object.


No, you don't have to do this, but the benefit of doing it is that you
have the wrapped request enforcing the "call either getWriter or
getInputStream" requirement.

The rule in filters is: only implement what you actually need. Wrap,
baby, wrap. ;)

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkksDDUACgkQ9CaO5/Lv0PDQDwCeL79aNLp4UvJ43UXGU8zHmBqn
HncAn16MaJnKWEDkLQMez+k+44mE8u61
=8el8
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 6 and javamail

2008-11-25 Thread Lyallex
Hello again

2008/11/19 Don Millhofer <[EMAIL PROTECTED]>:
> Are you sure that the mail server, serving the host you are deploying to does 
> not require authentication?  I got this same error trying to go through the 
> Google Mail Server without proper authentication.


I am absolutely sure that the mail server I am using for the
standalone test is the same one that I am using for the tomcat server.

I tried setting mail.smtp.auth = true and the send failed in Eclipse,
the debug output was exactly the same as when I run the code
in Tomcat Authentication failure

I then hardcoded properties.put("mail.smtp.auth", "false"); in the
MailServer constructor  and ran the Eclipse test, it worked, so I ran
it in Tomcat and it failed with Authentication exception 

In the MailServer constructor I do the following

properties = System.getProperties();
...
properties.put("mail.smtp.auth", "false");

so it looks like a different properties bundle is being used when I
run this in Tomcat ... does any of this make sense ??

Thanks
lyallex


>
> when I invoke the component in the webapp I get
> javax.mail.AuthenticationFailedException
> debug output shows that my components configuration parameters are
> IDENTICAL to those used in standalone mode.
>
> You say in Eclipse you use -  (mail.smtp.auth = false) and sends the email.  
> Try sending authentication.
>
>private class SMTPAuthenticator extends javax.mail.Authenticator {
>@ Override
>public PasswordAuthentication getPasswordAuthentication() {
>return new PasswordAuthentication(d_email, d_password);
>}
>}
>
> Don
>
>
> At 06:41 AM 11/25/2008, you wrote:
>>Start by making sure there is only one copy of the javamail jar.
>>Remove either the one in tomcat's lib directory or your webapp's lib
>>directory.
>>
>>-- David
>>
>>
>>On Nov 19, 2008, at 6:04 AM, Lyallex <[EMAIL PROTECTED]> wrote:
>>
>>>Hi
>>>
>>>Tomcat 6.0.16
>>>jdk1.6.0_06
>>>javamail 1.4.1
>>>
>>>I have a simple component that uses javamail 1.4.1 to send e-mail
>>>It works perfectly 'standalone' (executed from Eclipse).
>>>It connects to the server (mail.smtp.auth = false)
>>>and sends the email
>>>
>>>I've read the available docs at
>>>http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html
>>>which talk about activation.jar among others
>>>As I am using jdk 1.6 I understand that this is no longer required (it
>>>is included in the distro).
>>>
>>>The javamail 1.4.1 jars are in CATALINA_HOME/lib
>>>I have also tried them in WEB-INF/classes/lib
>>>
>>>when I invoke the component in the webapp I get
>>>javax.mail.AuthenticationFailedException
>>>debug output shows that my components configuration parameters are
>>>IDENTICAL to those used in standalone mode.
>>>
>>>I am not using jndi resources or resources defined in context.xml, I
>>>am not using tomcats JavaMail session management.
>>>
>>>I just need this to work as a simple component without lots of config
>>>to start with.
>>>
>>>Can anyone let me in on the 'secret' to getting this to work. I've had
>>>similar components working in earlier releases (and they are still
>>>working)
>>>Something must have changed, I'm rather hoping it's not a securuity
>>>thing but I suspect it might be.
>>>
>>>I'm not asking anyone to debug my application I could just do with a
>>>pointer or two.
>>>
>>>Any help much appreciated
>>>
>>>Cheers
>>>lyallex
>>>
>>>-
>>>To start a new topic, e-mail: users@tomcat.apache.org
>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>-
>>To start a new topic, e-mail: users@tomcat.apache.org
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Shutting down Tomcat6 server - error - Solved :)

2008-11-25 Thread Csanyi Pal
"Caldarale, Charles R" <[EMAIL PROTECTED]> writes:

>> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Csanyi Pal
>> Subject: Shutting down Tomcat6 server - error
>>
>> I have downloaded binary apache-tomcat-6.0.18.tar.gz and unpacked it
>> in the /usr/locale/ directory.
>
> Thank you for using a real Tomcat.
>
>> I edited .bash_profile:
>> #
>> # JAVA
>> #
>> export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.07/lib/visualvm/\
>> profiler2/lib/deployed/jdk16
>> export PATH=$PATH:/usr/lib/jvm/java-6-sun-1.6.0.07/lib/visualvm/\
>> profiler2/lib/deployed/jdk16
>
> That's not right.  JAVA_HOME should be set to just:
> /usr/lib/jvm/java-6-sun-1.6.0.07
>
> PATH should be extended with just:
> /usr/lib/jvm/java-6-sun-1.6.0.07/bin

That is right, Sir!
It works now! :)

-- 
Regards, Paul Csanyi
http://www.freewebs.com/csanyi-pal/index.htm


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: load-on-startup

2008-11-25 Thread Juha Laiho
André Warnier wrote:
> Hi.
> 
> About the  item in web.xml, the Servlet Spec 2.5 has
> this to say (p 128) :
[...]
> My questions are :
> 
> 1) In the case of Tomcat 5.5 and higher, is there a way to *prevent* a
> deployed application to be loaded and/or started at Tomcat startup ?
> (basically only be started when the first call to it is made)

I don't think so. However, if you don't have load-on-startup at all,
the servlets will only be loaded when first referenced. As to when
the JSP compilation happens, I'm not certain (but once compiled,
I think also the servlets that are generated from JSPs are only loaded
when first referenced). It seems that you're somewhat mixing loading
of a single servlet with loading of the whole webapp.

> 2) what is the interpretation of a missing  tag ?

Looks like I answered this question in the above.

> A related question :
> 
> Using the Tomcat Manager app, I can "stop" and "start" an application.
> What really happens there, internally ?  What does it mean that an
> application is stopped ? Does it mean that from now on Tomcat somehow
> "catches" the calls to these URLs, and diverts them to some internal
> webapp that responds : no such application, or ?

A webapp has quite a bit of context, in addition to the servlets, JSPs
and static resources. This context is what is being built on startup
(and torn down when stopping the application). This context is described
in the per-application web.xml; context init parameters, context listeners,
declared servlet mappings, ... .
-- 
..Juha

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: All threads are busy

2008-11-25 Thread Martin Spinassi
On Tue, 2008-11-25 at 12:15 +0100, Rainer Frey wrote:
> On Monday 24 November 2008 16:15:19 Martin Spinassi wrote:
> > Hi to all again!
> 
> > Nov 24, 2008 1:51:54 PM org.apache.tomcat.util.threads.ThreadPool
> > logFull
> > SEVERE: All threads (200) are currently busy, waiting. Increase
> > maxThreads (200) or check the servlet status
> 
> >  > maxThreads="400" minSpareThreads="4" maxSpareThreads="100"/>
> >
> >
> >  >port="8080" protocol="HTTP/1.1"
> >connectionTimeout="2"
> >redirectPort="8443" />
> >
> >
> >  > redirectPort="8443" />
> 
> Does the AJP connector support the executor? I thought not. You probably have 
> to set the maxThreads attribute of the AJP connector element.
> 
> > Thanks to all.
> > Martín
> 
> Rainer
> 


Hi Rainer,


I've just added it, and it works!

Configuring every connector (maxThreads, minSpareThreads,
maxSpareThreads, etc) isn't the best option, but looks like I don't have
other chance.


Thanks for your help! I'll keep testing (and probably asking too ;) )


Cheers


Martín


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: problem with Connection pooling in tomcat 5.5

2008-11-25 Thread Sridhar n
>
> Hello friends,
> I am doing small web application ,in that I am doing connection pooling.I
> followed these steps:
> *1.In Conf/server.xml - added below code*
>...
>
>  type="javax.sql.DataSource"
>description="Oracle 9i database that can be updated and saved"
>driverClassName="oracle.jdbc.driver.OracleDriver"
>url="jdbc:oracle:thin:@127.0.0.1:1521:oracle"
>   username="scott" password="tiger"/>
> 
> 
>
> *2. In web.xml of my web application:*
> ...
>   
>  Oracle Datasource example
>  jdbc/myoracle
>  javax.sql.DataSource
>  Container
> 
>
> ...
>
> *3.In my class :*
>
> Context initContext = new InitialContext();
> Context envContext  =
> (Context)initContext.lookup("java:/comp/env");
> DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
> Connection con = ds.getConnection();
>
>
> *4. I started tomcat 5.5 server , it is not starting and getting error in
> log file like:
> *
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver
> of class '' for connect URL 'null'
>  at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
>  at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
>  at com.sri.struts.RegisterDAO.getConnect(RegisterDAO.java:61)
>  at com.sri.struts.RegisterDAO.isEmployee(RegisterDAO.java:160)
>  at com.sri.struts.LoginAction.execute(LoginAction.java:50)
>  at
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
>  at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
>  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
>  at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>  at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>  at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>  at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>  at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>  at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>  at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>  at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>  at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>  at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
>  at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
>  at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>  at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>  at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>  at java.lang.Thread.run(Unknown Source)
> Caused by: java.sql.SQLException: No suitable driver
>  at java.sql.DriverManager.getDriver(Unknown Source)
>  at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)
>  ... 24 more
> java.lang.NullPointerException
>  at com.sri.struts.RegisterDAO.isEmployee(RegisterDAO.java:160)
>  at com.sri.struts.LoginAction.execute(LoginAction.java:50)
>  at
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
>  at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
>  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
>  at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>  at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>  at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>  at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>  at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>  at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>  at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>  at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>  at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>  at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
>  at
> org.apache.coyo

Re: All threads are busy

2008-11-25 Thread Rainer Frey
On Monday 24 November 2008 16:15:19 Martin Spinassi wrote:
> Hi to all again!

> Nov 24, 2008 1:51:54 PM org.apache.tomcat.util.threads.ThreadPool
> logFull
> SEVERE: All threads (200) are currently busy, waiting. Increase
> maxThreads (200) or check the servlet status

>  maxThreads="400" minSpareThreads="4" maxSpareThreads="100"/>
>
>
> port="8080" protocol="HTTP/1.1"
>connectionTimeout="2"
>redirectPort="8443" />
>
>
>  redirectPort="8443" />

Does the AJP connector support the executor? I thought not. You probably have 
to set the maxThreads attribute of the AJP connector element.

> Thanks to all.
> Martín

Rainer

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



load-on-startup

2008-11-25 Thread André Warnier

Hi.

About the  item in web.xml, the Servlet Spec 2.5 has 
this to say (p 128) :


The load-on-startup element indicates that this
servlet should be loaded (instantiated and have
its init() called) on the startup of the web
application. The optional contents of these
element must be an integer indicating the order in
which the servlet should be loaded. If the value
is a negative integer, or the element is not
present, the container is free to load the servlet
whenever it chooses. If the value is a positive
integer or 0, the container must load and
initialize the servlet as the application is
deployed. The container must guarantee that
servlets marked with lower integers are loaded
before servlets marked with higher integers. The
container may choose the order of loading of
servlets with the same load-on-start-up value.


My questions are :

1) In the case of Tomcat 5.5 and higher, is there a way to *prevent* a 
deployed application to be loaded and/or started at Tomcat startup ?

(basically only be started when the first call to it is made)

2) what is the interpretation of a missing  tag ?

A related question :

Using the Tomcat Manager app, I can "stop" and "start" an application.
What really happens there, internally ?  What does it mean that an 
application is stopped ? Does it mean that from now on Tomcat somehow 
"catches" the calls to these URLs, and diverts them to some internal 
webapp that responds : no such application, or ?


Thanks.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat 5.5.20 security issue

2008-11-25 Thread aymen83

i think it's the real problem since the application is compiled using jdk 1.6
and it's runned under jdk 1.5 but for now there's no way to change because
we are migrating to 1.6
-- 
View this message in context: 
http://www.nabble.com/tomcat-5.5.20-security-issue-tp20661073p20677894.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Insert delay between war deployment

2008-11-25 Thread Bocalinda
Hi,

I got a slight timing problem here.
I got 2 war files: X.war and webservice.war
X.war depends on webservice.war.
I already managed to have webservice.war deploy before X.war gets deployed,
although I can see in the logs that X.war is eternally waiting on
webservice.war when being deployed.

Also, none of the previous deployed applications are accessible (such as
status/ manager/, ..)

However, what I noticed is that if I deploy X.war manually instead of having
Tomcat hotdeploy it at startup, then it actually works. Thus, my guess is
that webservice.war requires a bit more time to be fully deployed. Therefor
my question, is it possible to delay the deployment of a specific .war by a
few seconds?
Maybe it's as easy as increasing the hotdeploy check interval.

Thanks in advance.


Insert delay between war deployment

2008-11-25 Thread Bocalinda
Hi,

I'm wondering if it is possible to change the deployment order which Tomcat
follows.
I've been searching the net, and as from what other people say, it is not
possible. Is this still true for Tomcat 6?

I more or less found a way to deploy applications at the beginning or at the
end by appending a .first or .last suffix to the name. Though, I would like
to know whether there is another way.

Thanks