Java Mailing List Archive

http://www.junlu.com/

Home » users-digest.tomcat »

users Digest 16 Mar 2010 10:08:10 -0000 Issue 9456

users-digest-help

2010-03-16


Author LoginPost Reply

users Digest 16 Mar 2010 10:08:10 -0000 Issue 9456

Topics (messages 209899 through 209922):

Re: Conditionally Setting HTTP Response Header
 209899 by: Christopher Schultz

Re: org.apache.jk.config.ApacheConfig modJk
 209900 by: Electronjockey
 209901 by: Christopher Schultz
 209902 by: Electronjockey
 209914 by: Electronjockey
 209915 by: Bill Barker

Connection pool stats
 209903 by: Dhiren Bhatia
 209904 by: Mark Shifman
 209905 by: Caldarale, Charles R
 209906 by: Dhiren Bhatia

Re: Problem redirecting requests from IIS to Tomcat by isapi_redirect.dll
 209907 by: mirkocal
 209908 by: mirkocal
 209917 by: Pid

How to surpress The requested resource XYZ is not available - response
 209909 by: Song Thuy Nguyen
 209910 by: Len Popp
 209911 by: David Kerber
 209912 by: Song Thuy Nguyen
 209918 by: Pid

Re: Portable
 209913 by: Electronjockey

Re: JMX authentication failure
 209916 by: Mercy
 209919 by: Pid

Tomcat 6 on RHEL3
 209920 by: Ningappa Koneri

Re: Problem setting up multiple hosts
 209921 by: puttea

Can't connect remotely to Tomcat via JMX on Windows
 209922 by: Richard John

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: users@(protected)
To unsubscribe, e-mail: users-digest-unsubscribe@(protected)
For additional commands, e-mail: users-digest-help@(protected)

----------------------------------------------------------------------


Attachment: users_209899.ezm (zipped)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Anurag,

On 3/15/2010 12:17 PM, Anurag Kapur wrote:
> Thanks for your reply. I am actually trying to use a combination
> of mod_setenvif and mod_headers. mod_headers can do the job as long as an
> appropriate environment variable is set. I am trying to achieve the desired
> outcome using something like the following:
>
>  SetEnvIf Cache-Control .+ cc_set=123

This will check for a request header called "Cache-Control".
Cache-Control is likely to be in the /response/ header, so SetEnvIf
can't check for it.

>  Header set Cache-Control "max-age=1000" env=!cc_set
>
> However, since SetEnvIf directive operates on request (not response)
> headers, I am unable to set the right environment variable to be used by the
> Header directive (a part of mod_headers).

Correct.

> In summary, to be able to use mod_headers to solve this problem, I need an
> environment variable set conditionally based on the "response" header.
> However, I have not been able to achieve this using SetEnvIf, as it operated
> on request headers and not response headers.
>
> Would be great if someone who knows of an alternate can his/her inputs.

I'm not sure if there's a way to do this with existing httpd components:
you may have to build your own.

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

iEUEARECAAYFAkueYTIACgkQ9CaO5/Lv0PBe3wCSAw1U7FlnYy7sK0N56Ugp1FQs
4QCgv7VZBQMy6FpYlpy3BMSNo3Hwe/M=
=T57K
-----END PGP SIGNATURE-----


Attachment: users_209900.ezm (zipped)
Chris,
The official add-on is Tomcat 6.0.20 and mod_jk 1.2.20.
I'm proceeding with a static mod_jk.conf for the time being.
And yes, I totally agree with you on the bug vs. inconvenience
assessment. The issue struck me as more of a QA issue than anything.
How would I submit the fix? Is there a document outlining the procedure
on the tomcat/apache site? The change is to line 138 of the source.

I'm still trying to get my project setup for a custom build, but I'm
seriously multitasking right now, and I'm not at all experienced with
SVN access.

-----Original Message-----
From: Christopher Schultz <chris@(protected)>
To : Tomcat Users List <users@(protected)>
Sent: Mon Mar 15 12:16:01 2010
Subject: Re: org.apache.jk.config.ApacheConfig modJk

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Todd,

On 3/14/2010 10:00 PM, Todd Hicks wrote:
The reason I brought it up is because I am exploring Xampp for a
client as a portable dev platform, and it's configured to use the
ApacheConfig class out of the box.

Hmm... the only information I could find without doing too much digging
was that there's a semi-official plug-in for XAMPP for Tomcat 5.0.27,
which is an unsupported version of Tomcat (and has been for quite some
time). It looks like this plug-in needs quite a bit of updating.

I'm sure it's done that way to reduce obstacles to entry for the
newbie. But if it doesn't work as it should, the obstacle remains (at
least for the Xampp novitiates). So are you saying then that the
class isn't likely to be updated? Even if I submit it as a bug? I've
already downloaded the source to try the fix.

If you submit a fix, it's much more likely to be fixed than if you
don't. Honestly, the workaround of simply specifying a ModJk option
makes this more of an inconvenience and less of a bug.

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

iEYEARECAAYFAkueXUEACgkQ9CaO5/Lv0PA7wwCfUYF3hunQjVo8XM23xpbqHOP9
7ogAn299eSLTdTpO+My+WsD/kjFnioNK
=hqg+
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)





Attachment: users_209901.ezm (zipped)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Todd,

On 3/15/2010 12:57 PM, Electronjockey wrote:
> The official add-on is Tomcat 6.0.20 and mod_jk 1.2.20.

