registering a DB2ConnectionPoolDataSource in tomcat 5.5

2007-07-26 Thread dileep_sivaraman

Hi ,

I am trying to register a com.ibm.db2.jcc.DB2ConnectionPoolDataSource
datasource in tomcat 5.5.4.

I am not getting any exception's while doing a context lookup and gives me
the datasource.
However the paramaeter's that are set with that Resource are always null.

Server.xml





In my code  I get the datasource as :

connPoolDataSource=(DB2ConnectionPoolDataSource)
envContext.lookup("jdbc/db2universal");

However when I print out the serverName parameter that has been set in the
resource it prints null.

System.out.println("connPoolDataSource.getServerName()
:"+connPoolDataSource.getServerName());

OUTPUT:

connPoolDataSource.getServerName() :null


Can somebody tell me what I  am doing wrong?
-- 
View this message in context: 
http://www.nabble.com/registering-a-DB2ConnectionPoolDataSource-in-tomcat--5.5-tf4155802.html#a11823991
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: MySql Connector

2007-07-26 Thread Mohammed Zabin
Ok guys, here we are. I have define the new resource inside a  tag
inside a  tag, as suggested by Tomcat documentation. I removed it and
put it inside  tag like the following:

1. Configure naming Resource:
inside  i put the following:


2. Inside web.xml:

  Oracle Datasource example
  jdbc/DBTest
  javax.sql.DataSource
  Container


3. Finally, you have to connect your server to the new resource. To do that,
inside context.xml put the following:


4. Test your code as follow:

<%@ page import = "java.sql.*, javax.naming.*, javax.sql.*" %>

<%

  Context initContext = new InitialContext();
   DataSource ds  =
  (DataSource)initContext.lookup("java:comp/env/jdbc/DBTest");

   Connection conn = ds.getConnection();

   out.println("Connection Established");

%>
Tomcat 6 documentation stated that you have to put naming resource
definition inside the Context tag. And this was the problem, when i removed
it from their it worked find and the connection established successfully.

Anyways, thank you very much buddies for your time and consideration. I am
always saying that the user of this mailing list are the best developers in
the world. ;)

On 7/26/07, Christopher Schultz <[EMAIL PROTECTED]> wrote:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Mohammed,
>
> Mohammed Zabin wrote:
> > If you looked at the exception you will find ClassNotFoundException at
> line
> > 66 in the generated servlet, and this occurs withing the try block, so,
> i
> > think it's a problem of Connector.
>
> You are seriously confused, here.
>
> Your code is not being compiled. Your code is not running. The fact that
> you have a try/catch block in your code is irrelevant.
>
> Why do you think that this "occurs" within the try block? Your stack
> trace does not include any references to your own code. It's simply not
> executing.
>
> And, even if this "occurred" within your try/catch block, you are
> foolishly swallowing all exceptions, meaning that you would never know
> what the problem was.
>
> > But the strange thing is that this
> > code worked fine on a normal java class???
>
> Probably because your "normal java class" actually compiled and ran.
> Something is wrong with your file, not your code.
>
> - -chris
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGqO9T9CaO5/Lv0PARAuXgAKDBgPM+osNL0y15at28q9YITixicACgqJte
> QOgTrjE+1cqeih2be83XEww=
> =dPUB
> -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: broker start up in Tomcat

2007-07-26 Thread Johnny Kewl
I dont know ActiveMQ but I think you will have to allow "any" WebApp that 
needs it, to start it, if its not already running I think you have 2 
options, create a custom JNDI object or create a singleton start up object 
in common/lib, here is an article 
http://www.javacoffeebreak.com/articles/designpatterns/index.html


Just remember that the lib is now shared and I imagine you call into this 
broker to send messages, if so remember to make it thread safe, it possibly 
is already.


I am curious about what you using it for... I have still to find application 
for JMS in the TC environment, because sending a message to a servlet from 
an embedded http client has always served me well... its on port 80, so no 
firewall problems etc. I guess its because you have message beans in an 
application server somewhere just wondering.


- Original Message - 
From: "suchitha koneru" <[EMAIL PROTECTED]>

To: 
Sent: Friday, July 27, 2007 12:48 AM
Subject: broker start up in Tomcat



Hello Tomcat Users,
I am using Tomcat server 5.5.20 along with Java 
1.6,

and Active MQ 4.1.1.  There are two web applications A and B which
communicate via the active mq broker. Our application has a requirement of
starting the broker before any of the web apps. Where should I be placing
the code which starts the broker.  I can create a jar file out of the code
and dependent libraries and place it in common/lib. How will I communicate
to Tomcat server that the broker has to be started during the server 
start

up  process, before any of the web apps ? Any pointers  in this regard ?

thank you ,
Suchitha.




-
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: broker start up in Tomcat

2007-07-26 Thread suchitha koneru
Thank you  Len for the suggested approach . The web apps should be
abstracted from the procedure of starting the broker, otherwise I'll end up
adding a servlet context listener for every new web app added to our
application. If possible, Iam looking for a way , in which Tomcat would
start the broker without any involvement from web applications.


On 7/26/07, Len Popp <[EMAIL PROTECTED]> wrote:
>
> Write a function in your shared lib that checks if Active MQ has been
> started yet, and starts it if not. Then, in each webapp add a
> ServletContextListener with a contextInitialized method that calls the
> aforementioned function. Thus, Active MQ will be initialized when the
> first webapp starts up, whichever it is.
> --
> Len
>
> On 7/26/07, suchitha koneru <[EMAIL PROTECTED]> wrote:
> > Hello Tomcat Users,
> >  I am using Tomcat server 5.5.20 along with Java
> 1.6,
> > and Active MQ 4.1.1.  There are two web applications A and B which
> > communicate via the active mq broker. Our application has a requirement
> of
> > starting the broker before any of the web apps. Where should I be
> placing
> > the code which starts the broker.  I can create a jar file out of the
> code
> > and dependent libraries and place it in common/lib. How will I
> communicate
> > to Tomcat server that the broker has to be started during the
> server  start
> > up  process, before any of the web apps ? Any pointers  in this regard ?
> >
> > thank you ,
> > Suchitha.
> >
>
> -
> 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: Bean and Servlet

2007-07-26 Thread Mohammed Zabin
On 7/27/07, Mohammed Zabin <[EMAIL PROTECTED]> wrote:
>
> Ok, in the first page, which use a tag, I generate 10 random numbers. and
> generate a SQL statement containing this numbers like the following:
> SELECT * FROM table WHERE id in ( 2, 3, 5, 10,  etc). I use a string
> to hold the " in " statement and bound it to the whole query string.
>
> After submitting the page, I need to check the validety of the answers,
> for the same questions. So, I store the inStr in a session and read it in
> the second page.
>
> Regarding concurrency issue, I think that I don't need to synchronize
> random number generation. Because I don't have a problem for multiple
> requests to have the same set of questions. The most important issue is that
> for a given request, I need to submit the same collection of questions
> to Results page. And so, i used session to store the questions ids'.
>
>
>  On 7/27/07, Pid <[EMAIL PROTECTED]> wrote:
> >
> > Caldarale, Charles R wrote:
> > >> From: Mohammed Zabin [mailto:[EMAIL PROTECTED] ]
> > >> Subject: Re: Bean and Servlet
> > >>
> > >> My Problem is that, I want to pass these numbers, Questions
> > >> IDs, from the first page, which i have made it as a tag class,
> > >> to Results page, which was made as servlet.
> > >
> > > Rather than hanging onto the ID within Tomcat, why not store it on the
> > > generated web page (as a hidden field) and have some script on that
> > page
> > > include it with the next request from the client?  That way you avoid
> > > all synchronization issues that can occur with simultaneous requests.
> >
> > It sounds like a simple form submit with (a) hidden field(s).
> >
> > Why do all of the rest of the ids need to be submitted as well, if
> > you're only checking for the single correct answer?
> >
> > p
> >
> >
> > >> That was my problem my buddy, by the way, when i used
> > >> session, it worked fine. and you stated that this will
> > >> not work
> > >
> > > I didn't say it wouldn't work, I said you had to be careful and take
> > > concurrency into account, which your code snippets did not.
> > >
> > >  - 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: Bean and Servlet

2007-07-26 Thread Mohammed Zabin
Ok, in the first page, which use a tag, I generate 10 random numbers. and
generate a SQL statement containing this numbers like the following:
SELECT * FROM table WHERE id in ( 2, 3, 5, 10,  etc). I use a string to
hold the " in " statement and bound it to the whole query string.

After submitting the page, I need to check the validety of the answers, for
the same questions. So, I store the inStr in a session and read it in the
second page.

Regarding concurrency issue, I think that I don't need to synchronize random
number generation. Because I don't have a problem for multiple requests to
have the same set of questions.


On 7/27/07, Pid <[EMAIL PROTECTED]> wrote:
>
> Caldarale, Charles R wrote:
> >> From: Mohammed Zabin [mailto:[EMAIL PROTECTED]
> >> Subject: Re: Bean and Servlet
> >>
> >> My Problem is that, I want to pass these numbers, Questions
> >> IDs, from the first page, which i have made it as a tag class,
> >> to Results page, which was made as servlet.
> >
> > Rather than hanging onto the ID within Tomcat, why not store it on the
> > generated web page (as a hidden field) and have some script on that page
> > include it with the next request from the client?  That way you avoid
> > all synchronization issues that can occur with simultaneous requests.
>
> It sounds like a simple form submit with (a) hidden field(s).
>
> Why do all of the rest of the ids need to be submitted as well, if
> you're only checking for the single correct answer?
>
> p
>
>
> >> That was my problem my buddy, by the way, when i used
> >> session, it worked fine. and you stated that this will
> >> not work
> >
> > I didn't say it wouldn't work, I said you had to be careful and take
> > concurrency into account, which your code snippets did not.
> >
> >  - 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: How to do this

2007-07-26 Thread Varuna Seneviratna
Hi  would you please elaborate on this I can't understand anything of this
verifying process please explain from the tiniest detail to the end
including how this verification helps to ensure the integrity of the
downloaded files and also what is the logic behind this method of
verification which makes it posible to use as a means of verifying the
integrity

On 7/27/07, Varuna Seneviratna <[EMAIL PROTECTED]> wrote:
>
>
>
> On 7/27/07, Varuna Seneviratna <[EMAIL PROTECTED]> wrote:
> >
> > Hi Greger would you please elaborate on this I can't understand anything
> > of this verifying process please explain from the tiniest detail to the end
> > including how this verification helps to ensure the integrity of the
> > downloaded files and also what is the logic behind this method of
> > verification which makes it posible to use as a means of verifying the
> > integrity
> >Thanks Varuna
> >
> >
> > On 7/27/07, Gregor Schneider < [EMAIL PROTECTED]> wrote:
> > >
> > > http://www.gnupg.org/
> > > --
> > > what's puzzlin' you, is the nature of my game
> > > gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
> > > gpgp-key available @ http://pgpkeys.pca.dfn.de:11371
> > >
> > > -
> > > To start a new topic, e-mail: users@tomcat.apache.org
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > Varuna Seneviratna
> > No 514 Udumulla Road
> > Battaramulla
> > Sri Lanka
> > Tel : 011-2888620
> >
>
>
>
> --
> Varuna Seneviratna
> No 514 Udumulla Road
> Battaramulla
> Sri Lanka
> Tel : 011-2888620
>



-- 
Varuna Seneviratna
No 514 Udumulla Road
Battaramulla
Sri Lanka
Tel : 011-2888620


Re: Comet example at Tomcat 6

2007-07-26 Thread Martin Gainty

Enable debugging for your tomcat instance
http://tomcat.apache.org/faq/development.html
be sure to install and configure either
commons-logging
OR
Log4J

Martin
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: "john x" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Thursday, July 26, 2007 9:50 PM
Subject: Re: Comet example at Tomcat 6



Tanks all of you !
I have success run it ;
But there still  some problems;
The chat pape  http://localhost:8080/examples/jsp/chat  can't visit by
other clients,and the page visit speed on local
is very slow.
Additional,I run ok at tomcat6.0.10, it didn't work at tomcat6.0.13
the  tomcat6.0.13 log show " ChatServlet: Error for session: " when I just
login.
Hope someone can help me.thank advance

2007/7/27, Reich, Matthias <[EMAIL PROTECTED]>:


Perhaps you should add this to the example:

protected void service(HttpServletRequest req, HttpServletResponse resp)
   throws ServletException, IOException
   {
  resp.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
  "you must be using the APR or NIO connector to get the event
method called" );
   }

> -Original Message-
> From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 26, 2007 5:18 PM
> To: Tomcat Users List
> Subject: Re: Comet example at Tomcat 6
>
> you must be using the APR or NIO connector
>
>protocol="org.apache.coyote.http11.Http11NioProtocol"   //or
>   protocol="org.apache.coyote.http11.Http11AprProtocol"
>
>
> Filip
> john x wrote:
> > Hi!
> > I just run the chat example ,but ,it seems did not work ;
> > the code seems can't reach the line
> >  begin(event, request, response)
> >
> > please help me fix that,thanks;
> >
> >
> >
> > john
> >
> >
> --
> --
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.476 / Virus Database: 269.10.19/917 - Release
> Date: 7/25/2007 1:16 AM
> >
>
>
> -
> 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: Comet example at Tomcat 6

2007-07-26 Thread john x

Tanks all of you !
I have success run it ;
But there still  some problems;
The chat pape  http://localhost:8080/examples/jsp/chat  can't visit by
other clients,and the page visit speed on local
is very slow.
Additional,I run ok at tomcat6.0.10, it didn't work at tomcat6.0.13
the  tomcat6.0.13 log show " ChatServlet: Error for session: " when I just
login.
Hope someone can help me.thank advance

2007/7/27, Reich, Matthias <[EMAIL PROTECTED]>:


Perhaps you should add this to the example:

protected void service(HttpServletRequest req, HttpServletResponse resp)
   throws ServletException, IOException
   {
  resp.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
  "you must be using the APR or NIO connector to get the event
method called" );
   }

> -Original Message-
> From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 26, 2007 5:18 PM
> To: Tomcat Users List
> Subject: Re: Comet example at Tomcat 6
>
> you must be using the APR or NIO connector
>
>protocol="org.apache.coyote.http11.Http11NioProtocol"   //or
>   protocol="org.apache.coyote.http11.Http11AprProtocol"
>
>
> Filip
> john x wrote:
> > Hi!
> > I just run the chat example ,but ,it seems did not work ;
> > the code seems can't reach the line
> >  begin(event, request, response)
> >
> > please help me fix that,thanks;
> >
> >
> >
> > john
> >
> >
> --
> --
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.476 / Virus Database: 269.10.19/917 - Release
> Date: 7/25/2007 1:16 AM
> >
>
>
> -
> 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: Invoker Not Invoking in 5.5.9

2007-07-26 Thread Bill Barker

>"W Strater" <[EMAIL PROTECTED]> wrote in message 
>news:[EMAIL PROTECTED]
>I know that the servlet invoker is not popular but that is what I have to 
>deal with.
>
>All of the servlets are invoked as 
>http://localhost:8080/servlets/com.domain.servlets.ServletName where the 
>/servlets is >the web app name.
>
>I would like to acheive to things.
>
>1) Ensure that only servlets within a package get invoked.
>2) Provide a catch all servlet.
>
>Here are my servlet mappings:
>
>
>
>
>invoker
>
>/com.domain.servlets.*
>
>
>