Hmm... I must have been looking in the wrong place. I went from here:
http://www.apachefriends.org/en/faq-xampp-windows.html
to here
http://www.apachefriends.org/en/faq-xampp-windows.html#addons
to here
http://sourceforge.net/projects/xamppaddon/

...and that project had an update over a year ago for Tomcat 5.0.27.

Is there a better place to find information about XAMPP plug-ins?

> I'm proceeding with a static mod_jk.conf for the time being.
> And yes, I totally agree with you on the bug vs. inconvenience
> assessment. The issue struck me as more of a QA issue than anything.
> How would I submit the fix? Is there a document outlining the procedure
> on the tomcat/apache site? The change is to line 138 of the source.

You might want to read this before you start:
http://tomcat.apache.org/bugreport.html

Then, file a bug in bugzilla: https://issues.apache.org/bugzilla/

Remember to file the bug against the correct product and version.

Once you've filed your bug, attach a patch to the bug. If your patch is
really small and/or you don't know how to use UNIX diff, you can just
explain in the bug description or a comment what needs to be changed.

> I'm still trying to get my project setup for a custom build, but I'm
> seriously multitasking right now, and I'm not at all experienced with
> SVN access.

All youll have to do is create a patch file. With svn it's easy: make
your changes, then do:

$ svn diff [files] > my.patch

Then, upload that file. You might want to check the patch to make sure
it's not including something that's not really part of the patch, such
as oddball changes you made to the makefiles or whatever :)

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

iEYEARECAAYFAkuebQAACgkQ9CaO5/Lv0PDQqgCdHxFm48ZYSmWSBLNihZ+cXhaq
FPYAoKGFsRwpgi3Iuh1VKve0BUXRyt7U
=IHZG
-----END PGP SIGNATURE-----


Attachment: users_209902.ezm (zipped)
Chris,
Yeah, the xampp site has some wackiness to it.
I got it from the link here:
http://www.apachefriends.org/en/xampp-windows.html#644
or from here:
http://sourceforge.net/projects/xampp/files/
and thanks for the info on the svn procs. I'm workin' it and will submit
the bug with the diff shortly.

-----Original Message-----
From: Christopher Schultz <chris@(protected)>
To : Tomcat Users List <users@(protected)>
Sent: Mon Mar 15 13:23:12 2010
Subject: Re: org.apache.jk.config.ApacheConfig modJk

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Todd,

On 3/15/2010 12:57 PM, Electronjockey wrote:
The official add-on is Tomcat 6.0.20 and mod_jk 1.2.20.

Hmm... I must have been looking in the wrong place. I went from here:
http://www.apachefriends.org/en/faq-xampp-windows.html
to here
http://www.apachefriends.org/en/faq-xampp-windows.html#addons
to here
http://sourceforge.net/projects/xamppaddon/

...and that project had an update over a year ago for Tomcat 5.0.27.

Is there a better place to find information about XAMPP plug-ins?

I'm proceeding with a static mod_jk.conf for the time being.
And yes, I totally agree with you on the bug vs. inconvenience
assessment. The issue struck me as more of a QA issue than anything.
How would I submit the fix? Is there a document outlining the procedure
on the tomcat/apache site? The change is to line 138 of the source.

You might want to read this before you start:
http://tomcat.apache.org/bugreport.html

Then, file a bug in bugzilla: https://issues.apache.org/bugzilla/

Remember to file the bug against the correct product and version.

Once you've filed your bug, attach a patch to the bug. If your patch is
really small and/or you don't know how to use UNIX diff, you can just
explain in the bug description or a comment what needs to be changed.

I'm still trying to get my project setup for a custom build, but I'm
seriously multitasking right now, and I'm not at all experienced with
SVN access.

All youll have to do is create a patch file. With svn it's easy: make
your changes, then do:

$ svn diff [files] > my.patch

Then, upload that file. You might want to check the patch to make sure
it's not including something that's not really part of the patch, such
as oddball changes you made to the makefiles or whatever :)

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

iEYEARECAAYFAkuebQAACgkQ9CaO5/Lv0PDQqgCdHxFm48ZYSmWSBLNihZ+cXhaq
FPYAoKGFsRwpgi3Iuh1VKve0BUXRyt7U
=IHZG
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)





Attachment: users_209914.ezm (zipped)
Chris,
I submitted the bug, with the patch. Got an initial response that the class will not be included in 7.x, but no answer yet on whether it will be fixed. Thanks again for the direction.

-----Original Message-----
From: Electronjockey [mailto:electronjockey@(protected)]
Sent: Monday, March 15, 2010 1:32 PM
To: Tomcat Users List
Subject: Re: org.apache.jk.config.ApacheConfig modJk

Chris,
Yeah, the xampp site has some wackiness to it.
I got it from the link here:
http://www.apachefriends.org/en/xampp-windows.html#644
or from here:
http://sourceforge.net/projects/xampp/files/
and thanks for the info on the svn procs. I'm workin' it and will submit
the bug with the diff shortly.

-----Original Message-----
From: Christopher Schultz <chris@(protected)>
To : Tomcat Users List <users@(protected)>
Sent: Mon Mar 15 13:23:12 2010
Subject: Re: org.apache.jk.config.ApacheConfig modJk

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Todd,

On 3/15/2010 12:57 PM, Electronjockey wrote:
The official add-on is Tomcat 6.0.20 and mod_jk 1.2.20.

Hmm... I must have been looking in the wrong place. I went from here:
http://www.apachefriends.org/en/faq-xampp-windows.html
to here
http://www.apachefriends.org/en/faq-xampp-windows.html#addons
to here
http://sourceforge.net/projects/xamppaddon/

...and that project had an update over a year ago for Tomcat 5.0.27.

Is there a better place to find information about XAMPP plug-ins?

I'm proceeding with a static mod_jk.conf for the time being.
And yes, I totally agree with you on the bug vs. inconvenience
assessment. The issue struck me as more of a QA issue than anything.
How would I submit the fix? Is there a document outlining the procedure
on the tomcat/apache site? The change is to line 138 of the source.

You might want to read this before you start:
http://tomcat.apache.org/bugreport.html

Then, file a bug in bugzilla: https://issues.apache.org/bugzilla/

Remember to file the bug against the correct product and version.

Once you've filed your bug, attach a patch to the bug. If your patch is
really small and/or you don't know how to use UNIX diff, you can just
explain in the bug description or a comment what needs to be changed.

I'm still trying to get my project setup for a custom build, but I'm
seriously multitasking right now, and I'm not at all experienced with
SVN access.

All youll have to do is create a patch file. With svn it's easy: make
your changes, then do:

$ svn diff [files] > my.patch

Then, upload that file. You might want to check the patch to make sure
it's not including something that's not really part of the patch, such
as oddball changes you made to the makefiles or whatever :)

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

iEYEARECAAYFAkuebQAACgkQ9CaO5/Lv0PDQqgCdHxFm48ZYSmWSBLNihZ+cXhaq
FPYAoKGFsRwpgi3Iuh1VKve0BUXRyt7U
=IHZG
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)




Attachment: users_209915.ezm (zipped)