This doesn't do what you want.  It is an exact-match pattern for a URL that 
is litterally '/servlets/com.domain.servlets.*'.  And, even if it did work, 
Invoker would choke on the result.
>
>
>
>
>
>
>catchAll
>
>/*
>
>
>
>
>
>
>The problem is that the catchAll is getting every request despite being 
>defined after the invoker. I have even defined a >new servlet name, 
>, with the invoker class, 
>org.apache.catalina.servlets.InvokerServlet, still the catchAll gets all 
> >requests.
>
>Any suggestions?
>

Probably easiest is modifying the catchAll servlet to do something like (but 
I haven't tried it myself):
 String pathInfo = request.getPathInfo();
 if(pathInfo != null && pathInfo.startsWith("/com.domain.servlets.")) {
 RequestDispatcher rd = 
getServletContext().getNamedDispatcher("invoker");
 rd.forward(request, response);
 return;
}

I can't see how you could accomplish what you want otherwise, without 
changing your URL-space layout (since Invoker only works if it is 
prefix-mapped).
>
>Wes.
>




-
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: broker start up in Tomcat

2007-07-26 Thread Len Popp
Write a function in your shared lib that checks if Active MQ has been
started yet, and starts it if not. Then, in each webapp add a
ServletContextListener with a contextInitialized method that calls the
aforementioned function. Thus, Active MQ will be initialized when the
first webapp starts up, whichever it is.
-- 
Len

On 7/26/07, suchitha koneru <[EMAIL PROTECTED]> wrote:
> Hello Tomcat Users,
>  I am using Tomcat server 5.5.20 along with Java 1.6,
> and Active MQ 4.1.1.  There are two web applications A and B which
> communicate via the active mq broker. Our application has a requirement of
> starting the broker before any of the web apps. Where should I be placing
> the code which starts the broker.  I can create a jar file out of the code
> and dependent libraries and place it in common/lib. How will I communicate
> to Tomcat server that the broker has to be started during the server  start
> up  process, before any of the web apps ? Any pointers  in this regard ?
>
> thank you ,
> Suchitha.
>

-
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: URIEncoding

2007-07-26 Thread Frederic Bastian

Thanks for your help, that answers my question pretty well :)

Caldarale, Charles R a écrit :
From: Frederic Bastian [mailto:[EMAIL PROTECTED] 
Subject: Re: URIEncoding


Could you tell me a bit more about how MBean can solve my problem ? I 
never used it.



Tomcat creates MBeans for most of its internal objects, including
connectors:
http://tomcat.apache.org/tomcat-6.0-doc/mbeans-descriptor-howto.html

(The same is true for 5.5 if that's what you're using.)  The get/set
methods of the MBean allow you to inspect and modify the underlying
objects.  Start Tomcat with -Dcom.sun.management.jmxremote and use
JConsole to poke around inside it.  Look at the MBeans tab, then down
the Catalina -> Connector -> [port#] -> Attributes branch; you should
see URIEncoding as the first entry.

Study the javax.mananagement.* APIs for details on how to access MBeans.
You may want to look at this tutorial as well:
http://java.sun.com/j2se/1.5.0/docs/guide/management/overview.html

For examples of code that interrogates various MBeans within Tomcat,
wander through the Lambda Probe source:
http://lambdaprobe.org/d/index.htm

Using any of this makes your application Tomcat-specific, of course.

 - 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]



broker start up in Tomcat

2007-07-26 Thread suchitha koneru

Hello Tomcat Users,
I am using Tomcat server 5.5.20 along with Java 1.6,
and Active MQ 4.1.1.  There are two web applications A and B which
communicate via the active mq broker. Our application has a requirement of
starting the broker before any of the web apps. Where should I be placing
the code which starts the broker.  I can create a jar file out of the code
and dependent libraries and place it in common/lib. How will I communicate
to Tomcat server that the broker has to be started during the server  start
up  process, before any of the web apps ? Any pointers  in this regard ?

thank you ,
Suchitha.


Re: Http Header Cache-Control

2007-07-26 Thread gerocoma-forophp
I've got a great link for solving this problem. Take a
look at it. Hope that helps somebody.


http://www.onjava.com/pub/a/onjava/2004/03/03/filters.html




--- Christopher Schultz <[EMAIL PROTECTED]>
escribió:

> To whom it may concern,
> 
> [EMAIL PROTECTED] wrote:
> >> Something is wrong with that mod_jk version, by
> the way. The most
> >> recent release of mod_jk is 1.2.23.
> > 
> > Well, the installation file that I found in the
> server is named:
> > mod_jk-3.3-ap20.so, that's why I assumed that
> version.
> 
> Strange. You must have some odd packaged version of
> apache + mod_jk that
> has its own (confusing) version number.
> 
> > This [filter] method looks really cool, any way,
> does somebody knows
> > another solution. I read about configuring apache
> http.conf and/or
> > installing the headers module.
> 
> I'm sure you can do something like this using Apache
> httpd only, I'm
> just not sure how to do it.
> 
> > Is that filter installation the only way in which
> this could be
> > achieved with tomcat??
> 
> There are other ways, but this is the most
> convenient. Tomcat itself
> does not support anything like this (that I know
> of), so you basically
> have to solve this at an application level.
> 
> Hope that helps,
> -chris
> 
> 



  

¡Sé un mejor fotógrafo!
Perfecciona tu técnica y encuentra las mejores fotos.   
http://mx.yahoo.com/promos/mejorfotografo.html

-
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: URIEncoding

2007-07-26 Thread Caldarale, Charles R
> From: Frederic Bastian [mailto:[EMAIL PROTECTED] 
> Subject: Re: URIEncoding
> 
> Could you tell me a bit more about how MBean can solve my problem ? I 
> never used it.

Tomcat creates MBeans for most of its internal objects, including
connectors:
http://tomcat.apache.org/tomcat-6.0-doc/mbeans-descriptor-howto.html

(The same is true for 5.5 if that's what you're using.)  The get/set
methods of the MBean allow you to inspect and modify the underlying
objects.  Start Tomcat with -Dcom.sun.management.jmxremote and use
JConsole to poke around inside it.  Look at the MBeans tab, then down
the Catalina -> Connector -> [port#] -> Attributes branch; you should
see URIEncoding as the first entry.

Study the javax.mananagement.* APIs for details on how to access MBeans.
You may want to look at this tutorial as well:
http://java.sun.com/j2se/1.5.0/docs/guide/management/overview.html

For examples of code that interrogates various MBeans within Tomcat,
wander through the Lambda Probe source:
http://lambdaprobe.org/d/index.htm

Using any of this makes your application Tomcat-specific, of course.

 - 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: Bean and Servlet

2007-07-26 Thread Pid

Caldarale, Charles R wrote:
From: Mohammed Zabin [mailto:[EMAIL PROTECTED] 
Subject: Re: Bean and Servlet


My Problem is that, I want to pass these numbers, Questions 
IDs, from the first page, which i have made it as a tag class,

to Results page, which was made as servlet.


Rather than hanging onto the ID within Tomcat, why not store it on the
generated web page (as a hidden field) and have some script on that page
include it with the next request from the client?  That way you avoid
all synchronization issues that can occur with simultaneous requests.


It sounds like a simple form submit with (a) hidden field(s).

Why do all of the rest of the ids need to be submitted as well, if 
you're only checking for the single correct answer?


p


That was my problem my buddy, by the way, when i used 
session, it worked fine. and you stated that this will

not work


I didn't say it wouldn't work, I said you had to be careful and take
concurrency into account, which your code snippets did not.

 - 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]






smime.p7s
Description: S/MIME Cryptographic Signature


Re: URIEncoding

2007-07-26 Thread Frederic Bastian

Caldarale, Charles R a écrit :

Once again, it's available via the MBean that Tomcat creates for each
 element.

I'm sorry i should have missed your reply.

Could you tell me a bit more about how MBean can solve my problem ? I 
never used it.


-
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: URIEncoding

2007-07-26 Thread Caldarale, Charles R
> From: Frederic Bastian [mailto:[EMAIL PROTECTED] 
> Subject: Re: URIEncoding
> 
> how to know the Connector URIEncoding value, inside 
> your application ? :)

Once again, it's available via the MBean that Tomcat creates for each
 element.

 - 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: URIEncoding

2007-07-26 Thread Frederic Bastian

Christopher Schultz a écrit :

I'd agree that reading a URI is different, but not writing one. Where
are you writing your URI? Into the response, I'm guessing. In fact, I'm
guessing you're writing it into the response /body/, which ought to be
encoded using the response's declared Content-Type (in the HTTP header).
The encoding used for reading the URI from the request is irrelevant, here.
  
I disagree. Imagine that you want to write into the response /body/ a 
link to a google search, where the search parameter is the special char 
"&". Example : http://www.google.com/search?&q=%26
(so the correct way to write it in your response /body/ is: href="http://www.google.com/search?q=%26";>your search)


If you just write the link without url encoding or html entities 
encoding, the link will be wrong : href="http://www.google.com/search?q=&";>your search


If you write the link with html entities encoding, the link will be 
wrong : http://www.google.com/search?q=&";>your search


So you have to URLEncode your parameter, to write it into the response 
/body/: http://www.google.com/search?q=%26";>your search


So, to generate and write into the response body links that include user 
inputs into the parameters, you have to URLEncode the parameters, it is 
an absolute necessity !
And that's the point: you can URLEncode them into different character 
encodings. And if they are links to your own tomcat server, you need to 
URLEncode the parameters in the same character encoding than the 
 URIEncoding.

What makes you think that the Connector has the right answer in the
first place?
  


Because it is the Connector that will read your URI ;) And so, when 
URLEncoding links to your server, the character encoding has to be the same.

You will see that the server does not interpret correctly the
parameters, because the  URIEncoding is still set to ISO-8859-1.



If you are setting the URIEncoding of the Connector to UTF-8 and it's
not interpreting it as UTF-8, then Tomcat has a bug
I wrote : " URIEncoding is still set to ISO-8859-1" ;) 
ISO-8859-1 is the default value of the Connector URIEncoding.



Anyway, if we disagree, let's just get back to the point : how to know 
the Connector URIEncoding value, inside your application ? :)


-
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 and cookies caching issue

2007-07-26 Thread Riccardo

On 7/26/07, Rainer Jung <[EMAIL PROTECTED]> wrote:

Hi Riccardo,

if I understood your description correct, your Tomcat server itself
communicates with another backend to get the report. In this sentence it
is important, that Tomcat and not the browser talks to this backend.


You are right, when the request to run the report hits Tomcat, this
will send a request to a remote webserver where the report is built.
Between Tomcat and the remote server sits Apache httpd proxy
translating the url of the request with rules like

ProxyPass /reports/ http://x.y.z.w/reporting/
ProxyPassReverse /reports/ http://x.y.z.w/reporting/


I expect that you do this via HTTP as well.


Correct.


Note that there is no HTTP
client contained in Tomcat. Your webap must have an HTTP client bundled,
which the app uses to talk to the other server. This client might well
have some sort of cookie handling implemented, and it's the
responsibility of the using webapp to correctly use and configure the
HTTP client it bundled.


I'm not sure what you mean, in my case the external pages sourced from
the remote webserver are embedded into my webapp via an IFrame. In
these pages there's a form with the reports parameteres field, and
this form is submitted to the remote server to generate the report.

I started recently to work on this project, and honestly sometimes I'm
a bit confused about the route of the requests, but I believe that
when I submit a request to generate a report from the remote webserver
the path is: browser -> apache proxy -> tomcat -> apache proxy ->
remote webserver -> apache proxy -> tomcat -> apache proxy -> browser.

Maybe I should define some headers management rule within the webapp..
I haven't measured the time exactly, but i find quite interesting that
this caching effect lasts around 2 minutes, than disappears. I wonder
if it would be possible to set this time to 0 through some
parameter...


Thanks so much for your time
Riccardo





But I might have misunderstood you.

Regards,

Rainer

Riccardo wrote:
> On 7/26/07, Len Popp <[EMAIL PROTECTED]> wrote:
>> I don't think Tomcat caches cookie values. I could be wrong about
>> this, but it seems to me that Tomcat just gets the cookie value from
>> the request sent by the browser.
>
> I did a test to check this.
> After running a report I deleted the cookie from Firefox, tried to
> export and got the error message -> correct behaviour.
> But if I run the report, export to excel (and get the spreadsheet),
> rerun the report with different parameters, delete the cookie and
> click on export, I get the same spreadsheet as before. Looks like the
> request to the export asp file with the associated cookie gets cached
> for some reason.. and I don't believe is on Apache, because if I kill
> it and rerun it between the two export requests, the behaviour is the
> same.
>
>> Maybe you should log the value of the cookie in various different
>> spots so you can follow the cookie's progress and see where it gets
>> mixed up. Places where you could log or view the cookie are:
>> - in your app where it creates and uses the cookie values
>> - in the access log for both Tomcat and Apache (the docs describe how
>> to log cookie values)
>> - in the browser, using a tool like LiveHTTPHeaders or ieHTTPHeaders
>
> Yes, I'll try to check the content of the cookies in the different
> places.. i'll check out also the tools for the headers, that will be
> useful as well.
>
> Thanks for your time
> Riccardo
>
>
>
>
>
>> --
>> Len
>>
>> On 7/26/07, Riccardo <[EMAIL PROTECTED]> wrote:
>> > Hi,
>> > I'm experiencing a problem with cookies cached - probably - in Tomcat
>> > for a couple of minutes.
>> > I'm running a webapp into Tomcat, which also connects to an apache
>> > proxy to embed an external page into the tomcat webapp. I need the
>> > apache proxy to get rid of the Javascript safety problems that occur
>> > when trying to interact with a page sourced from another domain name.
>> > The problem: I run in the externally source page a report, setting a
>> > few parameters. These parameters with my selected values are stored in
>> > a cookie called "Reports". After running the report I can click on a
>> > link to export it to excel. The asp script on the remote server will
>> > retrieve the params values from the cookie and generate the
>> > appropriate excel sheet. Now if after running a report I run another
>> > one, the cookie on my browser gets correctly updated, but if after
>> > that I try to export to excel this new report what I get from the
>> > remote server is the same excel sheet as before. I checked the Reports
>> > cookie on my browser and I see it's correctly updated after each
>> > report run, but i noticed that what is sent to the remote server is
>> > not the cookie stored in my browser, but a previous cookie, cached - i
>> > suppose - in Tomcat, because the generated excel sheet is the same as
>> > before, as the first report i've run. If i wait two minutes though and
>>

Re: URIEncoding

2007-07-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Frederic,

Frederic Bastian wrote:
> I'm sorry but I think you don't get it :) Reading and writing URI is
> totally different from writing the response output.

I'd agree that reading a URI is different, but not writing one. Where
are you writing your URI? Into the response, I'm guessing. In fact, I'm
guessing you're writing it into the response /body/, which ought to be
encoded using the response's declared Content-Type (in the HTTP header).
The encoding used for reading the URI from the request is irrelevant, here.

> For instance, you
> can set the response character encoding to UTF-8 in order to display
> your html in UTF-8, and set the Connector URIEncoding to ISO-8859-1 to
> read URI in ISO-8859-1 (and so, you have to encode your URI in ISO-8859-1).

Yes, except that most browsers will use the encoding of the previous
response to encode the URI (unless you have "use UTF-8 URLs" turned on
in the options -- most browsers have this feature, and I think it's
turned on by default these days).

> For instance, If you want to make a redirection, you just send a
> redirection header, there is no response output writing, so no matter
> wich character encoding your web pages are displayed in.

Now we're getting somewhere. You didn't mention that you were talking
about a redirection URI, which will go into a header. The interesting
part now is that HTTP headers do not have a declared character encoding.
Most browsers use UTF-8 for URI encoding, but the headers use ASCII from
what I can tell from the spec.

So... how do you decide which character encoding to use for the URI? You
have to guess. It's stupid, but true. The browser will not tell you the
encoding it uses. Forcing your Connector to use ISO-8859-1 or UTF-8 is
just a guess, too. Using your own code to override the default for the
Connector is just adding confusion to a process already fraught with
problems.

What makes you think that the Connector has the right answer in the
first place?

> The point is that the character encoding of the  URIEncoding,
> and the character encoding of the URLEncoder method, have to be consistent.

I believe this to be true only under the following conditions:

1. You are writing a URI to be used in an HTTP header.
2. The URIEncoding used by your Connector was correct in the first
   place.

The only way to tell if the encoding was right in the first place is to
encode parameters whose values you /know/ and then check them on the
other end to see if the browser really was using UTF-8 or ISO-8859-1 (or
whatever).

> Make the try : set the response character encoding to UTF-8, set the
> URLEncoder character encoding to UTF-8, generate a web page including
> links with encoded parameters with special chars, and follow these
> links. You will see that the server does not interpret correctly the
> parameters, because the  URIEncoding is still set to ISO-8859-1.

If you are setting the URIEncoding of the Connector to UTF-8 and it's
not interpreting it as UTF-8, then Tomcat has a bug. Since you are the
only one experiencing this phenomenon, I'm guessing it's not a bug.

If you have everything set to UTF-8 (as I do in my production apps), you
should not have this problem.

> So, for portability purpose, I'd like to make the character encoding of
> the  and of the URLEncoder consistent, without modifying the
> server.xml file. But it looks pretty impossible :p

I disagree that the Connector knows any better than you do about how to
encode outgoing URLs. The browser is going to do whatever the heck it
wants, and it's not going to tell you what it did. You just have to guess.

- -chris

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

iD8DBQFGqQxo9CaO5/Lv0PARArLrAJsEtuEyh/60diLe+ttSlW4OO/tfIgCeLQwu
SvSvLxWBuucFh92vlMAUmu8=
=kvt9
-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: URIEncoding

2007-07-26 Thread Frederic Bastian

Christopher Schultz a écrit :

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Frederic,

Frederic Bastian wrote:
  

Christopher Schultz a écrit :


You want to do this:

java.net.URLEncoder.encode(myParam,
request.getCharacterEncoding());

  

This does not work :) request.getCharacterEncoding() is different
from  URIEncoding. The request character encoding
determines in which character encoding the parameters value will be
return to you.



My mistake. I meant response.getCharacterEncoding().

  

But it doesn't determine in wich character encoding the URI has to be
read.



But you aren't reading a URI. You're writing one. I'm assuming that you
want to encode a URI for output into a web page. The web page ought to
be written using the response's encoding, not the URIEncoding.
  
I'm sorry but I think you don't get it :) Reading and writing URI is 
totally different from writing the response output. For instance, you 
can set the response character encoding to UTF-8 in order to display 
your html in UTF-8, and set the Connector URIEncoding to ISO-8859-1 to 
read URI in ISO-8859-1 (and so, you have to encode your URI in ISO-8859-1).


For instance, If you want to make a redirection, you just send a 
redirection header, there is no response output writing, so no matter 
wich character encoding your web pages are displayed in.


The point is that the character encoding of the  URIEncoding, 
and the character encoding of the URLEncoder method, have to be consistent.
Make the try : set the response character encoding to UTF-8, set the 
URLEncoder character encoding to UTF-8, generate a web page including 
links with encoded parameters with special chars, and follow these 
links. You will see that the server does not interpret correctly the 
parameters, because the  URIEncoding is still set to ISO-8859-1.


So, for portability purpose, I'd like to make the character encoding of 
the  and of the URLEncoder consistent, without modifying the 
server.xml file. But it looks pretty impossible :p
  

What's the problem with URLEncoder ? I don't get you :)



Nothing. All the things I mentioned used them at the heart (or should).
They just take out the guesswork of which encoding you should be using,
and when to apply it.

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

iD8DBQFGqQJ29CaO5/Lv0PARAuhvAJ9vmHBfszi95wQyVlV2o36yZ4N8SQCfTqKN
puaAISUt3/OrGna00/8dvk4=
=B73f
-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]

  



-
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 with 8 GB memory

2007-07-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lightbulb,

lightbulb432 wrote:
> When I asked this question I had in mind a few potential downsides to one 8
> GB Tomcat. One is memory leaks: if Tomcat starts to leak memory (not sure if
> this happens too often, if ever, but I'm speaking purely hypothetically)
> then you'd rather not want your single Tomcat to eat up all the memory. If
> you had two Tomcat instances running the exact same application, then the
> memory leak is only affecting up to 4 GB?

Well, if you have them properly load-balanced, then they'll both run out
of memory at roughly the same time, right?

> The other is high-availability - if you have a huge 8 GB box and it's
> because you decide not to have 4 x 2 GB smaller boxes, then you definitely
> cannot get high-availability against hardware issues - but say you're
> pushing out an upgrade to the application (i.e. the WAR file). If you have
> two Tomcats, couldn't you bring one down while the other continues to serve
> requests, push out the upgrade, bring it back up, then do the same with the
> other application? With only one instance, you must have downtime right?

True. You only asked about performance. In terms of performance, fewer
moving parts is always better.

Distribution helps solve other problems like geographical load-balancing
to avoid network bottlenecks, improve availability (the more servers you
have, the more likely one of them is to be in service), and facilitate
roll-outs (upgrade one at a time). I generally find that the database
upgrade is the thing that kills you, and that you need to have at least
/some/ total down time to get everything in sync... re-deploying an
application (upgrading) takes much less time than changes to your database).

> The last is at the following link, several performance graphs for Linux show
> a slight or sharp decrease in performance for a given Tomcat instance beyond
> a certain number of users! Why is this? Wouldn't these diminishing returns,
> if true, severely cripple one 8 GB instance serving 2*n users compared to two
> 4 GB instances serving only n users?
> 
> http://www.webperformanceinc.com/library/reports/windows_vs_linux_part1/index.html

That's a good question. Having only looked at the graph and not read the
article in detail (or at all, really), I can only imagine that Linux and
Windows have different strategies of dealing with incoming connections
that the server software refuses to accept them. Perhaps Linux maintains
a larger queue of incoming connections than Windows does, resulting in
more successful connections, but slower response time for them.

- -chris

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

iD8DBQFGqQXO9CaO5/Lv0PARApehAKCyF5A1DtOR7t2nPlgLBQVEGQgjLACgv24j
ariI7RtyV/5qedgyWaoFt9A=
=lBfZ
-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]



Tomcat 6.0.13 and Windows Vista - Unable to open the service Tomcat6

2007-07-26 Thread Thimo Buchheister
Hi,

I have tried to install Tomcat 6.0.13 under Windows Vista Business (32-Bit).
I used the Windows Service installer which can be found at the Tomcat
Website (Tomcat is installed as automatic service). After setup completed,
Tomcat works properly; the service is running, I can browse to the Tomcat
site on localhost and the Tomcat symbol is on place.

After a system reboot, I get the following error message:

Unable to open the service 'Tomcat6'

The same happens when starting the configuration utility (from
start/programs and directly from the folder).

Tomcat is installed to "C:\Apache\Tomcat 6.0" and I gave for testing full
access to the directory and all subdirectory to "COMPUTER\MyUser" and
"COMPUTER\users". These changes didn't take effect.

If this is important: I use Windows Vista Business (32-Bit), JDK 1.6 Update
2 (the actual version from Sun). On the computer also runs an IIS 7...

I hope you can help me!

Thanks,

Thimo


-
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 with 8 GB memory

2007-07-26 Thread Caldarale, Charles R
> From: lightbulb432 [mailto:[EMAIL PROTECTED] 
> Subject: Re: Tomcat with 8 GB memory
> 
> The last is at the following link, several performance 
> graphs for Linux show a slight or sharp decrease in 
> performance for a given Tomcat instance beyond a certain
> number of users! Why is this?
>
http://www.webperformanceinc.com/library/reports/windows_vs_linux_part1/
index.html

Read the text, don't just look at the pictures:

"In the next part of this report, we will find that tuning the JVM
memory parameters resolve the performance slump that we saw in this
round of testing"

They overloaded a toy machine (512 MB - get serious) and saw GC issues.
Nothing to do with Tomcat, just with overrunning their setup.  Running
multiple instances of Tomcat (or any other Java application) means you
have _less_ aggregate heap memory available than for a single instance.

I suspect running with JRE 6 would avoid the slump even without tweaking
the heap settings, but I don't have time to verify that.

 - 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: URIEncoding

2007-07-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Frederic,

Frederic Bastian wrote:
> Christopher Schultz a écrit :
>> You want to do this:
>> 
>> java.net.URLEncoder.encode(myParam,
>> request.getCharacterEncoding());
>> 
> 
> This does not work :) request.getCharacterEncoding() is different
> from  URIEncoding. The request character encoding
> determines in which character encoding the parameters value will be
> return to you.

My mistake. I meant response.getCharacterEncoding().

> But it doesn't determine in wich character encoding the URI has to be
> read.

But you aren't reading a URI. You're writing one. I'm assuming that you
want to encode a URI for output into a web page. The web page ought to
be written using the response's encoding, not the URIEncoding.

> What's the problem with URLEncoder ? I don't get you :)

Nothing. All the things I mentioned used them at the heart (or should).
They just take out the guesswork of which encoding you should be using,
and when to apply it.

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

iD8DBQFGqQJ29CaO5/Lv0PARAuhvAJ9vmHBfszi95wQyVlV2o36yZ4N8SQCfTqKN
puaAISUt3/OrGna00/8dvk4=
=B73f
-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 and cookies caching issue

2007-07-26 Thread Rainer Jung

Hi Riccardo,

if I understood your description correct, your Tomcat server itself 
communicates with another backend to get the report. In this sentence it 
is important, that Tomcat and not the browser talks to this backend.


I expect that you do this via HTTP as well. Note that there is no HTTP 
client contained in Tomcat. Your webap must have an HTTP client bundled, 
which the app uses to talk to the other server. This client might well 
have some sort of cookie handling implemented, and it's the 
responsibility of the using webapp to correctly use and configure the 
HTTP client it bundled.


But I might have misunderstood you.

Regards,

Rainer

Riccardo wrote:

On 7/26/07, Len Popp <[EMAIL PROTECTED]> wrote:

I don't think Tomcat caches cookie values. I could be wrong about
this, but it seems to me that Tomcat just gets the cookie value from
the request sent by the browser.


I did a test to check this.
After running a report I deleted the cookie from Firefox, tried to
export and got the error message -> correct behaviour.
But if I run the report, export to excel (and get the spreadsheet),
rerun the report with different parameters, delete the cookie and
click on export, I get the same spreadsheet as before. Looks like the
request to the export asp file with the associated cookie gets cached
for some reason.. and I don't believe is on Apache, because if I kill
it and rerun it between the two export requests, the behaviour is the
same.


Maybe you should log the value of the cookie in various different
spots so you can follow the cookie's progress and see where it gets
mixed up. Places where you could log or view the cookie are:
- in your app where it creates and uses the cookie values
- in the access log for both Tomcat and Apache (the docs describe how
to log cookie values)
- in the browser, using a tool like LiveHTTPHeaders or ieHTTPHeaders


Yes, I'll try to check the content of the cookies in the different
places.. i'll check out also the tools for the headers, that will be
useful as well.

Thanks for your time
Riccardo






--
Len

On 7/26/07, Riccardo <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm experiencing a problem with cookies cached - probably - in Tomcat
> for a couple of minutes.
> I'm running a webapp into Tomcat, which also connects to an apache
> proxy to embed an external page into the tomcat webapp. I need the
> apache proxy to get rid of the Javascript safety problems that occur
> when trying to interact with a page sourced from another domain name.
> The problem: I run in the externally source page a report, setting a
> few parameters. These parameters with my selected values are stored in
> a cookie called "Reports". After running the report I can click on a
> link to export it to excel. The asp script on the remote server will
> retrieve the params values from the cookie and generate the
> appropriate excel sheet. Now if after running a report I run another
> one, the cookie on my browser gets correctly updated, but if after
> that I try to export to excel this new report what I get from the
> remote server is the same excel sheet as before. I checked the Reports
> cookie on my browser and I see it's correctly updated after each
> report run, but i noticed that what is sent to the remote server is
> not the cookie stored in my browser, but a previous cookie, cached - i
> suppose - in Tomcat, because the generated excel sheet is the same as
> before, as the first report i've run. If i wait two minutes though and
> click again the excel export function, the correct sheet is built. So
> looks like Tomcat caches the Reports cookie for two minutes and this
> overrides the browser cookie.
> Another confirmation of this is that if I delete the Reports cookie
> from my browser after running a report, and click on export to excel,
> I still get the excel sheet, whereas after a couple of minutes the
> sheet can't be built anymore and some microsoft runtime error is
> generated.
>
> I was first thinking that it could be the apache proxy to cause this,
> so i tried to shut it down and up again after running a report and
> before trying to export it to see if it lost the cookie value in its
> cache, but this was not the case, so I ended up assuming the caching
> is happening inside Tomcat.
>
> I'm using Tomcat 5.0.28 and apache http server 2.2.4.
>
> Any suggestion will be much appreciated as i've alredy wasted a lot of
> time on this issue!!
>
> -
> 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

Re: Tomcat and cookies caching issue

2007-07-26 Thread Riccardo

On 7/26/07, Len Popp <[EMAIL PROTECTED]> wrote:

I don't think Tomcat caches cookie values. I could be wrong about
this, but it seems to me that Tomcat just gets the cookie value from
the request sent by the browser.


I did a test to check this.
After running a report I deleted the cookie from Firefox, tried to
export and got the error message -> correct behaviour.
But if I run the report, export to excel (and get the spreadsheet),
rerun the report with different parameters, delete the cookie and
click on export, I get the same spreadsheet as before. Looks like the
request to the export asp file with the associated cookie gets cached
for some reason.. and I don't believe is on Apache, because if I kill
it and rerun it between the two export requests, the behaviour is the
same.


Maybe you should log the value of the cookie in various different
spots so you can follow the cookie's progress and see where it gets
mixed up. Places where you could log or view the cookie are:
- in your app where it creates and uses the cookie values
- in the access log for both Tomcat and Apache (the docs describe how
to log cookie values)
- in the browser, using a tool like LiveHTTPHeaders or ieHTTPHeaders


Yes, I'll try to check the content of the cookies in the different
places.. i'll check out also the tools for the headers, that will be
useful as well.

Thanks for your time
Riccardo






--
Len

On 7/26/07, Riccardo <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm experiencing a problem with cookies cached - probably - in Tomcat
> for a couple of minutes.
> I'm running a webapp into Tomcat, which also connects to an apache
> proxy to embed an external page into the tomcat webapp. I need the
> apache proxy to get rid of the Javascript safety problems that occur
> when trying to interact with a page sourced from another domain name.
> The problem: I run in the externally source page a report, setting a
> few parameters. These parameters with my selected values are stored in
> a cookie called "Reports". After running the report I can click on a
> link to export it to excel. The asp script on the remote server will
> retrieve the params values from the cookie and generate the
> appropriate excel sheet. Now if after running a report I run another
> one, the cookie on my browser gets correctly updated, but if after
> that I try to export to excel this new report what I get from the
> remote server is the same excel sheet as before. I checked the Reports
> cookie on my browser and I see it's correctly updated after each
> report run, but i noticed that what is sent to the remote server is
> not the cookie stored in my browser, but a previous cookie, cached - i
> suppose - in Tomcat, because the generated excel sheet is the same as
> before, as the first report i've run. If i wait two minutes though and
> click again the excel export function, the correct sheet is built. So
> looks like Tomcat caches the Reports cookie for two minutes and this
> overrides the browser cookie.
> Another confirmation of this is that if I delete the Reports cookie
> from my browser after running a report, and click on export to excel,
> I still get the excel sheet, whereas after a couple of minutes the
> sheet can't be built anymore and some microsoft runtime error is
> generated.
>
> I was first thinking that it could be the apache proxy to cause this,
> so i tried to shut it down and up again after running a report and
> before trying to export it to see if it lost the cookie value in its
> cache, but this was not the case, so I ended up assuming the caching
> is happening inside Tomcat.
>
> I'm using Tomcat 5.0.28 and apache http server 2.2.4.
>
> Any suggestion will be much appreciated as i've alredy wasted a lot of
> time on this issue!!
>
> -
> 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: How to do this

2007-07-26 Thread Varuna Seneviratna
On 7/27/07, Varuna Seneviratna <[EMAIL PROTECTED]> wrote:
>
> Hi Greger would you please elaborate on this I can't understand anything
> of this verifying process please explain from the tiniest detail to the end
> including how this verification helps to ensure the integrity of the
> downloaded files and also what is the logic behind this method of
> verification which makes it posible to use as a means of verifying the
> integrity
>Thanks Varuna
>
>
> On 7/27/07, Gregor Schneider <[EMAIL PROTECTED]> wrote:
> >
> > http://www.gnupg.org/
> > --
> > what's puzzlin' you, is the nature of my game
> > gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
> > gpgp-key available @ http://pgpkeys.pca.dfn.de:11371
> >
> > -
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Varuna Seneviratna
> No 514 Udumulla Road
> Battaramulla
> Sri Lanka
> Tel : 011-2888620
>



-- 
Varuna Seneviratna
No 514 Udumulla Road
Battaramulla
Sri Lanka
Tel : 011-2888620


Re: URIEncoding

2007-07-26 Thread Frederic Bastian

Christopher Schultz a écrit :

You want to do this:

java.net.URLEncoder.encode(myParam, request.getCharacterEncoding());
  


This does not work :) request.getCharacterEncoding() is different from 
 URIEncoding. The request character encoding determines in 
wich character encodig the parameters value will be return to you. But 
it doesn't determine in wich character encoding the URI has to be read.

Or, you could do what everybody else in the world does and use a tag
library or some other tool to emit URLs including parameters, etc.
  

What's the problem with URLEncoder ? I don't get you :)


Aah, I get it. I don't believe this is possible. I'd love to hear from a
Tomcat developer, though, just to be safe


that  would be fine :)

-
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: How to do this

2007-07-26 Thread Varuna Seneviratna
Hi Greger would you please elaborate on this I can't understand anything of
this verifying process please explain from the tiniest detail to the end
including how this verification helps to ensure the integrity of the
downloaded files and also what is the logic behind this method of
verification which makes it posible to use as a means of verifying the
integrity
   Thanks Varuna


On 7/27/07, Gregor Schneider <[EMAIL PROTECTED]> wrote:
>
> http://www.gnupg.org/
> --
> what's puzzlin' you, is the nature of my game
> gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
> gpgp-key available @ http://pgpkeys.pca.dfn.de:11371
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Varuna Seneviratna
No 514 Udumulla Road
Battaramulla
Sri Lanka
Tel : 011-2888620


Re: Tomcat/AJP Client Abort Socket Errors - Leads to File Descriptor Leak

2007-07-26 Thread Andrew Lee Rubinger
Thank you so much for all your help.  Will post back if a conclusion is 
determined, or if it's ruled out that AJP/Tomcat is not the cause.


S,
ALR

Rainer Jung wrote:

Hi Andrew,

this snapshot looks normal. There are 11 connections used and both sides 
have the same idea about their state.


Web server to Tomcat connections are managed by mod_jk via pools. The 
pool can grow, and if you configure a connection pool idle timeout, it 
will also shrink. Each web server process has its own pool. For Apache 
the default maximum size is equal to the number of request processing 
threads per process.


The prefork Apache MPM uses a single thread per process, so you will end 
up with a single connection per web server process (at least if the 
process already forwarded at most one request to tomcat). The total 
maximum number of connections will then be equal to the maximum number 
of Apache processes configured.


The worker MPM has a configurable number of threads per process, by 
default 25. The total maximum number of connections will be the maximum 
number of processes configured multiplied with the number of threads per 
process.


The default configuration for prefork is 150 processes = connections, 
for worker it is 6 processes with 25 threads each, again = 150 connections.


If your load goes up, the number of processes will grow and more and 
more connections get established.


If you want those to get closed again during idle times, you find hints 
about that in the timeouts document.


Important: you need to set the thread count in the connector element for 
the AJP connector to match the expected maximum of connections, that 
should be handled by Tomcat. Each incoming connection needs a dedicated 
thread, unless you are using the native APR connector.


Keep fd leak hunting. Many admins forget about this tradition.

Regards,

Rainer

Andrew Lee Rubinger wrote:

Hi.

Rainer Jung wrote:
Do you have special evidence, that the broken piepe errors correlate 
to the increase in file descriptors? Or are you only assuming this, 
because you can't find any other errors in the logs?


Assuming.  Should have made this more clear.

Can you see the connections for the file descriptors on the Apache 
machine and on the Tomcat machine (using netstat)? Are they in the 
same state? Which state?


Attached as file. :)

At the moment I see no correlation between the client abort and a 
lost backend connection. There is another possible issue, if the file 
descriptor leak happens during tiume of low load. 


FD Leak seems to occur at higher rate during high load.

Since we just had a post about this on the list, I'm simply citing my 
last answer from another mail. Even if you think this does not apply 
to you, you should read the document the text refers to:
If your analysis is correct, it's a known problem, that firewalls 
often drop idle connections, so mod_jk and Tomcat should both be 
configured to shut down idle connections. On the Tomcat side you 
should use the attribute connectionTimeout in the configuration of 
your AJP Connector in server.xml. The units are in milliseconds, so 
10 Minutes would be 60. On the mod_jk side you should use 
connection_pool_timeout, units are seconds, so 10 minutes are 600.


Thanks so much; will absolutely look into this.

We have a new docs page about these things, which will go live next 
week with our 1.2.24 release. There is a preview for the page under


http://people.apache.org/~rjung/mod_jk-dev/docs/generic_howto/timeouts.html 



The next release 1.2.24 will include some improvements for this 
situation, but you would still need the timeouts on both ends.


Thanks so much for your help.  Again, not 100% sure this is a ModJK 
issue (especially after your comments), but those are my only errors 
in the logs and it seemed a natural conclusion.


S,
ALR


-
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: Tomcat with 8 GB memory

2007-07-26 Thread lightbulb432

When I asked this question I had in mind a few potential downsides to one 8
GB Tomcat. One is memory leaks: if Tomcat starts to leak memory (not sure if
this happens too often, if ever, but I'm speaking purely hypothetically)
then you'd rather not want your single Tomcat to eat up all the memory. If
you had two Tomcat instances running the exact same application, then the
memory leak is only affecting up to 4 GB?

The other is high-availability - if you have a huge 8 GB box and it's
because you decide not to have 4 x 2 GB smaller boxes, then you definitely
cannot get high-availability against hardware issues - but say you're
pushing out an upgrade to the application (i.e. the WAR file). If you have
two Tomcats, couldn't you bring one down while the other continues to serve
requests, push out the upgrade, bring it back up, then do the same with the
other application? With only one instance, you must have downtime right?

The last is at the following link, several performance graphs for Linux show
a slight or sharp decrease in performance for a given Tomcat instance beyond
a certain number of users! Why is this? Wouldn't these diminishing returns,
if true, severly cripple one 8 GB instance serving 2*n users compared to two
4 GB instances serving only n users?

http://www.webperformanceinc.com/library/reports/windows_vs_linux_part1/index.html




Christopher Schultz-2 wrote:
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Lightbulb,
> 
> lightbulb432 wrote:
>> If you have a gigantic server with something like 8 GB of memory, what
>> would
>> be the best way to run Tomcat 6 on it? One instance, multiple instances,
>> or
>> divide it up into two or more virtualized servers each with one instance?
> 
> Unless you have concerns about stability of TC6 or your own application,
> one big JVM with a ton of threads would be my recommendation.
> Virtualization or multiple TC instances only adds overhead with no other
> real benefit. (If you run multiple applications, multiple TC instances
> might make sense).
> 
>> Is Tomcat meant to run as one instance with that much memory, or is it
>> optimized for a different amount of memory?
> 
> Tomcat shouldn't care. I think that thread synchronization is faster
> than full context switching, but that can be very sensitive to the
> platform, OS, and tuning parameters you might have (in the OS). Java is
> perfectly happy to run with 8GB.
> 
>> I realize with the options I mentioned above there are implications
>> regarding high-availability and performance, but I'm not sure exactly
>> what
>> they'd be. Perhaps someone with more knowledge of this kind of stuff
>> could
>> comment.
> 
> If you trust your operating system (I would trust any UNIX and UNIX-like
> OS, and Windows is somewhat dependable if you don't ask it to do too
> many things), then a single instance of the OS on a lot of hardware is
> just fine: go for it.
> 
> If you are concerned about your OS's stability, then by all means run
> multiple instances of the OS and load balance between. From a strict
> performance standpoint, less is more, so stick to one OS and one Tomcat
> instance on that big, fat machine.
> 
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFGqOyq9CaO5/Lv0PARAlTDAJwKFLgizNh/MatDmEupjdLvLvvDWgCfbHSj
> XLO50tctVgV5w+N/qwYYZEQ=
> =DJLh
> -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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Tomcat-with-8-GB-memory-tf4149367.html#a11817605
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: Tomcat/AJP Client Abort Socket Errors - Leads to File Descriptor Leak

2007-07-26 Thread Rainer Jung

Hi Andrew,

this snapshot looks normal. There are 11 connections used and both sides 
have the same idea about their state.


Web server to Tomcat connections are managed by mod_jk via pools. The 
pool can grow, and if you configure a connection pool idle timeout, it 
will also shrink. Each web server process has its own pool. For Apache 
the default maximum size is equal to the number of request processing 
threads per process.


The prefork Apache MPM uses a single thread per process, so you will end 
up with a single connection per web server process (at least if the 
process already forwarded at most one request to tomcat). The total 
maximum number of connections will then be equal to the maximum number 
of Apache processes configured.


The worker MPM has a configurable number of threads per process, by 
default 25. The total maximum number of connections will be the maximum 
number of processes configured multiplied with the number of threads per 
process.


The default configuration for prefork is 150 processes = connections, 
for worker it is 6 processes with 25 threads each, again = 150 connections.


If your load goes up, the number of processes will grow and more and 
more connections get established.


If you want those to get closed again during idle times, you find hints 
about that in the timeouts document.


Important: you need to set the thread count in the connector element for 
the AJP connector to match the expected maximum of connections, that 
should be handled by Tomcat. Each incoming connection needs a dedicated 
thread, unless you are using the native APR connector.


Keep fd leak hunting. Many admins forget about this tradition.

Regards,

Rainer

Andrew Lee Rubinger wrote:

Hi.

Rainer Jung wrote:
Do you have special evidence, that the broken piepe errors correlate 
to the increase in file descriptors? Or are you only assuming this, 
because you can't find any other errors in the logs?


Assuming.  Should have made this more clear.

Can you see the connections for the file descriptors on the Apache 
machine and on the Tomcat machine (using netstat)? Are they in the 
same state? Which state?


Attached as file. :)

At the moment I see no correlation between the client abort and a lost 
backend connection. There is another possible issue, if the file 
descriptor leak happens during tiume of low load. 


FD Leak seems to occur at higher rate during high load.

Since we just had a post about this on the list, I'm simply citing my 
last answer from another mail. Even if you think this does not apply 
to you, you should read the document the text refers to:
If your analysis is correct, it's a known problem, that firewalls 
often drop idle connections, so mod_jk and Tomcat should both be 
configured to shut down idle connections. On the Tomcat side you 
should use the attribute connectionTimeout in the configuration of 
your AJP Connector in server.xml. The units are in milliseconds, so 10 
Minutes would be 60. On the mod_jk side you should use 
connection_pool_timeout, units are seconds, so 10 minutes are 600.


Thanks so much; will absolutely look into this.

We have a new docs page about these things, which will go live next 
week with our 1.2.24 release. There is a preview for the page under


http://people.apache.org/~rjung/mod_jk-dev/docs/generic_howto/timeouts.html 



The next release 1.2.24 will include some improvements for this 
situation, but you would still need the timeouts on both ends.


Thanks so much for your help.  Again, not 100% sure this is a ModJK 
issue (especially after your comments), but those are my only errors in 
the logs and it seemed a natural conclusion.


S,
ALR


-
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/AJP Client Abort Socket Errors - Leads to File Descriptor Leak

2007-07-26 Thread Andrew Lee Rubinger

Hi.

Rainer Jung wrote:
Do you have special evidence, that the broken piepe errors correlate to 
the increase in file descriptors? Or are you only assuming this, because 
you can't find any other errors in the logs?


Assuming.  Should have made this more clear.

Can you see the connections for the file descriptors on the Apache 
machine and on the Tomcat machine (using netstat)? Are they in the same 
state? Which state?


Attached as file. :)

At the moment I see no correlation between the client abort and a lost 
backend connection. There is another possible issue, if the file 
descriptor leak happens during tiume of low load. 


FD Leak seems to occur at higher rate during high load.

Since we just had a 
post about this on the list, I'm simply citing my last answer from 
another mail. Even if you think this does not apply to you, you should 
read the document the text refers to:
If your analysis is correct, it's a known problem, that firewalls often 
drop idle connections, so mod_jk and Tomcat should both be configured to 
shut down idle connections. On the Tomcat side you should use the 
attribute connectionTimeout in the configuration of your AJP Connector 
in server.xml. The units are in milliseconds, so 10 Minutes would be 
60. On the mod_jk side you should use connection_pool_timeout, units 
are seconds, so 10 minutes are 600.


Thanks so much; will absolutely look into this.

We have a new docs page about these things, which will go live next week 
with our 1.2.24 release. There is a preview for the page under


http://people.apache.org/~rjung/mod_jk-dev/docs/generic_howto/timeouts.html

The next release 1.2.24 will include some improvements for this 
situation, but you would still need the timeouts on both ends.


Thanks so much for your help.  Again, not 100% sure this is a ModJK 
issue (especially after your comments), but those are my only errors in 
the logs and it seemed a natural conclusion.


S,
ALR
netstat -a |grep 8009
tcp0  0 192.168.10.16:47348 192.168.10.10:8009  
ESTABLISHED 
tcp0  0 192.168.10.16:47349 192.168.10.10:8009  
ESTABLISHED 
tcp0  0 192.168.10.16:47351 192.168.10.10:8009  
ESTABLISHED 
tcp0  0 192.168.10.16:47328 192.168.10.10:8009  
ESTABLISHED 
tcp0  0 192.168.10.16:47331 192.168.10.10:8009  
ESTABLISHED 
tcp0  0 192.168.10.16:47340 192.168.10.10:8009  
ESTABLISHED 
tcp0  0 192.168.10.16:47341 192.168.10.10:8009  
ESTABLISHED 
tcp0  0 192.168.10.16:47312 192.168.10.10:8009  
ESTABLISHED 
tcp0  0 192.168.10.16:47314 192.168.10.10:8009  
ESTABLISHED 
tcp0  0 192.168.10.16:47324 192.168.10.10:8009  
ESTABLISHED 
tcp0  0 192.168.10.16:47323 192.168.10.10:8009  
ESTABLISHED 
netstat -a |grep 8009
tcp0  0 192.168.10.10:8009  *:* 
LISTEN  
tcp0  0 192.168.10.10:8009  192.168.10.16:47312 
ESTABLISHED 
tcp0  0 192.168.10.10:8009  192.168.10.16:47314 
ESTABLISHED 
tcp0  0 192.168.10.10:8009  192.168.10.16:47324 
ESTABLISHED 
tcp0  0 192.168.10.10:8009  192.168.10.16:47323 
ESTABLISHED 
tcp0  0 192.168.10.10:8009  192.168.10.16:47328 
ESTABLISHED 
tcp0  0 192.168.10.10:8009  192.168.10.16:47331 
ESTABLISHED 
tcp0  0 192.168.10.10:8009  192.168.10.16:47341 
ESTABLISHED 
tcp0  0 192.168.10.10:8009  192.168.10.16:47340 
ESTABLISHED 
tcp0  0 192.168.10.10:8009  192.168.10.16:47349 
ESTABLISHED 
tcp0  0 192.168.10.10:8009  192.168.10.16:47348 
ESTABLISHED 
tcp0  0 192.168.10.10:8009  192.168.10.16:47351 
ESTABLISHED 

-
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 and 6 Security advise

2007-07-26 Thread Craig Skinner
On Thu, Jul 26, 2007 at 03:24:28PM +0300, Peter Stavrinides wrote:
> It makes for interesting reading, however it was written for Tomcat 4... 
> how current is it?? and nothing is mentioned about the benefits of 
> running Apache with Tomcat for securing Tomcat in a purely Java 
> environment, please read the question Craig!

Oh, so you are the one that uses the JavaOS. I was wondering who it was.

Since you are interested in security, I assume that you are using some
sort of UNIX-a-like OS, and that reference discusses chroot, user id's,
packet filtering, etc, etc. These things don't change much WRT TC
release points.

If you are using Solaris, as I guess you are since you work for thieves,
err, a financial company, then you could use zones for tomcat & apache.

I guess you missed the items in the pdf that Chuck spoon fed you.

-
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: URIEncoding

2007-07-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Frederic,

Frederic Bastian wrote:
> The point is that I need to use the java.net.URLEncoder.encode() method,
> e.g. java.net.URLEncoder.encode(myParam, "UTF-8").

You ought to be using the response's character encoding, not whatever
Tomcat (or the browser) is using for URIEncoding.

You want to do this:

java.net.URLEncoder.encode(myParam, request.getCharacterEncoding());

Or, you could do what everybody else in the world does and use a tag
library or some other tool to emit URLs including parameters, etc.

- -chris

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

iD8DBQFGqPMB9CaO5/Lv0PARAiyhAJ4zYvszzqRzArWTfHxMIIWN3sU5aQCfRlBs
g5X8A0Fh88S5Mrmii+Ylg8g=
=y7Mj
-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/AJP Client Abort Socket Errors - Leads to File Descriptor Leak

2007-07-26 Thread Rainer Jung

Andrew Lee Rubinger wrote:

Hi.

I am running Apache HTTPD 2.2.4 with ModJK 1.2.21, both compiled from 
source on CentOS 4.4.  I have a workers.properties file configured to 
send requests to Tomcat 5.5 on a separate machine within the internal 
network.


When receiving a ClientAbortException from Tomcat (shown in 
"tomcat_broken_pipe_error.txt"), it seems that the socket connection 
between ModJK and Tomcat is not closed out, and on the Application 
Server running Tomcat I'm observing a Life Descriptor leak (as shown in 
"lsof.txt").


I've tried setting "recovery_options" to 4 as suggested by 
http://tomcat.apache.org/connectors-doc/reference/workers.html, but this 
has not corrected the problem.


Have attached all relevant log excerpts and configurations in hopes that 
someone has come across this and might have some insight.


Thanks in advance for your help.  Will be happy to provide any other 
information I may have excluded.


Do you have special evidence, that the broken piepe errors correlate to 
the increase in file descriptors? Or are you only assuming this, because 
you can't find any other errors in the logs?


Can you see the connections for the file descriptors on the Apache 
machine and on the Tomcat machine (using netstat)? Are they in the same 
state? Which state?


At the moment I see no correlation between the client abort and a lost 
backend connection. There is another possible issue, if the file 
descriptor leak happens during tiume of low load. Since we just had a 
post about this on the list, I'm simply citing my last answer from 
another mail. Even if you think this does not apply to you, you should 
read the document the text refers to:


...

If your analysis is correct, it's a known problem, that firewalls often 
drop idle connections, so mod_jk and Tomcat should both be configured to 
shut down idle connections. On the Tomcat side you should use the 
attribute connectionTimeout in the configuration of your AJP Connector 
in server.xml. The units are in milliseconds, so 10 Minutes would be 
60. On the mod_jk side you should use connection_pool_timeout, units 
are seconds, so 10 minutes are 600.


We have a new docs page about these things, which will go live next week 
with our 1.2.24 release. There is a preview for the page under


http://people.apache.org/~rjung/mod_jk-dev/docs/generic_howto/timeouts.html

The next release 1.2.24 will include some improvements for this 
situation, but you would still need the timeouts on both ends.


...

Regards,

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: URIEncoding

2007-07-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

Caldarale, Charles R wrote:
>> From: Frederic Bastian [mailto:[EMAIL PROTECTED] 
>> Subject: Re: URIEncoding
>>
>> Is there a way to get the value of the param URIEncoding of the 
>> Connector, so your code will work, whatever the char encoding of the 
>> Connector is ?
> 
> I'm confused.  If the  already has the proper URIEncoding
> value, why do you think the application needs to reprocess the URI with
> the same encoding?

He's trying to beat the Connector into using an application-defined
URIEncoding without having to modify server.xml to set up the connector
properly.

Frederic, why are you trying to do this? Are you deploying an
application on a Tomcat over which you have no control?

- -chris

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

iD8DBQFGqPIP9CaO5/Lv0PARAvVyAKCP+bx1oD64GCFI220GSpP7SeN2xgCgp/cd
lg85Bvd8Sf+vlk2Rx/JYHNM=
=dWBq
-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: Execute method each request

2007-07-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Trumml,

Trumml wrote:
> I want to execute a method each time a request is performed to my jsf site.
> The implementation for this request should remain in a jar file which is
> packed into the WAR file under WEB-INF/lib directory.
> I guess there is no solution to do this with a valve, because the class
> (jar) for the valve must remain inside tomcat classpath I guess.

Don't use a valve. Use a Filter. These were designed to be deployed as
part of your application, instead of being provided by Tomcat.

Look at the servlet API for javax.servlet.Filter (it's an interface).
Implementing it is easy: just read the javadoc before you begin and
you'll be good to go.

- -chris

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

iD8DBQFGqPAH9CaO5/Lv0PARAheAAJ0dRPWqCirlFGuQP2dLgla0PCwYXwCgnMLb
7tDsS/ldmm4hSeB1G9bY3N4=
=xhw5
-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: Mod_jk error

2007-07-26 Thread Filip Hanik - Dev Lists

also solves your problem

+JkDisableReuse

in httpd.conf

Filip


Rainer Jung wrote:

André Vila Cova wrote:

Red Hat Enterprise Linux AS release 4 (Nahant Update 5)

Release :  Jakarta-Tomcat 5.5.20

Modulo nativo APR:  tomcat-connectors-1.2.20

JVM versão. : Sun JVM1.5.0_11

I think that apache web server don't receive response from tomcat and 
don't
send final ack to tomcat and tomcat don't free threads.I see every 
logs from

oracle executions and duration of TOP SQL is very low.
I made test using the same architecture without firewall and everything
works fine. Tomcat free threads and send complete response to web 
server.


If your analysis is correct, it's a known problem, that firewalls 
often drop idle connections, so mod_jk and Tomcat should both be 
configured to shut down idle connections. On the Tomcat side you 
should use the attribute connectionTimeout in the configuration of 
your AJP Connector in server.xml. The units are in milliseconds, so 10 
Minutes would be 60. On the mod_jk side you should use 
connection_pool_timeout, units are seconds, so 10 minutes are 600.


We have a new docs page about these things, which will go live next 
week with our 1.2.24 release. There is a preview for the page under


http://people.apache.org/~rjung/mod_jk-dev/docs/generic_howto/timeouts.html 



The next release 1.2.24 will some improvements for this situation, but 
you would still need the timeouts on bith ends.


For a plausibility check, if this really is your problem, you could 
compare "netstat -an" (only the lines corresponding to your Tomcat AJP 
port) on the Apache and on the Tomcat side, and also check with the 
JVM Thread Dump (kill -QUIT to Tomcat; it will not die, but write a 
list of all threads with a stack for each of them to catalina.out). If 
the firewall dropped the connections, most likely the two netstat 
outputs will show an inconsistent state for the connections. Tomcat 
threads, which sit listening on an idle connection will be shown in 
the thread dump as reading from the socket.


Regards,

Rainer


Thanks.



On 7/26/07, Rainer Jung <[EMAIL PROTECTED]> wrote:


Hi,

you didn't give us your versions, you platform or any configuration 
info.


André Vila Cova wrote:
> Hello!
>
> Apache mod_jk returns following error (frequently...):
>
> [Thu Jul 26 11:07:52 2007] [2703:1120] [error]
> ajp_connection_tcp_get_message::jk_ajp_common.c (948): (app02_aol) 
can't
> receive the response message from tomcat, network problems or 
tomcat is

> down
> (192.168.40.11:8007), err=-104
> [Thu Jul 26 11:07:52 2007] [2703:1120] [error]
> ajp_get_reply::jk_ajp_common.c (1566): (app02_aol) Tomcat is down or
> refused
> connection. No response has been sent to the client (yet)
>

The 104 is the errno of your local platform. For Linux 104 is
"Connection reset by peer".

> We have two firewalls between Apache Web Server and Tomcat Web , 
but we

> didn't see nothing wrong in firewalls logs.

> Response appear on browser, but seems that no ack flag arrives to
webserver
> to finish request. Tomcat crashs with error All threads (400) are
currently
> *busy*, waiting. Increase *maxThreads* (400) or check the servlet
status.

The above log entry is for only a single request. You write that the
response actually goes back to the browser, but I guess you mean "most
of the requests", or are you sure that this single request produced a
response?

No idea, what you mean by "crash"? If this message appears, it means,
that all the threads you have configured in you thread pool of the
tomcat connector are busy by running a request. Since you configured 
400
threads max, this might actually mean, that something is to slow in 
your

app or in some backend your app is using, so the requests take to long
and the system becomes congested. In this situation take a java thread
dump to check, what those 400 threads are actually doing.

> Is it a configuration problem? May I setup some parameter to resolve
> problem?

If only we knew your configuration ...

Regards,

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]






-
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: URIEncoding

2007-07-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Frederic,

Frederic Bastian wrote:
> The matter is that Tomcat won't get the correct values of the parameters
> in the URL. For instance :
> 
> If my URI looks like : http://host/?query=%C3%A9%C3%A8
> The URI encoding is UTF-8
> 
> By default, Tomcat will read this url in ISO-8859-1.

Yes, but you said that you changed the  to use UTF-8. Is it
not working? Or, are you looking for an alternative so that you don't
/have to/ set the 's URIEncoding?

> If I add into server.xml the attribut URIEncoding="UTF-8" to the
> Connector, Tomcat will correctly read the "query" parameter.
> I would like Tomcat to read correctly URL in UTF-8, but without
> modifying server.xml.

Aah, I get it. I don't believe this is possible. I'd love to hear from a
Tomcat developer, though, just to be safe.

- -chris

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

iD8DBQFGqPC89CaO5/Lv0PARAsppAKCk/bkUphulQmhqOt9rsvvM6kWwKgCgjQkM
CtW/PpMkqPJfrMF9I6Jz/fQ=
=tfXB
-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 with 8 GB memory

2007-07-26 Thread Caldarale, Charles R
> From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
> Subject: Re: Tomcat with 8 GB memory
> 
> Why would a 64-bit machine run slower than a 32-bit machine?

Try an IA64 - the sooner we forget about those the better.

> I don't think JVMs have used stop-the-world GC for some time, now.

Strictly speaking, they still do, but global suspends occur much, much
less frequently and for much shorter periods, so in most environments
it's of negligible impact.

 - 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: MySql Connector

2007-07-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mohammed,

Mohammed Zabin wrote:
> If you looked at the exception you will find ClassNotFoundException at line
> 66 in the generated servlet, and this occurs withing the try block, so, i
> think it's a problem of Connector.

You are seriously confused, here.

Your code is not being compiled. Your code is not running. The fact that
you have a try/catch block in your code is irrelevant.

Why do you think that this "occurs" within the try block? Your stack
trace does not include any references to your own code. It's simply not
executing.

And, even if this "occurred" within your try/catch block, you are
foolishly swallowing all exceptions, meaning that you would never know
what the problem was.

> But the strange thing is that this
> code worked fine on a normal java class???

Probably because your "normal java class" actually compiled and ran.
Something is wrong with your file, not your code.

- -chris

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

iD8DBQFGqO9T9CaO5/Lv0PARAuXgAKDBgPM+osNL0y15at28q9YITixicACgqJte
QOgTrjE+1cqeih2be83XEww=
=dPUB
-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: How to do this

2007-07-26 Thread Gregor Schneider
http://www.gnupg.org/
-- 
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
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 with 8 GB memory

2007-07-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Joe,

Joe Nathan wrote:
> I would discourage to use such machine! 8GB means you are using 64 bit
> machine which will be much slower than 32 bit machines.

Huh? Why would a 64-bit machine run slower than a 32-bit machine? Even
better: why would either outperform the other when you haven't said what
you're doing? For instance, a 32-bit machine trying to run 64-bit
operations is hideously slow. A 64-bit machine running 32-bit operations
should be just as fast as its 32-bit cousin, since it's getting no
advantage with those wasted 32 extra bits per integer.

I can't think of a single reason why a 64-bit processor would perform
worse than a comparable 32-bit processor running the same code. The
advantage of a 64-bit processor is access to more (flat) memory and it
can do bigger operations with less scratch work.

With comparable hardware, I would expect a 64-bit JVM (on 64-bit HW) to
perform identically to a 32-bit JVM (on 32-bit HW) when running the same
application (assuming that no heavy mathematical calculations are being
done that could benefit from 64-bit capability).

> Big memory is useful
> ONLY if you have applications that can benefit big memory such as database
> systems. In Java, if you use lots of memory and create lots of objects, your
> Java applications will have periodic [seizures]!

Hm. I don't think JVMs have used stop-the-world GC for some time, now.

> This is because of garbage
> collection will take significant time, if started. 

Full GCs happen very rarely, unless you are abusing your heap.

> I would be happy with 1 ~ 2 GB 32bit machines! This could deliver much
> faster services.

While a fleet of 2GB commodity boxes do have their advantages, you don't
have to set up complicated load balancing if you've got one huge machine
that can do everything ;)

- -chris

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

iD8DBQFGqO5W9CaO5/Lv0PARApZvAJ9IJzzysOWlNEM9nqZb7uProue7YwCgwegp
B8rE+zmpCLU7zeqWIG8ctVQ=
=PtaY
-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 5.0.28 - SSL Setup

2007-07-26 Thread Lyallex

The first thing that strikes me is that you have not defined a connector for
port 8443, here's one of mine (Tomcat 5.5.23)



I think you probably need this because (at the very least) you have
'redirectPort="8443"' in your non ssl Connector config

Rgds
Duncan

On 7/26/07, Jeffrey C. Baldwin <[EMAIL PROTECTED]> wrote:

Hello All,

I'm in a bit of a pinch here.  Just had an old Solaris server fail that
housed our TomCat environment and now I'm trying to put the pieces back
together on a new server.  I have a few of the applications up and
running.. but now I've run into an app that wants to run over ssl and
I'm having a hard time getting it to work.

Environment:  Tomcat 5.0.28 running on CentOS 5

I am including my server.xml below.

I have already generated my certificate after reading this document and
put the cert into /usr/local/tomcat:
http://tomcat.apache.org/tomcat-5.0-doc/ssl-howto.html

Can someone please advice me on how to get ssl up and running on  port 8443?



  
  
  



  
factory
org.apache.catalina.users.MemoryUserDatabaseFactory
  
  
pathname
conf/tomcat-users.xml
  

  
  










  

  



-
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: Having both Manager and non-default webapps as root

2007-07-26 Thread Caldarale, Charles R
> From: Propes, Barry L [mailto:[EMAIL PROTECTED] 
> Subject: RE: Having both Manager and non-default webapps as root
> 
> Ok, Chuck...get ready.

And I'm trying to get out of here to go to Oshkosh...

> From: dracus [mailto:[EMAIL PROTECTED]
> Subject: Having both Manager and non-default webapps as root
> 
> 
> 
> 
> 

Where to begin...

First, don't put  elements in server.xml; really bad form when
much more flexible alternatives are available.

Second, an empty appBase is guaranteed to cause problems.  I'm surprised
Tomcat comes up at all.

Third, to do what you I think you want (different default apps for each
developer), you'll need to set up a  for each one, so that they
can each have a unique appBase.  With each appBase directory, the
developer must deploy their default app under the name ROOT.

Fourth, you'll need to put a manager.xml file under each
conf/Catalina/[host], all with the same absolute docBase that points to
the location of the manager app.

Fifth, you might try to tell us the version of Tomcat you're working
with.

 - 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]



Tomcat/AJP Client Abort Socket Errors - Leads to File Descriptor Leak

2007-07-26 Thread Andrew Lee Rubinger

Hi.

I am running Apache HTTPD 2.2.4 with ModJK 1.2.21, both compiled from 
source on CentOS 4.4.  I have a workers.properties file configured to 
send requests to Tomcat 5.5 on a separate machine within the internal 
network.


When receiving a ClientAbortException from Tomcat (shown in 
"tomcat_broken_pipe_error.txt"), it seems that the socket connection 
between ModJK and Tomcat is not closed out, and on the Application 
Server running Tomcat I'm observing a Life Descriptor leak (as shown in 
"lsof.txt").


I've tried setting "recovery_options" to 4 as suggested by 
http://tomcat.apache.org/connectors-doc/reference/workers.html, but this 
has not corrected the problem.


Have attached all relevant log excerpts and configurations in hopes that 
someone has come across this and might have some insight.


Thanks in advance for your help.  Will be happy to provide any other 
information I may have excluded.


S,
ALR
[Thu Jul 26 10:40:30 2007] [9723:33888] [info]  ajp_process_callback::jk_ajp_common.c (1447): Writing to client aborted or client network problems
[Thu Jul 26 10:40:30 2007] [9723:33888] [info]  ajp_service::jk_ajp_common.c (1846): (worker1) request failed, because of client write error without recovery in send loop attempt=0
[Thu Jul 26 10:40:30 2007] [9723:33888] [info]  jk_handler::mod_jk.c (2190): Aborting connection for worker=worker1
shell> lsof | grep java |grep protocol |cat -n

   1  java  29220   root  268u sock0,4 
1320191 can't identify protocol

...

   206  java  29220   root  268u sock0,4 
1320191 can't identify protocol
   207  java  29220   root  271u sock0,4 
1311912 can't identify protocol
   208  java  29220   root  272u sock0,4 
1314866 can't identify protocol
   209  java  29220   root  274u sock0,4 
1318451 can't identify protocol
   210  java  29220   root  275u sock0,4 
1316105 can't identify protocol
   211  java  29220   root  282u sock0,4 
1317445 can't identify protocol
   212  java  29220   root  283u sock0,4 
1320665 can't identify protocol
   213  java  29220   root  286u sock0,4 
1320672 can't identify protocol
   214  java  29220   root  357u sock0,4 
1312810 can't identify protocol
java.net.SocketException: Broken pipe
 at java.net.SocketOutputStream.socketWrite0(Native Method)
 at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
 at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
 at org.apache.jk.common.ChannelSocket.send(ChannelSocket.java:531)
 at org.apache.jk.common.JkInputStream.endMessage(JkInputStream.java:112)
 at org.apache.jk.core.MsgContext.action(MsgContext.java:293)
 at org.apache.coyote.Response.action(Response.java:182)
 at org.apache.coyote.Response.finish(Response.java:304)
 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:204)
 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
 at 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
 at 
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
 at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
 at java.lang.Thread.run(Thread.java:595)
# Create 1 Worker
worker.list=worker1
  
# Worker 1 Properties
worker.worker1.type=ajp13
worker.worker1.host=192.168.10.10
worker.worker1.port=8009
worker.worker1.recovery_options=4

-
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 refuses to return dynamically generated images from TCD-deployed war

2007-07-26 Thread Steve Widmar
I'll end the suspense.

For this use case (5.5.23, TCD, filesys R/W), direct access on the
webapps subdirs seems inadvisable.
Using the container (spec. ServletContext) for every abs path access
(R,W) proved the solution.  

I thank me for my help on this - 

Cheers,
Steve

-Original Message-
From: Steve Widmar [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 24, 2007 8:43 AM
To: Tomcat Users List
Subject: Tomcat refuses to return dynamically generated images from
TCD-deployed war

We use TCD [
http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html#Deploying%20
using%20the%20Client%20Deployer%20Package ] for each deployment of one
project's .war file - to deploy .wars onto remote hosts, as well as
local ones during development.

One feature in this .war is dynamic generation of .png images.

For some reason, Tomcat will only return an image (or list the image
filename when the image directory URI is requested) if the image was in
the .war when it was uploaded.  If the image is dynamically generated,
it won't be returned for a direct request and it won't be listed in a
directory listing (yes listings set to true in tomcat's web.xml, yes
other files & static images are displaying in directory listings).  

This is true for static images copied in after war deployment (say, a
.gif from the jsp-examples) as well as for the dynamically generated
images in question - neither displays in a listing nor is returned
(regardless of how the browser is refreshed).   And yes, the dynamically
generated images are otherwise fine - they load & look like they're
supposed to when accessed directly from the filesystem.

I've searched the web and mailing lists, I see no comments on this issue
so here I am.   Hoping it's something boneheaded & simple.

Guidance, anyone?

Cheers & thanks,
Steve Widmar

Ps: Tomcat 5.5.23, jvm 1.5.

-
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: Tomcat with 8 GB memory

2007-07-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lightbulb,

lightbulb432 wrote:
> If you have a gigantic server with something like 8 GB of memory, what would
> be the best way to run Tomcat 6 on it? One instance, multiple instances, or
> divide it up into two or more virtualized servers each with one instance?

Unless you have concerns about stability of TC6 or your own application,
one big JVM with a ton of threads would be my recommendation.
Virtualization or multiple TC instances only adds overhead with no other
real benefit. (If you run multiple applications, multiple TC instances
might make sense).

> Is Tomcat meant to run as one instance with that much memory, or is it
> optimized for a different amount of memory?

Tomcat shouldn't care. I think that thread synchronization is faster
than full context switching, but that can be very sensitive to the
platform, OS, and tuning parameters you might have (in the OS). Java is
perfectly happy to run with 8GB.

> I realize with the options I mentioned above there are implications
> regarding high-availability and performance, but I'm not sure exactly what
> they'd be. Perhaps someone with more knowledge of this kind of stuff could
> comment.

If you trust your operating system (I would trust any UNIX and UNIX-like
OS, and Windows is somewhat dependable if you don't ask it to do too
many things), then a single instance of the OS on a lot of hardware is
just fine: go for it.

If you are concerned about your OS's stability, then by all means run
multiple instances of the OS and load balance between. From a strict
performance standpoint, less is more, so stick to one OS and one Tomcat
instance on that big, fat machine.

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

iD8DBQFGqOyq9CaO5/Lv0PARAlTDAJwKFLgizNh/MatDmEupjdLvLvvDWgCfbHSj
XLO50tctVgV5w+N/qwYYZEQ=
=DJLh
-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: URIEncoding

2007-07-26 Thread Caldarale, Charles R
> From: Frederic Bastian [mailto:[EMAIL PROTECTED] 
> Subject: Re: URIEncoding
> 
> The point is that I need to use the 
> java.net.URLEncoder.encode() method, 
> e.g. java.net.URLEncoder.encode(myParam, "UTF-8").

O.k., so now it appears you need to know the encoding in order to do it
properly on the output side, whereas all the examples being tossed
around earlier in this thread were concerned with the request URI, not a
generated one.  That explains quite a bit.

> I would like to use URLEncoder.encode() method with the character 
> encoding UTF-8 (W3C recommendations). So, I MUST modify the Connector 
> URIEncoding parameter, but I don't want to, to improve portability.

It's available via the MBeans created for each , so you could
get at it with JMX.

 - 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: How to Verify

2007-07-26 Thread Mladen Turk

Varuna Seneviratna wrote:

I don't know how to do what you are telling.


Do you know what PGP is?


Please instruct me step by step
of verifying the integrity of the downloaded file from the moment after
downloading


My instructions was clear thought.
Sorry if that doesn't rings you any bell.

Look at the
http://httpd.apache.org/download.cgi
(Verify the integrity of the files)
It might help.


Regards,
Mladen.


-
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: How to Verify

2007-07-26 Thread Rainer Jung

Hi,

if Mladen's informati9on is to short for you, various more explicit 
descriptions are available at:


http://www.apache.org/dev/release-signing.html#check-integrity

http://people.apache.org/~henkp/md5/doc.html

http://www.apache.org/dist/httpd/README.html

Regards,

Rainer

Varuna Seneviratna wrote:

I don't know how to do what you are telling.Please instruct me step by step
of verifying the integrity of the downloaded file from the moment after
downloading
  Thanks Varuna

On 7/26/07, Mladen Turk <[EMAIL PROTECTED]> wrote:

Varuna Seneviratna wrote:

How to Verify the integrity of the downloaded files using the pgp

signatures

and mds checksums and also what is the method used to calculate the

checksum

Thanks Varuna


Download KEYS file, see:
http://tomcat.apache.org/download-60.cgi

direct link:
http://www.apache.org/dist/tomcat/tomcat-6/KEYS

% pgpk -a KEYS
% pgpv tomcat-xxx.tar.gz.asc
or
% pgp -ka KEYS
% pgp tomcat-xxx.tar.gz.asc
or
% gpg --import KEYS
% gpg --verify tomcat-xxx.tar.gz.asc

Regards,
Mladen

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







--
--
kippdata
informationstechnologie GmbH   Tel: 0228 98549 -0
Bornheimer Str. 33aFax: 0228 98549 -50
53111 Bonn www.kippdata.de

HRB 8018 Amtsgericht Bonn / USt.-IdNr. DE 196 457 417
Geschäftsführer: Dr. Thomas Höfer, Rainer Jung, Sven Maurmann
===
kippdata
informationstechnologie GmbH   Tel: +49 228 98549 -0
Bornheimer Str. 33aFax: +49 228 98549 -50
D-53111 Bonn   www.kippdata.de

HRB 8018 Amtsgericht Bonn / USt.-IdNr. DE 196 457 417
Geschäftsführer: Dr. Thomas Höfer, Rainer Jung, Sven Maurmann

-
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: How to Verify

2007-07-26 Thread Varuna Seneviratna
I don't know how to do what you are telling.Please instruct me step by step
of verifying the integrity of the downloaded file from the moment after
downloading
  Thanks Varuna

On 7/26/07, Mladen Turk <[EMAIL PROTECTED]> wrote:
>
> Varuna Seneviratna wrote:
> > How to Verify the integrity of the downloaded files using the pgp
> signatures
> > and mds checksums and also what is the method used to calculate the
> checksum
> >
> > Thanks Varuna
> >
>
> Download KEYS file, see:
> http://tomcat.apache.org/download-60.cgi
>
> direct link:
> http://www.apache.org/dist/tomcat/tomcat-6/KEYS
>
> % pgpk -a KEYS
> % pgpv tomcat-xxx.tar.gz.asc
> or
> % pgp -ka KEYS
> % pgp tomcat-xxx.tar.gz.asc
> or
> % gpg --import KEYS
> % gpg --verify tomcat-xxx.tar.gz.asc
>
> Regards,
> Mladen
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Varuna Seneviratna
No 514 Udumulla Road
Battaramulla
Sri Lanka
Tel : 011-2888620


RE: Bean and Servlet

2007-07-26 Thread Caldarale, Charles R
> From: Mohammed Zabin [mailto:[EMAIL PROTECTED] 
> Subject: Re: Bean and Servlet
> 
> My Problem is that, I want to pass these numbers, Questions 
> IDs, from the first page, which i have made it as a tag class,
> to Results page, which was made as servlet.

Rather than hanging onto the ID within Tomcat, why not store it on the
generated web page (as a hidden field) and have some script on that page
include it with the next request from the client?  That way you avoid
all synchronization issues that can occur with simultaneous requests.

> That was my problem my buddy, by the way, when i used 
> session, it worked fine. and you stated that this will
> not work

I didn't say it wouldn't work, I said you had to be careful and take
concurrency into account, which your code snippets did not.

 - 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: How to Verify

2007-07-26 Thread Mladen Turk

Varuna Seneviratna wrote:

How to Verify the integrity of the downloaded files using the pgp signatures
and mds checksums and also what is the method used to calculate the checksum

Thanks Varuna



Download KEYS file, see:
http://tomcat.apache.org/download-60.cgi

direct link:
http://www.apache.org/dist/tomcat/tomcat-6/KEYS

% pgpk -a KEYS
% pgpv tomcat-xxx.tar.gz.asc
or
% pgp -ka KEYS
% pgp tomcat-xxx.tar.gz.asc
or
% gpg --import KEYS
% gpg --verify tomcat-xxx.tar.gz.asc

Regards,
Mladen

-
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: content header missing using IIS, tomcat and axis

2007-07-26 Thread Rainer Jung
Can you check, if the attachment to the request has been received 
completely by your Tomcat webapp?


Regards,

Rainer

Daniel Dang wrote:

Hi there,

 I am using IIS version 6.0 talk to tomcat version 5.5.16 with mod_jk
and axis version 2.4 
client recieved xml soap message fine. The problem is when axis setting

a
 attachments client recieved http error 500

The same server code working fine for apache but not for IIS
here is a content header below exception:

[Thu Jul 26 09:42:29 2007] [2968:3748] [debug] jk_ajp_common.c (1043):
received from ajp13 pos=0 len=69 max=8192
 .Internal.Server.Error.
Content-Type...text/xml;charset=utf-8status = 500
Number of headers is = 1
Header[0] [Content-Type] = [text/xml;charset=utf-8]
received from ajp13 pos=0 len=2258 max=8192
...

http://schemas.xmlsoap.org/soap/envelope/".xmlns:xsd="http://www.w3.org/2001/XMLSchema
".xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>

http://xml.apache.org/axis/";>ns1:Server
Server.Error

http://xml.apache.org/axis/";>Server.Error

...at.org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:473)

...at.org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)

...at.org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)

...at.javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

...at.org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)

...at.javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

...at.org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
...at.org.apache.catalina.core.ApplicationFilterCh


Any idea of this problem, thank you in advance!

--Daniel



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



How to Verify

2007-07-26 Thread Varuna Seneviratna
How to Verify the integrity of the downloaded files using the pgp signatures
and mds checksums and also what is the method used to calculate the checksum

Thanks Varuna

-- 
Varuna Seneviratna
No 514 Udumulla Road
Battaramulla
Sri Lanka
Tel : 011-2888620


content header missing using IIS, tomcat and axis

2007-07-26 Thread Daniel Dang
Hi there,

 I am using IIS version 6.0 talk to tomcat version 5.5.16 with mod_jk
and axis version 2.4 
client recieved xml soap message fine. The problem is when axis setting
a
 attachments client recieved http error 500

The same server code working fine for apache but not for IIS
here is a content header below exception:

[Thu Jul 26 09:42:29 2007] [2968:3748] [debug] jk_ajp_common.c (1043):
received from ajp13 pos=0 len=69 max=8192
 .Internal.Server.Error.
Content-Type...text/xml;charset=utf-8status = 500
Number of headers is = 1
Header[0] [Content-Type] = [text/xml;charset=utf-8]
received from ajp13 pos=0 len=2258 max=8192
...

http://schemas.xmlsoap.org/soap/envelope/".xmlns:xsd="http://www.w3.org/2001/XMLSchema
".xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>

http://xml.apache.org/axis/";>ns1:Server
Server.Error

http://xml.apache.org/axis/";>Server.Error

...at.org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:473)

...at.org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)

...at.org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)

...at.javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

...at.org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)

...at.javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

...at.org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
...at.org.apache.catalina.core.ApplicationFilterCh


Any idea of this problem, thank you in advance!

--Daniel



-
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 and cookies caching issue

2007-07-26 Thread Len Popp
I don't think Tomcat caches cookie values. I could be wrong about
this, but it seems to me that Tomcat just gets the cookie value from
the request sent by the browser.

Maybe you should log the value of the cookie in various different
spots so you can follow the cookie's progress and see where it gets
mixed up. Places where you could log or view the cookie are:
- in your app where it creates and uses the cookie values
- in the access log for both Tomcat and Apache (the docs describe how
to log cookie values)
- in the browser, using a tool like LiveHTTPHeaders or ieHTTPHeaders
-- 
Len

On 7/26/07, Riccardo <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm experiencing a problem with cookies cached - probably - in Tomcat
> for a couple of minutes.
> I'm running a webapp into Tomcat, which also connects to an apache
> proxy to embed an external page into the tomcat webapp. I need the
> apache proxy to get rid of the Javascript safety problems that occur
> when trying to interact with a page sourced from another domain name.
> The problem: I run in the externally source page a report, setting a
> few parameters. These parameters with my selected values are stored in
> a cookie called "Reports". After running the report I can click on a
> link to export it to excel. The asp script on the remote server will
> retrieve the params values from the cookie and generate the
> appropriate excel sheet. Now if after running a report I run another
> one, the cookie on my browser gets correctly updated, but if after
> that I try to export to excel this new report what I get from the
> remote server is the same excel sheet as before. I checked the Reports
> cookie on my browser and I see it's correctly updated after each
> report run, but i noticed that what is sent to the remote server is
> not the cookie stored in my browser, but a previous cookie, cached - i
> suppose - in Tomcat, because the generated excel sheet is the same as
> before, as the first report i've run. If i wait two minutes though and
> click again the excel export function, the correct sheet is built. So
> looks like Tomcat caches the Reports cookie for two minutes and this
> overrides the browser cookie.
> Another confirmation of this is that if I delete the Reports cookie
> from my browser after running a report, and click on export to excel,
> I still get the excel sheet, whereas after a couple of minutes the
> sheet can't be built anymore and some microsoft runtime error is
> generated.
>
> I was first thinking that it could be the apache proxy to cause this,
> so i tried to shut it down and up again after running a report and
> before trying to export it to see if it lost the cookie value in its
> cache, but this was not the case, so I ended up assuming the caching
> is happening inside Tomcat.
>
> I'm using Tomcat 5.0.28 and apache http server 2.2.4.
>
> Any suggestion will be much appreciated as i've alredy wasted a lot of
> time on this issue!!
>
> -
> 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: Did anyone had problems with JspWriter in Tomcat 5.5.17?

2007-07-26 Thread Borut Hadžialić

I found the cause of the problem.

Tomcat's implementation of javax.servlet.http.HttpServlet implements
the doGet method like this:

   protected void doHead(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
   {
NoBodyResponse response = new NoBodyResponse(resp);

doGet(req, response);
response.setContentLength();
   }

The problem occurs when a HTTP HEAD request arrives for a page that
isn't in the page cache.

When a HTTP HEAD request is received for a page that is not in the
cache, the caching filter prepares a response wrapper that will
capture the request (content generated by the application's servlets),
puts that wrapper in the place of the real response, for the filters
and servlets next in the chain, and gives the execution to the next
filter/servlet in chain..

But, for HTTP HEAD requests, the caching wrapper never gets to the
servlets that generate content, because the above method wraps it in
NoBodyResponse, a response wrapper that throws away everything that is
writen to it, like /dev/null does... servlets write content to
NoBodyResponse, and the content is lost.

On the way back, the caching filter inspects the response wrapper it
created, sees 200 response code, and decides that the page was
generated well, and caches it... (the content doesn't get cached
because NoBodyResponse didnt forward it to the response it wrapped -
caching filter's response wrapper)

I will fix my caching filter to watch for this special case, and that
will solve the problem in our applications... but I wonder if it is
okay that Tomcat (silently) wraps the response inside a wrapper like
NoBodyResponse that eats content.. or was it my fault that I didn't
explicitly make difference between GET and HEAD requests when thinking
about caching, probably because of lack of expirience..


--
Why?
Because YES!

-
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: URIEncoding

2007-07-26 Thread Frederic Bastian

Caldarale, Charles R a écrit :
From: Frederic Bastian [mailto:[EMAIL PROTECTED] 
Subject: Re: URIEncoding


Is there a way to get the value of the param URIEncoding of the 
Connector, so your code will work, whatever the char encoding of the 
Connector is ?



I'm confused.  If the  already has the proper URIEncoding
value, why do you think the application needs to reprocess the URI with
the same encoding?
  


The point is that I need to use the java.net.URLEncoder.encode() method, 
e.g. java.net.URLEncoder.encode(myParam, "UTF-8").


Using a different character encoding than the Connector URIEncoding 
leads to problems ; for instance, if the Connector URIEncoding is set to 
"ISO-8859-1" (default value), and the URLEncoder.encode() method set to 
"UTF-8" => problems (one obvious solution is to modify the URIEncoding)


I would like to use URLEncoder.encode() method with the character 
encoding UTF-8 (W3C recommendations). So, I MUST modify the Connector 
URIEncoding parameter, but I don't want to, to improve portability.


So I would like to manage this problem in the application itself rather 
than in server.xml, for portability purposes. The only solution I see is 
to find a way to get the value of the URIEncoding parameters.


-
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: MySql Connector

2007-07-26 Thread David Smith
CATALINA_HOME/lib implies this is tomcat 6 and that would be the proper 
place for the mysql jar file.  However the poster should NEVER mess with 
the classpath in tomcat as it does cause s many headaches.


--David

Propes, Barry L wrote:


did you also have the Oracle jar file in that lib directory? I would have 
thought you'd want it in the common/lib dir.


-Original Message-
From: Mohammed Zabin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 25, 2007 12:52 AM
To: Tomcat Users List
Subject: Re: MySql Connector


In cotrast, i have installed Oracle and worked very well, but MySql didn't
work with me. I am using Connecter/J from MySql website, the beta version, I
put the jar file in the CATALINA_HOME/lib, and i add it to the CLASSPATH.
and I followed the instructions provided in Tomcat documentation, exactly,
Didn't work :(

On 7/24/07, David Smith <[EMAIL PROTECTED]> wrote:
 


I've never dealt with Oracle but have done a lot of MySQL installs
without a single failure.  Your config outside of the web.xml doesn't
look wrong in any way.

You might want to put the  block in your web.xml as
described in the how-to's.  It doesn't hurt and is part of the servlet
spec.

--David


Mohammed Zabin wrote:

   


No, the same error, You know what David?? I put nothing in web.xml, I am
confused about this issue, when to use web.xml, and it might be the
reason
behind the unsuccessfull MySql Connection, I follow the same procedure I
followed to configure Oracle DBCP, I think it must work for MySql,
 


right?
   


On 7/24/07, David Smith <[EMAIL PROTECTED]> wrote:

 


Try this variant of your code:

Context initContext = new InitialContext();
DataSource ds  =
(DataSource)initContext.lookup("java:comp/env/jdbc/TestMySql");
Connection conn = ds.getConnection();

out.println("Connection Established");

Essentially when you lookup java:comp/env/jdbc/TestMySql, that's the
full JNDI path to the DataSource and returns a DataSource type object,
not a Context type object.

--David

Mohammed Zabin wrote:

   


Ok thank you, I did the following as you have stated:

1. in server.xml:

2. in context.xml


3. in my test page:
Context initContext = new InitialContext();
Context envContext  =
(Context)initContext.lookup("java:comp/env/jdbc/TestMySql");
DataSource ds = (DataSource)envContext.lookup("jdbc/TestMySql");
Connection conn = ds.getConnection();

out.println("Connection Established");
And i put nothing in web.xml, I have the following error:

org.apache.jasper.JasperException: Unable to compile class for JSP:



Stacktrace:
   org.apache.jasper.compiler.DefaultErrorHandler.javacError(
 


DefaultErrorHandler.java:85)
   


   org.apache.jasper.compiler.ErrorDispatcher.javacError(
 


ErrorDispatcher.java:330)
   


   org.apache.jasper.compiler.JDTCompiler.generateClass(
 


JDTCompiler.java:415)
   


   org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
   org.apache.jasper.JspCompilationContext.compile(
 


JspCompilationContext.java:566)
   


   org.apache.jasper.servlet.JspServletWrapper.service(
 


JspServletWrapper.java:308)
   

 


org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:320)
   


   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)



On 7/23/07, David Smith <[EMAIL PROTECTED]> wrote:

 


A few things to consider:

1. Either place your Resource definition in server.xml as a
GlobalResource *OR* in your webapp's context.xml file.

2. If you have the Resource defined in the GlobalResources, that's
   


the
   


only time you need to use a ResourceLink element in context.xml.

3. Drop the autoReconnect parameter in your mysql URL.  It has it's
uses, but not in a pooled environment.

4. You should probably be attempting to use the path
java:comp/env/jdbc/TestMySQL (note the lack of a '/' before comp) as
described in the JNDI howto on tomcat's website.  I think I saw you
using java:/comp/env/jdbc/TestMySQL in one of your posts.

5. Please post relevant messages from your logs if this isn't
   


working.
   


--David

Mohammed Zabin wrote:

   


Would you please be more specific? which file you mean? I have
 


created
   


Oracel connection Pool as the stated way above, and it's worked
 


fine,
   


shall
i put resource defeninitoin in context.xml only?

On 7/22/07, Pid <[EMAIL PROTECTED]> wrote:

 


You only need one resource definition.
You only need a resource link definition if your resource is a
   


global
   


one.

Simplify your configuration and then post the error message
   


from the
   


logs so we can see Tomcat says is wrong.

p


Re: Tomcat 5.5.23

2007-07-26 Thread Len Popp
Sorry, it was a joke (or maybe not).

This problem has come up many many many times on this mailing list.
People have asked for those useful files to be included in the .exe
download. I haven't heard of a reason why it would be difficult to do
so. Yet, the issue has persisted for years. I tried to think of a
reason why, and that's the only thing I could think of.
-- 
Len

On 7/26/07, Varuna Seneviratna <[EMAIL PROTECTED]> wrote:
> I can't understand what Len is trying to say what is meant by minimum level
> of traffic on this mailing list How is it related to the Tomcat distribution
>
> On 7/26/07, Len Popp <[EMAIL PROTECTED]> wrote:
> >
> > On 7/26/07, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:
> > > For some obscure
> > > reason, whoever packages Tomcat chose to leave out the very useful
> > > scripts from the .exe installer.
> >
> > The reason is quite simple. It's to guarantee a minimum level of
> > traffic on this mailing list. Concerns about utility and frustration
> > are secondary.
> > --
> > Len
> >
> > -
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Varuna Seneviratna
> No 514 Udumulla Road
> Battaramulla
> Sri Lanka
> Tel : 011-2888620
>

-
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: Bean and Servlet

2007-07-26 Thread David Smith
That clarifies a lot :-) !  You are indeed dealing with two separate 
requests from client to server.  As such the Request object won't be the 
same between the jsp and the servlet and is the reason your storage of 
an attribute in the request didn't work.  Sessions are buit for just 
this reason.


There may be a problem with concurrent access to the session if the user 
get's click happy or has multiple browser windows open on the same 
session and you'll have to be able to handle that.  In general I would 
avoid attributes in the session that might cause conflicts depending on 
where each browser is in the app.  In your case two windows could be 
prompted for a different random question/answer on the same session.  
Such a issue might be mitigated with a one time random token stored both 
as a hidden form field and a session attribute.  As each request comes 
in, compare the tokens and handle appropriately.


Additionally I believe there was a bugzilla issue describing a version 
(or versions) of tomcat that didn't use a thread-safe method of storing 
session attributes, so you might have to introduce synchronize blocks in 
your code to deal with that.  You'll have to look at the bugzilla 
database for the issue, tomcat version(s) and it's resolution.  I don't 
have that info off hand.


--David

Mohammed Zabin wrote:


Well, I will descript the problem exactly. the first page use a tag class to
render a random question from database, and their possible answers, the user
must choose the right answer and submit the form for processing.

I need the random question numbers, which are question ids to
*Results*servlet.
*Results* servlet is a servlet that must display the same questions that was
displayed in the Questions page to run a query against the database to
display the questions and the correct and wrong answers.

My Problem is that, I want to pass these numbers, Questions IDs, from the
first page, which i have made it as a tag class, to Results page, which was
made as servlet. I tried to use request.setAttribute("Ids", ids); but when
retrieve it in Results servlet, I got *null. *

That was my problem my buddy, by the way, when i used session, it worked
fine. and you stated that this will not work, but i think that storing these
ids in a session is a good choice, isn't it?

If you have any comments please post it.


On 7/26/07, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:
 


From: Mohammed Zabin [mailto:[EMAIL PROTECTED]
Subject: Re: Bean and Servlet

What do you suggest to overcome this problem?
 


In the seven messages you've posted in this thread, you've never really
explained what this attribute is being used for; nor have you answered
the question of whether or not it's used only for the duration of a
single request or is applicable to everything a given user does with
this particular webapp.

Until you give us some idea of what your intent is (as opposed to code
snippets), I don't think anyone can really answer your questions.

If you do need to store attributes in a session, you will need at least
some synchronization logic to see if the attribute is already present,
since multiple requests can easily be using the Session object
concurrently.

- 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: Tomcat 5.5.23

2007-07-26 Thread David Smith

:-D ... I believe it's a joke.

--David

Varuna Seneviratna wrote:


I can't understand what Len is trying to say what is meant by minimum level
of traffic on this mailing list How is it related to the Tomcat distribution

On 7/26/07, Len Popp <[EMAIL PROTECTED]> wrote:
 


On 7/26/07, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:
   


For some obscure
reason, whoever packages Tomcat chose to leave out the very useful
scripts from the .exe installer.
 


The reason is quite simple. It's to guarantee a minimum level of
traffic on this mailing list. Concerns about utility and frustration
are secondary.
--
Len

-
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]



Invoker Not Invoking in 5.5.9

2007-07-26 Thread W Strater
I know that the servlet invoker is not popular but that is what I have to deal 
with.

All of the servlets are invoked as 
http://localhost:8080/servlets/com.domain.servlets.ServletName where the 
/servlets is the web app name.

I would like to acheive to things.

1) Ensure that only servlets within a package get invoked.
2) Provide a catch all servlet.

Here are my servlet mappings:




invoker

/com.domain.servlets.*









catchAll

/*






The problem is that the catchAll is getting every request despite being defined 
after the invoker. I have even defined a new servlet name, , with the 
invoker class, org.apache.catalina.servlets.InvokerServlet, still the catchAll 
gets all requests.

Any suggestions?


Wes.



RE: MySql Connector

2007-07-26 Thread Propes, Barry L
did you also have the Oracle jar file in that lib directory? I would have 
thought you'd want it in the common/lib dir.


-Original Message-
From: Mohammed Zabin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 25, 2007 12:52 AM
To: Tomcat Users List
Subject: Re: MySql Connector


In cotrast, i have installed Oracle and worked very well, but MySql didn't
work with me. I am using Connecter/J from MySql website, the beta version, I
put the jar file in the CATALINA_HOME/lib, and i add it to the CLASSPATH.
and I followed the instructions provided in Tomcat documentation, exactly,
Didn't work :(

On 7/24/07, David Smith <[EMAIL PROTECTED]> wrote:
>
> I've never dealt with Oracle but have done a lot of MySQL installs
> without a single failure.  Your config outside of the web.xml doesn't
> look wrong in any way.
>
> You might want to put the  block in your web.xml as
> described in the how-to's.  It doesn't hurt and is part of the servlet
> spec.
>
> --David
>
>
> Mohammed Zabin wrote:
>
> > No, the same error, You know what David?? I put nothing in web.xml, I am
> > confused about this issue, when to use web.xml, and it might be the
> > reason
> > behind the unsuccessfull MySql Connection, I follow the same procedure I
> > followed to configure Oracle DBCP, I think it must work for MySql,
> right?
> >
> > On 7/24/07, David Smith <[EMAIL PROTECTED]> wrote:
> >
> >>
> >> Try this variant of your code:
> >>
> >> Context initContext = new InitialContext();
> >> DataSource ds  =
> >> (DataSource)initContext.lookup("java:comp/env/jdbc/TestMySql");
> >> Connection conn = ds.getConnection();
> >>
> >> out.println("Connection Established");
> >>
> >> Essentially when you lookup java:comp/env/jdbc/TestMySql, that's the
> >> full JNDI path to the DataSource and returns a DataSource type object,
> >> not a Context type object.
> >>
> >> --David
> >>
> >> Mohammed Zabin wrote:
> >>
> >> > Ok thank you, I did the following as you have stated:
> >> >
> >> > 1. in server.xml:
> >> >  >> > type="javax.sql.DataSource"
> >> >   maxActive="100" maxIdle="30" maxWait="1"
> >> >   username="root" password="exam" driverClassName="
> >> > com.mysql.jdbc.Driver"
> >> >   url="jdbc:mysql://localhost:3306/exam"/>
> >> > 2. in context.xml
> >> > 
> >> >
> >> > 3. in my test page:
> >> >  Context initContext = new InitialContext();
> >> >  Context envContext  =
> >> > (Context)initContext.lookup("java:comp/env/jdbc/TestMySql");
> >> >  DataSource ds = (DataSource)envContext.lookup("jdbc/TestMySql");
> >> >  Connection conn = ds.getConnection();
> >> >
> >> >  out.println("Connection Established");
> >> > And i put nothing in web.xml, I have the following error:
> >> >
> >> > org.apache.jasper.JasperException: Unable to compile class for JSP:
> >> >
> >> >
> >> >
> >> > Stacktrace:
> >> > org.apache.jasper.compiler.DefaultErrorHandler.javacError(
> >> DefaultErrorHandler.java:85)
> >> >
> >> > org.apache.jasper.compiler.ErrorDispatcher.javacError(
> >> ErrorDispatcher.java:330)
> >> >
> >> > org.apache.jasper.compiler.JDTCompiler.generateClass(
> >> JDTCompiler.java:415)
> >> >
> >> > org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
> >> > org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
> >> > org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
> >> > org.apache.jasper.JspCompilationContext.compile(
> >> JspCompilationContext.java:566)
> >> >
> >> > org.apache.jasper.servlet.JspServletWrapper.service(
> >> JspServletWrapper.java:308)
> >> >
> >> >
> >> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
> >> :320)
> >> >
> >> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >> > javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >> >
> >> >
> >> >
> >> > On 7/23/07, David Smith <[EMAIL PROTECTED]> wrote:
> >> >
> >> >>
> >> >> A few things to consider:
> >> >>
> >> >> 1. Either place your Resource definition in server.xml as a
> >> >> GlobalResource *OR* in your webapp's context.xml file.
> >> >>
> >> >> 2. If you have the Resource defined in the GlobalResources, that's
> >> the
> >> >> only time you need to use a ResourceLink element in context.xml.
> >> >>
> >> >> 3. Drop the autoReconnect parameter in your mysql URL.  It has it's
> >> >> uses, but not in a pooled environment.
> >> >>
> >> >> 4. You should probably be attempting to use the path
> >> >> java:comp/env/jdbc/TestMySQL (note the lack of a '/' before comp) as
> >> >> described in the JNDI howto on tomcat's website.  I think I saw you
> >> >> using java:/comp/env/jdbc/TestMySQL in one of your posts.
> >> >>
> >> >> 5. Please post relevant messages from your logs if this isn't
> >> working.
> >> >>
> >> >> --David
> >> >>
> >> >> Mohammed Zabin wrote:
> >> >>
> >> >> > Would you please be more specific? which file you mean? I have
> >> created
> >> >> > Oracel connection Pool as the stated way ab

Re: Tomcat 5.5.23

2007-07-26 Thread Varuna Seneviratna
I can't understand what Len is trying to say what is meant by minimum level
of traffic on this mailing list How is it related to the Tomcat distribution

On 7/26/07, Len Popp <[EMAIL PROTECTED]> wrote:
>
> On 7/26/07, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:
> > For some obscure
> > reason, whoever packages Tomcat chose to leave out the very useful
> > scripts from the .exe installer.
>
> The reason is quite simple. It's to guarantee a minimum level of
> traffic on this mailing list. Concerns about utility and frustration
> are secondary.
> --
> Len
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Varuna Seneviratna
No 514 Udumulla Road
Battaramulla
Sri Lanka
Tel : 011-2888620


RE: creating security roles automatically

2007-07-26 Thread Propes, Barry L
you ultimately will read these roles from the database, namely the user roles 
table, as in the  userRoleTable attribute.



-Original Message-
From: Okan Çetin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 24, 2007 8:35 AM
To: users@tomcat.apache.org
Subject: creating security roles automatically


Hi;
I am using role based authentication system with Tomcat. I know, in
web.xml , security roles must be defined like this:
Ex:

users


But i want to create these roles dynamically. For example i want to
read these roles from database, LDAP, text files or somewhere else. Is
it possible?
Thanks.

Sincerly,
Okan.

-- 
~
otomatik oluşturuldu:
http://ocetin.net/log
http://linux.beykent.edu.tr


Tomcat 5.0.28 - SSL Setup

2007-07-26 Thread Jeffrey C. Baldwin

Hello All,

I'm in a bit of a pinch here.  Just had an old Solaris server fail that 
housed our TomCat environment and now I'm trying to put the pieces back 
together on a new server.  I have a few of the applications up and 
running.. but now I've run into an app that wants to run over ssl and 
I'm having a hard time getting it to work.


Environment:  Tomcat 5.0.28 running on CentOS 5

I am including my server.xml below. 

I have already generated my certificate after reading this document and 
put the cert into /usr/local/tomcat:

http://tomcat.apache.org/tomcat-5.0-doc/ssl-howto.html

Can someone please advice me on how to get ssl up and running on  port 8443?



 
 className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>

 
   
   type="org.apache.catalina.UserDatabase"/>

   
 
   factory
   org.apache.catalina.users.MemoryUserDatabaseFactory
 
 
   pathname
   conf/tomcat-users.xml
 
   
 
 
   disableUploadTimeout="true" port="8080" redirectPort="8443" 
maxSpareThreads="75" maxThreads="150" minSpareThreads="25">

   
   protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" 
redirectPort="8443">

   

autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
directory="logs" prefix="localhost_access_log." suffix=".txt" 
pattern="common" resolveHosts="false" />
directory="logs" prefix="localhost_log." suffix=".txt" timestamp="true" />

   
prefix="catalina_log." suffix=".txt" timestamp="true"/>

 
   
 



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



How to do this

2007-07-26 Thread Varuna Seneviratna
Can somebody tell me How to do what is described below
   you *must* verify the integrity of the downloaded files. We
provide PGP signatures for every release file. This signature should be
matched against the KEYS
file which contains
the PGP keys of Tomcat's Release Managers. We also
provide an MD5 checksum for every release file. After you download the file,
you should calculate a checksum for your download, and make sure it is the
same as ours.

-- 
Varuna Seneviratna
No 514 Udumulla Road
Battaramulla
Sri Lanka
Tel : 011-2888620


Cannot create resource instance

2007-07-26 Thread Amol Chaudhari

Hello Everyone,
I am trying to migrate a sun java studio creator JSF (which uses Sun App
Server 8) project to Netbeans 5.5 + inbuilt Tomcat 5.5.17. While trying to
add a new record to my screen i am getting the following exception. Can
anyone help me on this?

javax.naming.NamingException: Cannot create resource instance
at
org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:112)
at 
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.apache.naming.NamingContext.lookup(NamingContext.java:792)
at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at test.Student.btnSave_action(Student.java:593)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
at
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
at
com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListenerImpl.java:57)
at
org.ajax4jsf.framework.ajax.AjaxActionComponent.broadcast(AjaxActionComponent.java:88)
at
org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:287)
at
org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:263)
at
org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:410)
at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doXmlFilter(BaseFilter.java:574)
at
org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:387)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
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:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
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.la

Re: Tomcat 5.5.23

2007-07-26 Thread Len Popp
On 7/26/07, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:
> For some obscure
> reason, whoever packages Tomcat chose to leave out the very useful
> scripts from the .exe installer.

The reason is quite simple. It's to guarantee a minimum level of
traffic on this mailing list. Concerns about utility and frustration
are secondary.
-- 
Len

-
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: Having both Manager and non-default webapps as root

2007-07-26 Thread Propes, Barry L
Ok, Chuck...get ready.

-Original Message-
From: dracus [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 26, 2007 11:48 AM
To: users@tomcat.apache.org
Subject: Having both Manager and non-default webapps as root



Greetings, all,

I am setting up a Tomcat server for the developers I work with, and am
having a problem getting the config to work the way they requested.  They
want their own custom webapp to be the default webapp, and have the manager
available to allow deploying new versions of their webapp, stopping and
starting it, etc.  I am setting the webapp to be the default webapp by
adding this block to the server.xml file:






And this kills the manager dead.  I can not figure out what I need to do to
bring the manager back so we can use it.  Any pointers would be greatly
appreciated.  Thank you for your time.
-- 
View this message in context: 
http://www.nabble.com/Having-both-Manager-and-non-default-webapps-as-root-tf4152861.html#a11814580
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]


-
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: Mod_jk error

2007-07-26 Thread Rainer Jung

André Vila Cova wrote:

Red Hat Enterprise Linux AS release 4 (Nahant Update 5)

Release :  Jakarta-Tomcat 5.5.20

Modulo nativo APR:  tomcat-connectors-1.2.20

JVM versão. : Sun JVM1.5.0_11

I think that apache web server don't receive response from tomcat and don't
send final ack to tomcat and tomcat don't free threads.I see every logs 
from

oracle executions and duration of TOP SQL is very low.
I made test using the same architecture without firewall and everything
works fine. Tomcat free threads and send complete response to web server.


If your analysis is correct, it's a known problem, that firewalls often 
drop idle connections, so mod_jk and Tomcat should both be configured to 
shut down idle connections. On the Tomcat side you should use the 
attribute connectionTimeout in the configuration of your AJP Connector 
in server.xml. The units are in milliseconds, so 10 Minutes would be 
60. On the mod_jk side you should use connection_pool_timeout, units 
are seconds, so 10 minutes are 600.


We have a new docs page about these things, which will go live next week 
with our 1.2.24 release. There is a preview for the page under


http://people.apache.org/~rjung/mod_jk-dev/docs/generic_howto/timeouts.html

The next release 1.2.24 will some improvements for this situation, but 
you would still need the timeouts on bith ends.


For a plausibility check, if this really is your problem, you could 
compare "netstat -an" (only the lines corresponding to your Tomcat AJP 
port) on the Apache and on the Tomcat side, and also check with the JVM 
Thread Dump (kill -QUIT to Tomcat; it will not die, but write a list of 
all threads with a stack for each of them to catalina.out). If the 
firewall dropped the connections, most likely the two netstat outputs 
will show an inconsistent state for the connections. Tomcat threads, 
which sit listening on an idle connection will be shown in the thread 
dump as reading from the socket.


Regards,

Rainer


Thanks.



On 7/26/07, Rainer Jung <[EMAIL PROTECTED]> wrote:


Hi,

you didn't give us your versions, you platform or any configuration info.

André Vila Cova wrote:
> Hello!
>
> Apache mod_jk returns following error (frequently...):
>
> [Thu Jul 26 11:07:52 2007] [2703:1120] [error]
> ajp_connection_tcp_get_message::jk_ajp_common.c (948): (app02_aol) 
can't

> receive the response message from tomcat, network problems or tomcat is
> down
> (192.168.40.11:8007), err=-104
> [Thu Jul 26 11:07:52 2007] [2703:1120] [error]
> ajp_get_reply::jk_ajp_common.c (1566): (app02_aol) Tomcat is down or
> refused
> connection. No response has been sent to the client (yet)
>

The 104 is the errno of your local platform. For Linux 104 is
"Connection reset by peer".

> We have two firewalls between Apache Web Server and Tomcat Web , but we
> didn't see nothing wrong in firewalls logs.

> Response appear on browser, but seems that no ack flag arrives to
webserver
> to finish request. Tomcat crashs with error All threads (400) are
currently
> *busy*, waiting. Increase *maxThreads* (400) or check the servlet
status.

The above log entry is for only a single request. You write that the
response actually goes back to the browser, but I guess you mean "most
of the requests", or are you sure that this single request produced a
response?

No idea, what you mean by "crash"? If this message appears, it means,
that all the threads you have configured in you thread pool of the
tomcat connector are busy by running a request. Since you configured 400
threads max, this might actually mean, that something is to slow in your
app or in some backend your app is using, so the requests take to long
and the system becomes congested. In this situation take a java thread
dump to check, what those 400 threads are actually doing.

> Is it a configuration problem? May I setup some parameter to resolve
> problem?

If only we knew your configuration ...

Regards,

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: Tomcat clustering and nightly processes

2007-07-26 Thread Len Popp
A couple of possibilities:

The nightly jobs aren't really related to serving web pages, so they
could be separate programs that are each installed on one server -
thus no synchronization needed. These programs could be implemented as
web apps if you want, so they can be administered through the web, but
each program (OrderUpdate, ReportGen, etc.) is only installed on one
server.

Alternatively, if one of the nightly jobs needs to run on several
servers in order to handle its load, you will have to implement some
sort of distributed processing. Again this doesn't necessarily mean
that the job will be implemented as part of the web cluster - it could
be a separate program running on the same (or different) servers. How
you manage the distributed processing would depend on your
requirements and your OS - that part isn't really Tomcat related.
-- 
Len

On 7/26/07, Rizwan Merchant <[EMAIL PROTECTED]> wrote:
>
> Hi,
> We have a server in production currently and are thinking about
> implementing clustering to achieve load balancing and scalability.
> Currently we have some processes that run nightly, for example
>
> 1. Users upload files that are processed later at night.
> 2. order updates (we retrieve all orders from db to determine if they
> have been delivered using Fedex's web service, etc).
> 3. Manifest submissions - generate a report from the orders of the day
> to submit to various companies via FTP
>
> The above are just some examples. As you can see, we have a fair amount
> of stuff going on in the background during off peak hours.
>
> My question is this. Once we implement clustering, how can the above be
> handled. The above processes cannot be running on all instances of the
> tomcat servers. For example, if a file is uploaded for processing later,
> then that file should be processed only once, but as many times as there
> are server instances (since they are all running same copies of the
> application code).
>
> I hope my concern makes sense, and would appreciate some insight into
> this before we consider this cluster implementation further.
>
> Thanks,
> -Rizwan Merchant.
>
>
> -
> 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: Bean and Servlet

2007-07-26 Thread Mohammed Zabin
Well, I will descript the problem exactly. the first page use a tag class to
render a random question from database, and their possible answers, the user
must choose the right answer and submit the form for processing.

 I need the random question numbers, which are question ids to
*Results*servlet.
*Results* servlet is a servlet that must display the same questions that was
displayed in the Questions page to run a query against the database to
display the questions and the correct and wrong answers.

My Problem is that, I want to pass these numbers, Questions IDs, from the
first page, which i have made it as a tag class, to Results page, which was
made as servlet. I tried to use request.setAttribute("Ids", ids); but when
retrieve it in Results servlet, I got *null. *

 That was my problem my buddy, by the way, when i used session, it worked
fine. and you stated that this will not work, but i think that storing these
ids in a session is a good choice, isn't it?

If you have any comments please post it.


On 7/26/07, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:
>
> > From: Mohammed Zabin [mailto:[EMAIL PROTECTED]
> > Subject: Re: Bean and Servlet
> >
> > What do you suggest to overcome this problem?
>
> In the seven messages you've posted in this thread, you've never really
> explained what this attribute is being used for; nor have you answered
> the question of whether or not it's used only for the duration of a
> single request or is applicable to everything a given user does with
> this particular webapp.
>
> Until you give us some idea of what your intent is (as opposed to code
> snippets), I don't think anyone can really answer your questions.
>
> If you do need to store attributes in a session, you will need at least
> some synchronization logic to see if the attribute is already present,
> since multiple requests can easily be using the Session object
> concurrently.
>
> - 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: Mod_jk error

2007-07-26 Thread André Vila Cova

Red Hat Enterprise Linux AS release 4 (Nahant Update 5)

Release :  Jakarta-Tomcat 5.5.20

Modulo nativo APR:  tomcat-connectors-1.2.20

JVM versão. : Sun JVM1.5.0_11

I think that apache web server don't receive response from tomcat and don't
send final ack to tomcat and tomcat don't free threads.I see every logs from
oracle executions and duration of TOP SQL is very low.
I made test using the same architecture without firewall and everything
works fine. Tomcat free threads and send complete response to web server.

Thanks.



On 7/26/07, Rainer Jung <[EMAIL PROTECTED]> wrote:


Hi,

you didn't give us your versions, you platform or any configuration info.

André Vila Cova wrote:
> Hello!
>
> Apache mod_jk returns following error (frequently...):
>
> [Thu Jul 26 11:07:52 2007] [2703:1120] [error]
> ajp_connection_tcp_get_message::jk_ajp_common.c (948): (app02_aol) can't
> receive the response message from tomcat, network problems or tomcat is
> down
> (192.168.40.11:8007), err=-104
> [Thu Jul 26 11:07:52 2007] [2703:1120] [error]
> ajp_get_reply::jk_ajp_common.c (1566): (app02_aol) Tomcat is down or
> refused
> connection. No response has been sent to the client (yet)
>

The 104 is the errno of your local platform. For Linux 104 is
"Connection reset by peer".

> We have two firewalls between Apache Web Server and Tomcat Web , but we
> didn't see nothing wrong in firewalls logs.

> Response appear on browser, but seems that no ack flag arrives to
webserver
> to finish request. Tomcat crashs with error All threads (400) are
currently
> *busy*, waiting. Increase *maxThreads* (400) or check the servlet
status.

The above log entry is for only a single request. You write that the
response actually goes back to the browser, but I guess you mean "most
of the requests", or are you sure that this single request produced a
response?

No idea, what you mean by "crash"? If this message appears, it means,
that all the threads you have configured in you thread pool of the
tomcat connector are busy by running a request. Since you configured 400
threads max, this might actually mean, that something is to slow in your
app or in some backend your app is using, so the requests take to long
and the system becomes congested. In this situation take a java thread
dump to check, what those 400 threads are actually doing.

> Is it a configuration problem? May I setup some parameter to resolve
> problem?

If only we knew your configuration ...

Regards,

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]




Having both Manager and non-default webapps as root

2007-07-26 Thread dracus

Greetings, all,

I am setting up a Tomcat server for the developers I work with, and am
having a problem getting the config to work the way they requested.  They
want their own custom webapp to be the default webapp, and have the manager
available to allow deploying new versions of their webapp, stopping and
starting it, etc.  I am setting the webapp to be the default webapp by
adding this block to the server.xml file:






And this kills the manager dead.  I can not figure out what I need to do to
bring the manager back so we can use it.  Any pointers would be greatly
appreciated.  Thank you for your time.
-- 
View this message in context: 
http://www.nabble.com/Having-both-Manager-and-non-default-webapps-as-root-tf4152861.html#a11814580
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: Comet example at Tomcat 6

2007-07-26 Thread Reich, Matthias
Perhaps you should add this to the example:

protected void service(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
   resp.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
   "you must be using the APR or NIO connector to get the event
method called" );
}

> -Original Message-
> From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, July 26, 2007 5:18 PM
> To: Tomcat Users List
> Subject: Re: Comet example at Tomcat 6
> 
> you must be using the APR or NIO connector
> 
>protocol="org.apache.coyote.http11.Http11NioProtocol"   //or
>   protocol="org.apache.coyote.http11.Http11AprProtocol"
> 
> 
> Filip
> john x wrote:
> > Hi!
> > I just run the chat example ,but ,it seems did not work ;
> > the code seems can't reach the line
> >  begin(event, request, response)
> >
> > please help me fix that,thanks;
> >
> >
> >
> > john
> >
> > 
> --
> --
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition. 
> > Version: 7.5.476 / Virus Database: 269.10.19/917 - Release 
> Date: 7/25/2007 1:16 AM
> >   
> 
> 
> -
> 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: URIEncoding

2007-07-26 Thread Caldarale, Charles R
> From: Frederic Bastian [mailto:[EMAIL PROTECTED] 
> Subject: Re: URIEncoding
> 
> Is there a way to get the value of the param URIEncoding of the 
> Connector, so your code will work, whatever the char encoding of the 
> Connector is ?

I'm confused.  If the  already has the proper URIEncoding
value, why do you think the application needs to reprocess the URI with
the same encoding?

 - 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: Mod_jk error

2007-07-26 Thread Rainer Jung

Hi,

you didn't give us your versions, you platform or any configuration info.

André Vila Cova wrote:
> Hello!
>
> Apache mod_jk returns following error (frequently...):
>
> [Thu Jul 26 11:07:52 2007] [2703:1120] [error]
> ajp_connection_tcp_get_message::jk_ajp_common.c (948): (app02_aol) can't
> receive the response message from tomcat, network problems or tomcat is
> down
> (192.168.40.11:8007), err=-104
> [Thu Jul 26 11:07:52 2007] [2703:1120] [error]
> ajp_get_reply::jk_ajp_common.c (1566): (app02_aol) Tomcat is down or
> refused
> connection. No response has been sent to the client (yet)
>

The 104 is the errno of your local platform. For Linux 104 is 
"Connection reset by peer".



We have two firewalls between Apache Web Server and Tomcat Web , but we
didn't see nothing wrong in firewalls logs.



Response appear on browser, but seems that no ack flag arrives to webserver
to finish request. Tomcat crashs with error All threads (400) are currently
*busy*, waiting. Increase *maxThreads* (400) or check the servlet status.


The above log entry is for only a single request. You write that the 
response actually goes back to the browser, but I guess you mean "most 
of the requests", or are you sure that this single request produced a 
response?


No idea, what you mean by "crash"? If this message appears, it means, 
that all the threads you have configured in you thread pool of the 
tomcat connector are busy by running a request. Since you configured 400 
threads max, this might actually mean, that something is to slow in your 
app or in some backend your app is using, so the requests take to long 
and the system becomes congested. In this situation take a java thread 
dump to check, what those 400 threads are actually doing.



Is it a configuration problem? May I setup some parameter to resolve
problem?


If only we knew your configuration ...

Regards,

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]



Tomcat clustering and nightly processes

2007-07-26 Thread Rizwan Merchant


Hi,
We have a server in production currently and are thinking about 
implementing clustering to achieve load balancing and scalability.

Currently we have some processes that run nightly, for example

1. Users upload files that are processed later at night.
2. order updates (we retrieve all orders from db to determine if they 
have been delivered using Fedex's web service, etc).
3. Manifest submissions - generate a report from the orders of the day 
to submit to various companies via FTP


The above are just some examples. As you can see, we have a fair amount 
of stuff going on in the background during off peak hours.


My question is this. Once we implement clustering, how can the above be 
handled. The above processes cannot be running on all instances of the 
tomcat servers. For example, if a file is uploaded for processing later, 
then that file should be processed only once, but as many times as there 
are server instances (since they are all running same copies of the 
application code).


I hope my concern makes sense, and would appreciate some insight into 
this before we consider this cluster implementation further.


Thanks,
-Rizwan Merchant.

-
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-writing

2007-07-26 Thread Jurian Botha

We're currently using squid to re-write to a tomcat instance.

For example we've got requests coming in to
'http://sample.host.name.com/tomcat/' which are then rewritten to point to
'http://localhost:8080/'.

The problem is that relative URL's are not taking this rewrite into account.

'/manager/docs/index/html' for example attempts to link to
'http://sample.host.name.com/manager/docs/index.html' instead of
'http://sample.host.name.com/tomcat/manager/docs/index.html'.

I'm totally clueless as to where I can let tomcat know that it has to take
this re-write into account.

Any direction would be appreciated.
-- 
View this message in context: 
http://www.nabble.com/Re-writing-tf4152537.html#a11813492
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: URIEncoding

2007-07-26 Thread Frederic Bastian

Thx a lot Pulkit, it works just fine.

But my aim is to make portability easier ; What happens if the 
URIEncoding of the Connector is not "UTF-8" or "ISO-8859-1", but a 
different char encoding ?

Your pseudo-code won't work anymore :(

Is there a way to get the value of the param URIEncoding of the 
Connector, so your code will work, whatever the char encoding of the 
Connector is ?


Pulkit Singhal a écrit :

How about:

String queryString = HttpServletRequest.getParameter("query");
queryString = new String(queryString.getBytes("iso-8859-1"), "UTF-8");


Its not very graceful so you can even make a 1-line-method for doing this
and have:

decodeURIParams(a, b, c) {
return new String((HttpServletRequest.getParameter(a)).getBytes(b), c);
}

String queryString = decodeURIParams("query", URI_ENCODING_CONST,
URI_DECODING_CONST));


This is all pseudo-code but I hope you see what I mean.

On 7/26/07, Frederic Bastian <[EMAIL PROTECTED]> wrote:


Hi Pulkit, thanks for your answer.

The matter is that Tomcat won't get the correct values of the parameters
in the URL. For instance :

If my URI looks like : http://host/?query=%C3%A9%C3%A8
The URI encoding is UTF-8

By default, Tomcat will read this url in ISO-8859-1. So
HttpServletRequest.getParameter("query") will return an incorrect value.
The solution you proposed won't help Tomcat to return a correct value
with the "getParameter" method.

If I add into server.xml the attribut URIEncoding="UTF-8" to the
Connector, Tomcat will correctly read the "query" parameter.
I would like Tomcat to read correctly URL in UTF-8, but without
modifying server.xml.

Any suggestion ?

Pulkit Singhal a écrit :
> Hi Frederic,
>
> I don't know about HttpSession. for settign the URIEncoding.
> But you could always do somethign along the lines of:
> String uri_utf8 = new String (uri.getBytes("iso-8859-1"), "UTF-8");
> inside the application.
>
> On 7/26/07, Frederic Bastian <[EMAIL PROTECTED]> wrote:
>>
>> Hi folks :)
>>
>>
>> I need my URI to be in UTF-8. In server.xml, I added to the Connector
>> the attribut : URIEncoding="UTF-8"
>> This works well. But my question is :
>>
>> Is there a way to define the URIEncoding in the application itself ?
>>
>> For instance, you can modify the session timeout in the application
>> itself (HttpSession.setMaxInactiveInterval()). I would like to modify
>> the URIEncoding by the same way.
>>
>> Would anyone know how to achieve that ?
>> 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]
>>
>>
>

--
Frederic Bastian, PhD student
Department of Ecology and Evolution
Biophore, University of Lausanne, 1015 Lausanne, Switzerland.
tel: +41 21 692 4221
http://www.unil.ch/dee/page22707.html

Swiss Institute of Bioinformatics
http://www.isb-sib.ch/


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






--
Frederic Bastian, PhD student
Department of Ecology and Evolution
Biophore, University of Lausanne, 1015 Lausanne, Switzerland.
tel: +41 21 692 4221
http://www.unil.ch/dee/page22707.html

Swiss Institute of Bioinformatics
http://www.isb-sib.ch/ 



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



Mod_jk error

2007-07-26 Thread André Vila Cova

Hello!

Apache mod_jk returns following error (frequently...):

[Thu Jul 26 11:07:52 2007] [2703:1120] [error]
ajp_connection_tcp_get_message::jk_ajp_common.c (948): (app02_aol) can't
receive the response message from tomcat, network problems or tomcat is down
(192.168.40.11:8007), err=-104
[Thu Jul 26 11:07:52 2007] [2703:1120] [error]
ajp_get_reply::jk_ajp_common.c (1566): (app02_aol) Tomcat is down or refused
connection. No response has been sent to the client (yet)

We have two firewalls between Apache Web Server and Tomcat Web , but we
didn't see nothing wrong in firewalls logs.

Response appear on browser, but seems that no ack flag arrives to webserver
to finish request. Tomcat crashs with error All threads (400) are currently
*busy*, waiting. Increase *maxThreads* (400) or check the servlet status.

Is it a configuration problem? May I setup some parameter to resolve
problem?

Could you help me?

Thanks a lot.


RE: Tomcat 5.5.23

2007-07-26 Thread Caldarale, Charles R
> From: Varuna Seneviratna [mailto:[EMAIL PROTECTED] 
> Subject: Tomcat 5.5.23
> 
> The documentation says there are files in the bin as startup.bat,
> shutdown.bat and number of other files but the bin doesn't contain any
> of them

Grab the .zip download rather than the .exe one.  For some obscure
reason, whoever packages Tomcat chose to leave out the very useful
scripts from the .exe installer.  Note that you can still install Tomcat
as a service with the .zip version.

 - 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]



Tomcat 5.5.23

2007-07-26 Thread Varuna Seneviratna
I downloaded and installed Tomcat 5.5.23 using the binary distribution in
windowsXp. The problem is the information in the Documentation that came
with the installation and what is in the installation is different. The
documentation says there are files in the bin as startup.bat,
shutdown.bat and number of other files but the bin doesn't contain any
of them ,the files
in the bin folder are bootstrap, commons-logging-api, tomcat5, tomcat5w,
tomcat-juli.
 My Question is
  Is there a particular specific documentation for Tomcat
5.5.23 and Is it possible to start and stop Tomcat 5.5.23 from the command
line If it is possible what is the way to do it?
   Thanks Varuna

-- 
Varuna Seneviratna
No 514 Udumulla Road
Battaramulla
Sri Lanka
Tel : 011-2888620


Re: Comet example at Tomcat 6

2007-07-26 Thread Filip Hanik - Dev Lists

you must be using the APR or NIO connector


Hi!
I just run the chat example ,but ,it seems did not work ;
the code seems can't reach the line
 begin(event, request, response)

please help me fix that,thanks;



john



No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.10.19/917 - Release Date: 7/25/2007 1:16 AM
  



-
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: URIEncoding

2007-07-26 Thread Pulkit Singhal

How about:

String queryString = HttpServletRequest.getParameter("query");
queryString = new String(queryString.getBytes("iso-8859-1"), "UTF-8");


Its not very graceful so you can even make a 1-line-method for doing this
and have:

decodeURIParams(a, b, c) {
return new String((HttpServletRequest.getParameter(a)).getBytes(b), c);
}

String queryString = decodeURIParams("query", URI_ENCODING_CONST,
URI_DECODING_CONST));


This is all pseudo-code but I hope you see what I mean.

On 7/26/07, Frederic Bastian <[EMAIL PROTECTED]> wrote:


Hi Pulkit, thanks for your answer.

The matter is that Tomcat won't get the correct values of the parameters
in the URL. For instance :

If my URI looks like : http://host/?query=%C3%A9%C3%A8
The URI encoding is UTF-8

By default, Tomcat will read this url in ISO-8859-1. So
HttpServletRequest.getParameter("query") will return an incorrect value.
The solution you proposed won't help Tomcat to return a correct value
with the "getParameter" method.

If I add into server.xml the attribut URIEncoding="UTF-8" to the
Connector, Tomcat will correctly read the "query" parameter.
I would like Tomcat to read correctly URL in UTF-8, but without
modifying server.xml.

Any suggestion ?

Pulkit Singhal a écrit :
> Hi Frederic,
>
> I don't know about HttpSession. for settign the URIEncoding.
> But you could always do somethign along the lines of:
> String uri_utf8 = new String (uri.getBytes("iso-8859-1"), "UTF-8");
> inside the application.
>
> On 7/26/07, Frederic Bastian <[EMAIL PROTECTED]> wrote:
>>
>> Hi folks :)
>>
>>
>> I need my URI to be in UTF-8. In server.xml, I added to the Connector
>> the attribut : URIEncoding="UTF-8"
>> This works well. But my question is :
>>
>> Is there a way to define the URIEncoding in the application itself ?
>>
>> For instance, you can modify the session timeout in the application
>> itself (HttpSession.setMaxInactiveInterval()). I would like to modify
>> the URIEncoding by the same way.
>>
>> Would anyone know how to achieve that ?
>> 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]
>>
>>
>

--
Frederic Bastian, PhD student
Department of Ecology and Evolution
Biophore, University of Lausanne, 1015 Lausanne, Switzerland.
tel: +41 21 692 4221
http://www.unil.ch/dee/page22707.html

Swiss Institute of Bioinformatics
http://www.isb-sib.ch/


-
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: Server Security

2007-07-26 Thread Len Popp
There's no "handicap" under Windows - you can run a server on port 80 with
no problem, even if it's running under a user account.

On the other hand, for a demo site it's not such a big deal to use a
different port. Just makes the URL look a little uglier.
-- 
Len

On 7/26/07, Craig Skinner <[EMAIL PROTECTED]> wrote:
>
> On Wed, Jul 25, 2007 at 01:37:03PM -0400, Len Popp wrote:
> > Yes, you can run Tomcat on port 80. Some OS's (Linux, UNIX) require
> > the process to have root privs to use port 80.
>
> Why not run it on 8080 as the _tomcat user, and use the packet filter to
> redirect the incoming port 80 traffic to port 8080?
>
> If you are handicapped by using windos, your broadband router may be able
> to do port forwarding from its external interface, port 80, to your
> "server:8080"
>
> See: http://www.oreilly.com/catalog/tomcat/chapter/ch06.pdf
>
> Also covers security manager and some nice OpenBSD security tips that
> can be cludged on Linux.
>
> -
> 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: Something other than localhost on OS X

2007-07-26 Thread Larry Meadors

Why not just add that host name in /etc/hosts?

Larry


On 7/24/07, Colin H <[EMAIL PROTECTED]> wrote:

Hi,

I am trying to do something that I figure should be pretty simple -
accessing my tomcat container from something other than localhost.  So far
as I can tell, I should be adding a  entry to server.xml with the
host I want to access tomcat as.  On OS X, hosts in the local subnet can be
accessed as .local - so, for example, typing 'ssh
[EMAIL PROTECTED]' on host1 will ssh to host2 authenticating as someuser
(this is working - i.e. host2.local can be resolved form host1).  If you
type 'hostname' on host1, it returns 'host1.local'

   So the scenario is that I have tomcat deployed and working on host2 port
8080, and want to access it from host1.  I don't want to muck around with
apache and mod_jk etc.  Been there many times before, always find it
annoying.  In any case, I shouldn't need to, as far as I can tell, as tomcat
should be able to do the job.  I am adding the following to the
server.xmlfile, after the  entry -





and would like the following URL

'http://host2.local:8080/' to work from host1.  '
http://localhost:8080/' already works from a browser on host2.

I realise I am using the tomcat embedded within JBoss, but it should be the
same - I have the following specific questions

1.  Is this the right approach in general (ignoring specific of JBooss or
whatever)?
2.  Is there something tricky about the OS X host naming mechanisms that
could be causing me some problems?
3.  Any other ideas why this might not be working?

Thanks,

Colin



-
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: Something other than localhost on OS X

2007-07-26 Thread Hassan Schroeder
On 7/25/07, Colin H <[EMAIL PROTECTED]> wrote:
> Thanks Hassan - just couldn't get it working - figure there must be some
> reason that 8080 isn't accessible - the firewall is off though in system
> preferences.  I'm sure it is something extremely simple, but i got sick of
> trying to find out what it was, so I followed these instructions (roughly)
> and did what I said I wasn't going to do :)
>
> http://www.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss
>
> port 80 is no problem, so I can access everything as required. Still can't
> get to port 8080, but this config gets me where I want too be.  cheers,

If it's not a DNS problem but some kind of firewall issue, why not just
run Tomcat on port 80??  No need for adding that extra complexity.

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]



RE: Bean and Servlet

2007-07-26 Thread Caldarale, Charles R
> From: Mohammed Zabin [mailto:[EMAIL PROTECTED] 
> Subject: Re: Bean and Servlet
> 
> What do you suggest to overcome this problem?

In the seven messages you've posted in this thread, you've never really
explained what this attribute is being used for; nor have you answered
the question of whether or not it's used only for the duration of a
single request or is applicable to everything a given user does with
this particular webapp.

Until you give us some idea of what your intent is (as opposed to code
snippets), I don't think anyone can really answer your questions.

If you do need to store attributes in a session, you will need at least
some synchronization logic to see if the attribute is already present,
since multiple requests can easily be using the Session object
concurrently.

 - 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 with 8 GB memory

2007-07-26 Thread Caldarale, Charles R
> From: Joe Nathan [mailto:[EMAIL PROTECTED] 
> Subject: Re: Tomcat with 8 GB memory
> 
> 8GB means you are using 64 bit machine which will be much 
> slower than 32 bit machines.

Neither conclusion is true.  We have 8 GB machines using 32-bit CPUs,
and proper 64-bit systems (those that are not IA64 based) are pretty
much always faster than IA32.

> In Java, if you use lots of memory and create lots of objects,
> your Java applications will have periodic seisures! This is 
> because of garbage collection will take significant time, if
> started. 

The above is also not true.  The time taken for a garbage collection
(even a full one) is pretty much independent of the size of the heap; it
is very dependent on the number of live objects in the heap, which tends
to be relatively constant for any given application.

 - 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 5 and 6 Security advise

2007-07-26 Thread Peter Stavrinides

Thanks Chuck,

I have done most of these, I already run Tomcat as a daemon using a 
non-privileged account, and use a JDBC realm to authenticate users. I 
will check for any loose ends like connectors in the config files.


Peter

Caldarale, Charles R wrote:
From: Peter Stavrinides [mailto:[EMAIL PROTECTED] 
Subject: Re: Tomcat 5 and 6 Security advise


and nothing is mentioned about the benefits of 
running Apache with Tomcat for securing Tomcat

in a purely Java environment



Adding layers generally doesn't improve security - it just provides
additional targets.

Some things to do:

1) Browse through the server.xml and web.xml settings in Tomcat's conf
directory, and disable anything you don't need, especially connectors.

2) Remove any uneeded webapps that come with Tomcat, such as the
examples, docs, and webdav.

3) Use a proper authentication Realm, not the toy default one that keeps
credentials in the tomcat-users.xml file.

4) Restrict access to Tomcat's file structure to a specific userid, and
run Tomcat with that userid.

I'm not aware of any security vulnerabilities in current Tomcat levels
other than the rather minor cross-scripting ones inherent in some of the
examples.

 - 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]

  


--
Peter Stavrinides
Albourne Partners (Cyprus) Ltd
Tel: +357 22 750652 

If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail. 




-
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: URIEncoding

2007-07-26 Thread Frederic Bastian

Hi Pulkit, thanks for your answer.

The matter is that Tomcat won't get the correct values of the parameters 
in the URL. For instance :


If my URI looks like : http://host/?query=%C3%A9%C3%A8
The URI encoding is UTF-8

By default, Tomcat will read this url in ISO-8859-1. So 
HttpServletRequest.getParameter("query") will return an incorrect value.
The solution you proposed won't help Tomcat to return a correct value 
with the "getParameter" method.


If I add into server.xml the attribut URIEncoding="UTF-8" to the 
Connector, Tomcat will correctly read the "query" parameter.
I would like Tomcat to read correctly URL in UTF-8, but without 
modifying server.xml.


Any suggestion ?

Pulkit Singhal a écrit :

Hi Frederic,

I don't know about HttpSession. for settign the URIEncoding.
But you could always do somethign along the lines of:
String uri_utf8 = new String (uri.getBytes("iso-8859-1"), "UTF-8");
inside the application.

On 7/26/07, Frederic Bastian <[EMAIL PROTECTED]> wrote:


Hi folks :)


I need my URI to be in UTF-8. In server.xml, I added to the Connector
the attribut : URIEncoding="UTF-8"
This works well. But my question is :

Is there a way to define the URIEncoding in the application itself ?

For instance, you can modify the session timeout in the application
itself (HttpSession.setMaxInactiveInterval()). I would like to modify
the URIEncoding by the same way.

Would anyone know how to achieve that ?
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]






--
Frederic Bastian, PhD student
Department of Ecology and Evolution
Biophore, University of Lausanne, 1015 Lausanne, Switzerland.
tel: +41 21 692 4221
http://www.unil.ch/dee/page22707.html

Swiss Institute of Bioinformatics
http://www.isb-sib.ch/ 



-
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 and 6 Security advise

2007-07-26 Thread Caldarale, Charles R
> From: Peter Stavrinides [mailto:[EMAIL PROTECTED] 
> Subject: Re: Tomcat 5 and 6 Security advise
> 
> and nothing is mentioned about the benefits of 
> running Apache with Tomcat for securing Tomcat
> in a purely Java environment

Adding layers generally doesn't improve security - it just provides
additional targets.

Some things to do:

1) Browse through the server.xml and web.xml settings in Tomcat's conf
directory, and disable anything you don't need, especially connectors.

2) Remove any uneeded webapps that come with Tomcat, such as the
examples, docs, and webdav.

3) Use a proper authentication Realm, not the toy default one that keeps
credentials in the tomcat-users.xml file.

4) Restrict access to Tomcat's file structure to a specific userid, and
run Tomcat with that userid.

I'm not aware of any security vulnerabilities in current Tomcat levels
other than the rather minor cross-scripting ones inherent in some of the
examples.

 - 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]



  1   2   >