"Christopher Schultz" <chris@(protected)
news:4B9D8435.50604@(protected)...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Todd,
>
> On 3/14/2010 1:41 PM, Todd Hicks wrote:
>> This may be a question better suited for the dev list, but I thought I'd
>> try
>> here first.
>> I've been troubleshooting a problem in one of my installations and was
>> reviewing the documentation here:
>> http://www.docjar.com/docs/api/org/apache/jk/config/ApacheConfig.html
>> (the
>> auto-config listener class) when it caught my attention that the path to
>> the
>> Apache mod_jk plugin file defaults to "modules/mod_jk.dll" on windows (if
>> the modJk option isn't set), yet the Apache connector for windows is
>> distributed as mod_jk-1.2.30-httpd-2.2.3.so (to be renamed to mod_jk.so).
>> Is
>> this just legacy and needs to be updated or am I missing something?
>> Should I
>> report this as a bug?
>
> The real bug is that the ApacheConfig class still hasn't been put out of
> its misery. Basically, nobody should ever use the ApacheConfig class
> because it re-writes your mod_jk.conf file every time Tomcat starts.
>

This class has been removed from TC 7. And yes, is only somewhat works with
the retired httpd 1.3.x version, so nobody should ever use it.

> You're better off reading the documentation for mod_jk and building your
> own configuration file. It's not hard to set up a mapping for simple
> things like *.jsp -> Tomcat and stuff like that. Once you've got the
> simple stuff working, extending your configuration to include more
> exotic options is still very easy.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkudhDUACgkQ9CaO5/Lv0PBUAQCfU6a4LrhrAZORb7zbzVIXRjOc
> msUAniENxyXg+emGX9Ha3JmeKJSjNFWl
> =uBUr
> -----END PGP SIGNATURE-----




Attachment: users_209903.ezm (zipped)
I've configured my DB connection pool as follows:

context.xml

<Resource name="jdbc/myserver" auth="Container" type="javax.sql.DataSource"

maxActive="100" maxIdle="30" maxWait="10000" username="xxx"

password="xxx" driverClassName="com.mysql.jdbc.Driver"

url="jdbc:mysql://a.b.c:3306/Test" removeAbandoned="true"

removeAbandonedTimeout="60" logAbandoned="true" />


web.xml


<resource-ref>

<description>DB Connection</description>

<res-ref-name>jdbc/myserver</res-ref-name>

<res-type>javax.sql.DataSource</res-type>

<res-auth>Container</res-auth>

</resource-ref>


In my code, I use a javax.sql.DataSource object to get connections and call
connection.close() to return connections.


How do I get stats on the connection pool? I would like to check how many
connections are active/idle at any point in time.


Thanks,

Dhiren

Attachment: users_209904.ezm (zipped)
You can cast your datasource object to be a BasicDataSource
then the javadoc gives you all kinds of things you can get.
like getNumActive(), getNumIdle() etc
(for dbcp 1.3)
http://commons.apache.org/dbcp/api-1.3/index.html



Dhiren Bhatia wrote:
> I've configured my DB connection pool as follows:
>
> context.xml
>
> <Resource name="jdbc/myserver" auth="Container" type="javax.sql.DataSource"
>
> maxActive="100" maxIdle="30" maxWait="10000" username="xxx"
>
> password="xxx" driverClassName="com.mysql.jdbc.Driver"
>
> url="jdbc:mysql://a.b.c:3306/Test" removeAbandoned="true"
>
> removeAbandonedTimeout="60" logAbandoned="true" />
>
>
> web.xml
>
>
> <resource-ref>
>
> <description>DB Connection</description>
>
> <res-ref-name>jdbc/myserver</res-ref-name>
>
> <res-type>javax.sql.DataSource</res-type>
>
> <res-auth>Container</res-auth>
>
> </resource-ref>
>
>
> In my code, I use a javax.sql.DataSource object to get connections and call
> connection.close() to return connections.
>
>
> How do I get stats on the connection pool? I would like to check how many
> connections are active/idle at any point in time.
>
>
> Thanks,
>
> Dhiren
>

--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
mark.shifman@(protected)


Attachment: users_209905.ezm (zipped)
> From: Dhiren Bhatia [mailto:dhiren.forums@(protected)]
> Subject: Connection pool stats
>
> How do I get stats on the connection pool? I would like to check how
> many connections are active/idle at any point in time.

This may help:
http://lambdaprobe.org/d/index.htm

An example of its display for a data source:
http://lambdaprobe.org/d/screenshots/full/datasources.png

You can also programmatically grab statistics for just about anything in your webapp with this:
http://moskito.anotheria.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.



Attachment: users_209906.ezm (zipped)
Hi Mark,

That won't work because Tomcat creates an instance of
org.apache.tomcat.dbcp.dbcp.BasicDataSource which cannot be cast to
org.apache.commons.dbcp.BasicDataSource.

I need to keep the code generic (to run in other containers), so I can't use
org.apache.tomcat.dbcp.dbcp.BasicDataSource in the code to receive the
object Tomcat creates.

Dhiren

On Mon, Mar 15, 2010 at 11:22 AM, Mark Shifman <mark.shifman@(protected):

> You can cast your datasource object to be a BasicDataSource
> then the javadoc gives you all kinds of things you can get.
> like getNumActive(), getNumIdle() etc
> (for dbcp 1.3)
> http://commons.apache.org/dbcp/api-1.3/index.html
>
>
>
> Dhiren Bhatia wrote:
> > I've configured my DB connection pool as follows:
> >
> > context.xml
> >
> > <Resource name="jdbc/myserver" auth="Container"
> type="javax.sql.DataSource"
> >
> > maxActive="100" maxIdle="30" maxWait="10000" username="xxx"
> >
> > password="xxx" driverClassName="com.mysql.jdbc.Driver"
> >
> > url="jdbc:mysql://a.b.c:3306/Test" removeAbandoned="true"
> >
> > removeAbandonedTimeout="60" logAbandoned="true" />
> >
> >
> > web.xml
> >
> >
> > <resource-ref>
> >
> > <description>DB Connection</description>
> >
> > <res-ref-name>jdbc/myserver</res-ref-name>
> >
> > <res-type>javax.sql.DataSource</res-type>
> >
> > <res-auth>Container</res-auth>
> >
> > </resource-ref>
> >
> >
> > In my code, I use a javax.sql.DataSource object to get connections and
> call
> > connection.close() to return connections.
> >
> >
> > How do I get stats on the connection pool? I would like to check how many
> > connections are active/idle at any point in time.
> >
> >
> > Thanks,
> >
> > Dhiren
> >
>
> --
> Mark Shifman MD. Ph.D.
> Yale Center for Medical Informatics
> Phone (203)737-5219
> mark.shifman@(protected)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>

Attachment: users_209907.ezm (zipped)

Thanks for your answers, but maybe I have not been enaugh clear.
What I want is that my web application can be launched asking for
www.myapp.it and, in the future, deploy other web apps on the same physical
machine under Tomcat, each one responding to a diffferent URL (all pointing
to the IP address of my machine). I've tried to do this using IIS and Tomcat
communication mechanism, but it doesn't work.
Any other suggest?
--
Sent from the Tomcat - User mailing list archive at Nabble.com.



Attachment: users_209908.ezm (zipped)

Thanks for your answers, but maybe I have not been enaugh clear.
What I want is that my web application can be launched asking for
www.myapp.it and, in the future, deploy other web apps on the same physical
machine under Tomcat, each one responding to a diffferent URL (all pointing
to the IP address of my machine). I've tried to do this using IIS and Tomcat
communication mechanism, but it doesn't work.
Any other suggest?
--
Sent from the Tomcat - User mailing list archive at Nabble.com.



Attachment: users_209917.ezm (zipped)
On 15/03/2010 22:50, mirkocal wrote:
>
> Thanks for your answers, but maybe I have not been enaugh clear.
> What I want is that my web application can be launched asking for
> www.myapp.it and, in the future, deploy other web apps on the same physical
> machine under Tomcat, each one responding to a diffferent URL (all pointing
> to the IP address of my machine).

Are you talking about virtual hosts, or multiple webapps in the same
host? Please provide some example URLs so we know what you mean.

> I've tried to do this using IIS and Tomcat
> communication mechanism, but it doesn't work.

You haven't really explained what "doesn't work" actually means.

> Any other suggest?

Drop IIS and just use Tomcat?


p


Attachment: users_209909.ezm (zipped)
Hello,



usually you will get a "The requested resource /XYZ is not available" response when you call an unavailable web service on Apache Tomcat. However, for a special use case I don't want Tomcat to answer to requests for a unknown/unavailable web service. I just want Tomcat to ignore it and "keep quiet", resulting that the caller will get a timeout and therefore knows that there is no service behind this URL. How can I achieve such behaviour?



Best Regards,





Song Thuy Nguyen


Attachment: users_209910.ezm (zipped)
I don't think you can do that. After Tomcat accepts the HTTP
connection and decides whether to respond, it's too late to pretend
there's no server there. The user's web browser displays a different
error message for no server (something like "can't establish a
connection") vs. server timeout (something like "the server took too
long to respond") or dropping the connection ("the connection was
reset").

So you might as well just customize the 404 error page to say "There's
no server here" - it'd fool people just as well. :-) Or just return
an empty error page.
--
Len



On Mon, Mar 15, 2010 at 19:26, Song Thuy Nguyen <programming@(protected):
> Hello,
>
>
>
> usually you will get a "The requested resource /XYZ is not available" response when you call an
> unavailable web service on Apache Tomcat. However, for a special use case I don't want Tomcat to
> answer to  requests for a unknown/unavailable web service. I just want Tomcat to ignore it and "keep
> quiet", resulting that the caller will get a timeout and therefore knows that there is no service behind
> this URL. How can I achieve such behaviour?
>
>
>
> Best Regards,
>
>
>
>
>
> Song Thuy Nguyen
>
>


Attachment: users_209911.ezm (zipped)
Len Popp wrote:
> I don't think you can do that. After Tomcat accepts the HTTP
> connection and decides whether to respond, it's too late to pretend
> there's no server there. The user's web browser displays a different
> error message for no server (something like "can't establish a
> connection") vs. server timeout (something like "the server took too
> long to respond") or dropping the connection ("the connection was
> reset").
>
> So you might as well just customize the 404 error page to say "There's
> no server here" - it'd fool people just as well. :-) Or just return
> an empty error page.
>  
Yeah, I've done that; it works great for most users, including
experienced IT people if they don't stop to look too close.

D




Attachment: users_209912.ezm (zipped)
The thing is, I'm using the failover behaviour in Apache Synapse (Enterprise Service Bus). I can give Synapse a list of web service endpoints that have the same interface. One is the primary service endpoint and the others are the backups in case the primary endpoint become unavailable for some reason. Actually there are only 2 general reasons: the (application) server that provides the services is not running, so the port (lets say port 80) is closed. Or the second case: the application server is still running, but the service is made inactive. That means the application server still listens at port 80 but can't serve request to the mentioned service and answers with the "404 The requested resource XYZ is not available" response.
Now the problem: Synapse gets this http-404 response, eventhough it can't find the SOAP envelop it expects it doesn't see the endpoint as faulty and forwards the 404 message to the caller (web service consumer). The fail-over mechanism doesn't kick in.... :( But actually it should because the service is not available anymore, so the request should be send to the backup endpoints.
Ofcourse I tried to make Synapse understand that a 404-response should be treated the same as a failure. But it can't easily be done. So I thought I could make Tomcat to receive calls to inactive services, but just drop them without answering. After some time... synapse will trigger timeout and tries to call the backup endpoints.
It doesn't matter if the http/tcp connection has been established or not.



> -----Original Message-----
> From: Len Popp [mailto:len.popp@(protected)]
> Sent: Tuesday, March 16, 2010 1:50 AM
> To: Tomcat Users List
> Subject: Re: How to surpress The requested resource XYZ is not
> available - response
>
> I don't think you can do that. After Tomcat accepts the HTTP
> connection and decides whether to respond, it's too late to pretend
> there's no server there. The user's web browser displays a different
> error message for no server (something like "can't establish a
> connection") vs. server timeout (something like "the server took too
> long to respond") or dropping the connection ("the connection was
> reset").
>
> So you might as well just customize the 404 error page to say "There's
> no server here" - it'd fool people just as well. :-) Or just return
> an empty error page.
> --
> Len
>
>
>
> On Mon, Mar 15, 2010 at 19:26, Song Thuy Nguyen <programming@(protected)>
> wrote:
> > Hello,
> >
> >
> >
> > usually you will get a "The requested resource /XYZ is not available"
> response when you call an
> > unavailable web service on Apache Tomcat. However, for a special use
> case I don't want Tomcat to
> > answer to requests for a unknown/unavailable web service. I just
> want Tomcat to ignore it and "keep
> > quiet", resulting that the caller will get a timeout and therefore
> knows that there is no service behind
> > this URL. How can I achieve such behaviour?
> >
> >
> >
> > Best Regards,
> >
> >
> >
> >
> >
> > Song Thuy Nguyen
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)



Attachment: users_209918.ezm (zipped)
On 16/03/2010 02:01, Song Thuy Nguyen wrote:
> The thing is, I'm using the failover behaviour in Apache Synapse (Enterprise Service Bus). I can give Synapse a list of web service endpoints that have the same interface. One is the primary service endpoint and the others are the backups in case the primary endpoint become unavailable for some reason. Actually there are only 2 general reasons: the (application) server that provides the services is not running, so the port (lets say port 80) is closed. Or the second case: the application server is still running, but the service is made inactive. That means the application server still listens at port 80 but can't serve request to the mentioned service and answers with the "404 The requested resource XYZ is not available" response.
> Now the problem: Synapse gets this http-404 response, eventhough it can't find the SOAP envelop it expects it doesn't see the endpoint as faulty and forwards the 404 message to the caller (web service consumer). The fail-over mechanism doesn't kick in.... :( But actually it should because the service is not available anymore, so the request should be send to the backup endpoints.
> Ofcourse I tried to make Synapse understand that a 404-response should be treated the same as a failure. But it can't easily be done. So I thought I could make Tomcat to receive calls to inactive services, but just drop them without answering. After some time... synapse will trigger timeout and tries to call the backup endpoints.
> It doesn't matter if the http/tcp connection has been established or not.

So why try to fake a timeout? Presumably there is an error code that
Synapse will recognise as meaning that the service is unavailable, find
out what that is and send that instead. E.g. 503.

You could employ a custom ErrorValve, if you are able to check/intercept
the 404 status that would be returned in the normal case and override it.


p

>> -----Original Message-----
>> From: Len Popp [mailto:len.popp@(protected)]
>> Sent: Tuesday, March 16, 2010 1:50 AM
>> To: Tomcat Users List
>> Subject: Re: How to surpress The requested resource XYZ is not
>> available - response
>>
>> I don't think you can do that. After Tomcat accepts the HTTP
>> connection and decides whether to respond, it's too late to pretend
>> there's no server there. The user's web browser displays a different
>> error message for no server (something like "can't establish a
>> connection") vs. server timeout (something like "the server took too
>> long to respond") or dropping the connection ("the connection was
>> reset").
>>
>> So you might as well just customize the 404 error page to say "There's
>> no server here" - it'd fool people just as well. :-) Or just return
>> an empty error page.
>> --
>> Len
>>
>>
>>
>> On Mon, Mar 15, 2010 at 19:26, Song Thuy Nguyen<programming@(protected)>
>> wrote:
>>> Hello,
>>>
>>>
>>>
>>> usually you will get a "The requested resource /XYZ is not available"
>> response when you call an
>>> unavailable web service on Apache Tomcat. However, for a special use
>> case I don't want Tomcat to
>>> answer to requests for a unknown/unavailable web service. I just
>> want Tomcat to ignore it and "keep
>>> quiet", resulting that the caller will get a timeout and therefore
>> knows that there is no service behind
>>> this URL. How can I achieve such behaviour?
>>>
>>>
>>>
>>> Best Regards,
>>>
>>>
>>>
>>>
>>>
>>> Song Thuy Nguyen
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@(protected)
>> For additional commands, e-mail: users-help@(protected)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>



Attachment: users_209913.ezm (zipped)

I'm currently working on a portable development environment for a client. I have Tomcat 6.0.20 running portably as part of Xampp. I have successfully configured it to run with the JDK (non-installed) on the same USB device, so it can be done.

-----Original Message-----
From: Christopher Schultz [mailto:chris@(protected)]
Sent: Monday, March 15, 2010 12:26 PM
To: Tomcat Users List
Subject: Re: Portable

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Asangansi,

On 3/12/2010 4:18 AM, Asangansi wrote:
> I have a webapp that runs on tomcat 6.0.2 with a mysql database.

6.0.20?

> I'm looking at creating a portable version of my server for
> demonstration purposes, which will run on a different port other than
> the default.

Do you want to avoid port conflicts when running on a client's machine?

> So, [I'd] like to know what configuration files i need to [reconfigure]
> and files [I wouldn't] need so it could be lighter.

I think you need to ask yourself what is most important: portability and
being self-contained, or running the fastest.

If you want it to run fast, you'll want to run natively /and/ avoid
installing anything on the client's computer: I certainly wouldn't let
you install something on my computer for a quickie demonstration. That
will limit your options to those architectures that are supported by
MySQL (currently Microsoft Windows, most *NIX platforms, and Mac OS X).

Tomcat itself is trivial to run in a "portable" way, since Tomcata
figures out its own installation directory at start-up and runs
everything relative to that.

The problem might be the JVM: I've never tried to run a non-installed
JVM on Microsoft Windows, but it runs perfectly well on a *NIX machine
without any formal installation.

If you want a foolproof environment, go for a virtualized server:
install everything you need, including your webapp, and then just fire
up the VM when doing demonstrations. You could even put a web browser, X
environment, etc. all on your USB memory stick and make the thing
bootable: simply insert the stick and reboot the client's computer: no
interference (aside from the reboot, of course) and you know your
environment will be sane.

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

iEYEARECAAYFAkueX5UACgkQ9CaO5/Lv0PDPRwCeJcRjkGVZUwYdSgCSKuxNAbAt
6YQAnjDWTR5J7/Rm7rQmlgobMj3Qh46f
=bkdp
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)




Attachment: users_209916.ezm (zipped)
JMX does not need to authenticate for access.

My question that is how to enable authentication on Tomcat.

Regards,
Mercy


Paolo Santarsiero wrote:
> Is your system firewalled?
>
> On 15 March 2010 14:17, Gurkan Erdogdu <cgurkanerdogdu@(protected):
>
>  
>> then you answer question :)
>>
>> 2010/3/15 Mercy <techmercy@(protected)>
>>
>>  
>>> Hi Gurkan,
>>>
>>>  it's false;
>>>
>>> regards,
>>> Mercy
>>>
>>>
>>> Gurkan Erdogdu wrote:
>>>
>>>    
>>>> -Dcom.sun.management.jmxremote.authenticate=$JMX_SSL_ENABLED
>>>>
>>>> what is the $JMX_SSL_ENABLED value?
>>>>
>>>> Thanks;
>>>>
>>>> 2010/3/15 Mercy <techmercy@(protected)>
>>>>
>>>>
>>>>
>>>>      
>>>>> Hi there,
>>>>>
>>>>> I'd like to enable JMX on Tomcat 6.0.16/Linux, export environment
>>>>> variables :
>>>>>
>>>>> *   # JMX authenticate
>>>>>    export JMX_AUTHENTICATE=true
>>>>>    echo "Is JMX authenticated ? " $JMX_AUTHENTICATE
>>>>>        # JMX password file
>>>>>    export JMX_PASSWORD_FILE=$JMX_HOME/jmxremote.password
>>>>>    echo "The location of password file of JMX : " $JMX_PASSWORD_FILE
>>>>>        # JMX access file
>>>>>    export JMX_ACCESS_FILE=$ETC_DIR/tomcat/jmx/jmxremote.access
>>>>>    echo "The location of access file of JMX : " $JMX_ACCESS_FILE
>>>>>        export CATALINA_OPTS="-Dcom.sun.management.jmxremote
>>>>>
>>>>>      
>> -Dcom.sun.management.jmxremote.port=$JMX_PORT
>>  
>>>>> -Dcom.sun.management.jmxremote.ssl=$JMX_SSL_ENABLED
>>>>>
>>>>> -Dcom.sun.management.jmxremote.authenticate=$JMX_SSL_ENABLED
>>>>>                   -Djava.rmi.server.hostname=$JMX_HOST_NAME
>>>>>
>>>>> -Dcom.sun.management.jmxremote.password.file=$JMX_PASSWORD_FILE
>>>>>
>>>>> -Dcom.sun.management.jmxremote.access.file=$JMX_ACCESS_FILE
>>>>>                   $CATALINA_OPTS"*
>>>>>
>>>>>
>>>>> The console outputs:
>>>>> *...
>>>>> **Is JMX authenticated ? true
>>>>> The location of password file of JMX :
>>>>> /home/mercy/workspace/website/etc/tomcat/jmx/jmxremote.password
>>>>> ...*
>>>>>
>>>>> The password(/owner read-only privilege/) and access file are existed,
>>>>>
>>>>> *mercy@(protected)
>>>>> /home/mercy/workspace/website/etc/tomcat/jmx
>>>>> mercy@(protected)
>>>>> total 8
>>>>> 4 -rw-r--r-- 1 mercy mercy 160 2010-03-11 20:35 jmxremote.access
>>>>> 4 -rw------- 1 mercy mercy 153 2010-03-11 19:45 jmxremote.password
>>>>>
>>>>> *
>>>>>
>>>>> The content of jmxremote.access:
>>>>>
>>>>> *# Author : Mercy
>>>>> # Date  : 11 Mar 2010
>>>>> # This is a password file of JMX, whose format is like this:
>>>>> # ${USER_NAME} ${PRIVILEGE}
>>>>>
>>>>> mercy readonly
>>>>> admin readwrite*
>>>>>
>>>>> jmxremote.password:
>>>>>
>>>>> *# Author : Mercy
>>>>> # Date  : 11 Mar 2010
>>>>> # This is a password file of JMX, whose format is like this:
>>>>> # ${USER_NAME} ${PASSWORD}
>>>>>
>>>>> mercy mercy
>>>>> admin admin*
>>>>>
>>>>>
>>>>> I run the JConsole to connect JMX on Tomcat after lunching it , it
>>>>> allows
>>>>> to access whether there is an authentication info or not.
>>>>>
>>>>>
>>>>>
>>>>> Please tell me how to enable authentication, thanks in advance.
>>>>>
>>>>> Kind regards,
>>>>> Mercy
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>      
>>>>
>>>>
>>>>      
>>>    
>> --
>> Gurkan Erdogdu
>> http://gurkanerdogdu.blogspot.com
>>
>>  
>
>  


Attachment: users_209919.ezm (zipped)
On 16/03/2010 05:22, Mercy wrote:
> JMX does not need to authenticate for access.

No, it doesn't, but that's what you're trying to configure isn't it?


> My question that is how to enable authentication on Tomcat.

You asked how to configure authentication for JMX and Gurkan answered
you. Read what he wrote more carefully.

http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html

You posted the following:

-Dcom.sun.management.jmxremote.ssl=$JMX_SSL_ENABLED
-Dcom.sun.management.jmxremote.authenticate=$JMX_SSL_ENABLED

You have used the same variable for both of these settings, instead of
using the separately defined $JMX_AUTHENTICATE


p




> Regards,
> Mercy
>
>
> Paolo Santarsiero wrote:
>> Is your system firewalled?
>>
>> On 15 March 2010 14:17, Gurkan Erdogdu <cgurkanerdogdu@(protected):
>>
>>> then you answer question :)
>>>
>>> 2010/3/15 Mercy <techmercy@(protected)>
>>>
>>>> Hi Gurkan,
>>>>
>>>> it's false;
>>>>
>>>> regards,
>>>> Mercy
>>>>
>>>>
>>>> Gurkan Erdogdu wrote:
>>>>
>>>>> -Dcom.sun.management.jmxremote.authenticate=$JMX_SSL_ENABLED
>>>>>
>>>>> what is the $JMX_SSL_ENABLED value?
>>>>>
>>>>> Thanks;
>>>>>
>>>>> 2010/3/15 Mercy <techmercy@(protected)>
>>>>>
>>>>>
>>>>>
>>>>>> Hi there,
>>>>>>
>>>>>> I'd like to enable JMX on Tomcat 6.0.16/Linux, export environment
>>>>>> variables :
>>>>>>
>>>>>> * # JMX authenticate
>>>>>> export JMX_AUTHENTICATE=true
>>>>>> echo "Is JMX authenticated ? " $JMX_AUTHENTICATE
>>>>>> # JMX password file
>>>>>> export JMX_PASSWORD_FILE=$JMX_HOME/jmxremote.password
>>>>>> echo "The location of password file of JMX : " $JMX_PASSWORD_FILE
>>>>>> # JMX access file
>>>>>> export JMX_ACCESS_FILE=$ETC_DIR/tomcat/jmx/jmxremote.access
>>>>>> echo "The location of access file of JMX : " $JMX_ACCESS_FILE
>>>>>> export CATALINA_OPTS="-Dcom.sun.management.jmxremote
>>>>>>
>>> -Dcom.sun.management.jmxremote.port=$JMX_PORT
>>>>>> -Dcom.sun.management.jmxremote.ssl=$JMX_SSL_ENABLED
>>>>>>
>>>>>> -Dcom.sun.management.jmxremote.authenticate=$JMX_SSL_ENABLED
>>>>>> -Djava.rmi.server.hostname=$JMX_HOST_NAME
>>>>>>
>>>>>> -Dcom.sun.management.jmxremote.password.file=$JMX_PASSWORD_FILE
>>>>>>
>>>>>> -Dcom.sun.management.jmxremote.access.file=$JMX_ACCESS_FILE
>>>>>> $CATALINA_OPTS"*
>>>>>>
>>>>>>
>>>>>> The console outputs:
>>>>>> *...
>>>>>> **Is JMX authenticated ? true
>>>>>> The location of password file of JMX :
>>>>>> /home/mercy/workspace/website/etc/tomcat/jmx/jmxremote.password
>>>>>> ...*
>>>>>>
>>>>>> The password(/owner read-only privilege/) and access file are
>>>>>> existed,
>>>>>>
>>>>>> *mercy@(protected)
>>>>>> /home/mercy/workspace/website/etc/tomcat/jmx
>>>>>> mercy@(protected)
>>>>>> total 8
>>>>>> 4 -rw-r--r-- 1 mercy mercy 160 2010-03-11 20:35 jmxremote.access
>>>>>> 4 -rw------- 1 mercy mercy 153 2010-03-11 19:45 jmxremote.password
>>>>>>
>>>>>> *
>>>>>>
>>>>>> The content of jmxremote.access:
>>>>>>
>>>>>> *# Author : Mercy
>>>>>> # Date : 11 Mar 2010
>>>>>> # This is a password file of JMX, whose format is like this:
>>>>>> # ${USER_NAME} ${PRIVILEGE}
>>>>>>
>>>>>> mercy readonly
>>>>>> admin readwrite*
>>>>>>
>>>>>> jmxremote.password:
>>>>>>
>>>>>> *# Author : Mercy
>>>>>> # Date : 11 Mar 2010
>>>>>> # This is a password file of JMX, whose format is like this:
>>>>>> # ${USER_NAME} ${PASSWORD}
>>>>>>
>>>>>> mercy mercy
>>>>>> admin admin*
>>>>>>
>>>>>>
>>>>>> I run the JConsole to connect JMX on Tomcat after lunching it , it
>>>>>> allows
>>>>>> to access whether there is an authentication info or not.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Please tell me how to enable authentication, thanks in advance.
>>>>>>
>>>>>> Kind regards,
>>>>>> Mercy
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>> --
>>> Gurkan Erdogdu
>>> http://gurkanerdogdu.blogspot.com
>>>
>>
>
>



Attachment: users_209920.ezm (zipped)
Dear All,

I have an issue with tomcat 6 which is deployed under RHEL3 with JDK5, the problem is tomcat is taking hell lot of time in deploying the war files when started.
It's so busy that not responding back with home page also, what could be the problem ?


Regards,
Ningappa Koneri
mLifestyle | www.comviva.com




This e-mail and all material transmitted with it are for the use of the intended recipient(s) ONLY and contains confidential and/or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken pursuant to the contents of the present e-mail is strictly prohibited and is unlawful.
The recipient acknowledges that Comviva Technologies Limited or its management or directors, are unable to exercise control or ensure the integrity over /of the contents of the information contained in e-mail. Any views expressed herein are those of the individual sender only and no binding nature of the contents shall be implied or assumed unless the sender does so expressly with due authority of Comviva Technologies Limited. E-mail and any contents transmitted with it are prone to viruses and related defects despite all efforts to avoid such by Comviva Technologies Limited.


Attachment: users_209921.ezm (zipped)

Hi Chuck

I have also tried this option whitout the context path and with different
appBase

 <Host name="localhost" appBase="webapps/OpenClinica"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    </Host>

 <Host name="oc3.signifikans.dk" appBase="webapps/OpenClinica3"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
   </Host>

With this option i get 404 error on the first site and blank page on the
second site. I'm running on a Windows server if this has anything to say.
Also tried with "\" instead of "/" with any luck.


n828cl wrote:
>
>> From: puttea [mailto:putte.a@(protected)]
>> Subject: Re: Problem setting up multiple hosts
>>
>> These informations have made me create the example
>> I posted in the first post. But this doesn't work.
>
> Because you didn't follow the instructions. Please read my other post.
>
> - 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 unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>
>

--
Sent from the Tomcat - User mailing list archive at Nabble.com.



Attachment: users_209922.ezm (zipped)
I want to monitor the Tomcat server remotley with jconsole.

I added the properties described in
http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html

set CATALINA_OPTS="-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8050-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"

there is no exception (cmd / log) but i can’t remote connect with
jconsole (i tried service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi
and localhost:8050)

when i connect to the local process, i can see the right VM arguments
in the VM summary tab

when i use netstat, the tomcat process is listening on 8080 and 8009
but not on 8050

the same configuration works with linux (same tomcat version)

Apache Tomcat 6.0.24 (also tested with 5.5.28, same thing)
JDK 1.6.0.18
Windows Vista Business

Thanks in advance

©2008 junlu.com - Jax Systems, LLC, U.S.A.