Re: Java programm to Shutdwon the tomcat server

2010-03-02 Thread Pid

On 01/03/2010 14:26, dBenjamin wrote:


I using customize icon to launch my application before starting the tomcat my
java program will check and then it will allow to start the tomcat otherwise
it will change the port and server will get start.


How are you changing the port?  Are you somehow editing the XML file and 
then restarting the server?




I am validating shutdown port using
Socket socket = new Socket(127.0.0.1,JVMPort);


is JVMPort the value for the Tomcat shutdown port?


if (socket.isConnected()) {
port =true;
  socket.close();

}
If I check the port it will through the exception:
Mar 1, 2010 9:22:58 AM org.apache.catalina.core.StandardServer await
WARNING: StandardServer.await: Invalid command '' received


You are, perhaps inadvertently, causing an empty command to be sent to 
the shutdown port.  The log message below is the expected response if 
you do so.


If you need to start Tomcat programmatically, I strongly recommend that 
you look at the Embedded documentation I sent earlier.



p


Mar 1, 2010 9:22:58 AM org.apache.catalina.core.StandardServer await
WARNING: StandardServer.await: Invalid command '' received
After that it was not receiving shutdown request






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Adding a symlink from inside the app after deployment - What's the best approach?

2010-03-02 Thread Konstantin Kolinko
2010/3/1 emerson cargnin echofloripa.y...@gmail.com:
 Am I wrong or tomcat 7 will provide support for folder aliasing (pull
 in resources from external locations)?

 http://mail-archives.apache.org/mod_mbox//tomcat-dev/200905.mbox/4a1c5275.7010...@apache.org


Yes, it will.
See
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/context.xml?view=markup
look for
attribute name=aliases
there.

 The main problem in packaging this content inside each app (and not
 using the symlink) is that we have the requirement that this content
 should be deployed outside of the release cycle of the applications.

Does unpacking and repacking a zip archive (which a war file
ultimately is) requires a release cycle for you?

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Curious to know if the following is permitted

2010-03-02 Thread Karthik Nanjangude

Hi


SPEC
JDK 1.5
TOMKAT 6.0.20
O/s Unix /Linux /WIN2000

Curious to know if the following is permitted

Can a standalone piece of code (out of web apps)   connect via JNDI to the web 
application running successfully on Tomcat


Note: - This is required for some scheduled End of Day Operations to insert 
Bulk Data into DB via the validating business layer of the up and running 
application




With regards
karthik


Re: Centralize settings...

2010-03-02 Thread couva

Thanks.
any more suggestion? I red some interesting about Tcat Server Server Profiles.

Best Regards

Citando Pid p...@pidster.com:


On 01/03/2010 16:47, co...@sapo.pt wrote:


Hello!

Actually we have a lot of different web applications with specific
settings for each one, namelly: JNDI, SPRING, logging properties, JMS
properties, etc...
Some of these webapplication could be deployed in different TOMCAT
instances. The centralization of these settings would be a major
improvement to facilitate the setup task and minimize the setup time.

What is the best way to implement a central file with all of these
settings?


Do it at build time.  So many different configuration requirements  
would be very difficult to do otherwise.


Putting configuration files into a source repository and writing  
scripts to generate multiple outputs is sometimes recommended here.



p



Thanks a lot

Best Regards
C.o.u.v.a


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Curious to know if the following is permitted

2010-03-02 Thread Konstantin Kolinko
2010/3/2 Karthik Nanjangude karthik.nanjang...@xius-bcgi.com:

 Can a standalone piece of code (out of web apps)   connect via JNDI to the 
 web application running successfully on Tomcat

Only if your web application will open a socket and listen there.

Tomcat 6.0 connectors themselves understand HTTP(S) and AJP protocols only.

If you say about JNDI, I suppose you are going to use LDAP protocol.

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Apache Tomcat v5.5.20 - Revision 902650 Question

2010-03-02 Thread Hoang, Phong T CTR Navy ERP
Environment:  Apache Tomcat version 5.5.20, Windows Server 2003 R2 Enterprise 
Edition x64

Apache Tomcat is embedded with the Business Objects software install and not a 
standalone install.

Attempted to apply fixes from Revision 902650 for the vulnerabilities 
identified but the following files are not found in the Tomcat home folder:

tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/loader/LocalStrings.properties
  
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java
  
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
  
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/startup/ExpandWar.java
  
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/startup/HostConfig.java
   
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/startup/LocalStrings.properties
  
tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml 

What does this mean and how do I apply the revision if those files are not 
found.  Please advise.  

Best Regards,
Phong Hoang
410.919.4088 (Office)
704.281.5542 (Mobile) 


smime.p7s
Description: S/MIME cryptographic signature


RE: remote debug with tomcat 3.3.2

2010-03-02 Thread Caldarale, Charles R
 From: Kedzior Wojciech [mailto:wojciech.kedz...@gemalto.com]
 Subject: remote debug with tomcat 3.3.2
 
 I'm having a problem with setting up a remote debug session to my
 Tomcat 3.3.2 Final.

You're asking for help with a version of Tomcat that's six years old and hasn't 
been supported for ages?  Not to mention buggier and much slower than the 
current releases.

Your time would be better spent moving up to a supported level and then working 
on the debugging.

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Apache Tomcat v5.5.20 - Revision 902650 Question

2010-03-02 Thread Peter Crowther
On 2 March 2010 14:08, Hoang, Phong T CTR Navy ERP
phong.hoang@navy.mil wrote:
 Environment:  Apache Tomcat version 5.5.20, Windows Server 2003 R2 Enterprise 
 Edition x64

 Apache Tomcat is embedded with the Business Objects software install and not 
 a standalone install.

 Attempted to apply fixes from Revision 902650 for the vulnerabilities 
 identified but the following files are not found in the Tomcat home folder:

 tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/loader/LocalStrings.properties
[...]
 What does this mean and how do I apply the revision if those files are not 
 found.  Please advise.

It means that you should talk to SAP's tech support to get an updated
version of the embedded Tomcat that they've customised for Business
Objects.

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Apache Tomcat v5.5.20 - Revision 902650 Question

2010-03-02 Thread Pid

On 02/03/2010 14:08, Hoang, Phong T CTR Navy ERP wrote:

Environment:  Apache Tomcat version 5.5.20, Windows Server 2003 R2 Enterprise 
Edition x64

Apache Tomcat is embedded with the Business Objects software install and not a 
standalone install.

Attempted to apply fixes from Revision 902650 for the vulnerabilities 
identified but the following files are not found in the Tomcat home folder:

tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/loader/LocalStrings.properties
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/startup/ExpandWar.java
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/startup/HostConfig.java
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/startup/LocalStrings.properties
tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml

What does this mean and how do I apply the revision if those files are not 
found.  Please advise.


I think you're trying to apply source code patches to the embedded 
binary, which isn't going to work.


You may be able to replace the entire Tomcat installation with the 
latest version, but that would be a question for Business Objects/SAP 
support.



p

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Curious to know if the following is permitted

2010-03-02 Thread Karthik Nanjangude
Hi

I am no expert in LDAP  ...Plz excuse me

Existing web application, JDBC Connection pool can be attained with JNDI

So my requirement / Clarification is to How to re-use the existing applications 
business Layer from the web applications which in turn uses the JNDI to connect 
to DB for Data processing


Although Tomcat is not a J2EE Container like OC4j or JBOSS Servers
 where in the remote connectivity is achieved via RMI-IIOP, as simple as 
Client ( Standalone S/w )  initiating  Business Objects on J2EE via JNDI's


I could have used JBOSS or OC4j, but it does not make sense to use these J2EE 
containers for the simple 1 or 2 requirement's




With regards
karthik



-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com]
Sent: Tuesday, March 02, 2010 5:45 PM
To: Tomcat Users List
Subject: Re: Curious to know if the following is permitted

2010/3/2 Karthik Nanjangude karthik.nanjang...@xius-bcgi.com:

 Can a standalone piece of code (out of web apps)   connect via JNDI to the 
 web application running successfully on Tomcat

Only if your web application will open a socket and listen there.

Tomcat 6.0 connectors themselves understand HTTP(S) and AJP protocols only.

If you say about JNDI, I suppose you are going to use LDAP protocol.

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Curious to know if the following is permitted

2010-03-02 Thread Caldarale, Charles R
 From: Karthik Nanjangude [mailto:karthik.nanjang...@xius-bcgi.com]
 Subject: RE: Curious to know if the following is permitted
 
 So my requirement / Clarification is to How to re-use the existing
 applications business Layer from the web applications which in turn
 uses the JNDI to connect to DB for Data processing

You send HTTP requests to Tomcat from your client program, regardless of where 
either is running.  Apache provides a useful HTTP client library if you need 
something more sophisticated than what the JRE supplies:
http://hc.apache.org/httpcomponents-client/index.html

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Curious to know if the following is permitted

2010-03-02 Thread Karthik Nanjangude
Hi

Chuck

Sorry for the process

Are u saying about AXIS, Using Http protocol for loosely based Client usage.

OK this is one of the options, are there any others ?



With regards
karthik


-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
Sent: Tuesday, March 02, 2010 8:38 PM
To: Tomcat Users List
Subject: RE: Curious to know if the following is permitted

 From: Karthik Nanjangude [mailto:karthik.nanjang...@xius-bcgi.com]
 Subject: RE: Curious to know if the following is permitted

 So my requirement / Clarification is to How to re-use the existing
 applications business Layer from the web applications which in turn
 uses the JNDI to connect to DB for Data processing

You send HTTP requests to Tomcat from your client program, regardless of where 
either is running.  Apache provides a useful HTTP client library if you need 
something more sophisticated than what the JRE supplies:
http://hc.apache.org/httpcomponents-client/index.html

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: remote debug with tomcat 3.3.2

2010-03-02 Thread Kedzior Wojciech
Hi Chuck,

Thanks for your answer.  

That is exactly how I feel.  However I'm not the person responsible for these 
kinds of decisions within the company.  I am merely trying to help the guys 
here by being more (much much more) efficient by using a debugger instead of 
log files when developing code.  

To be honest I have no idea why they use such an old version of Tomcat.  And I 
hope RND or someone is looking at upgrading.  I also suspect that there are 
some proprietary libraries involved here, which may hinder a tomcat upgrade. 

I hate it, but I have to do with what I have and I'm just trying to get the 
best out of what I have.

So, any other suggestions?

Cheers

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: 2. března 2010 15:16
To: Tomcat Users List
Subject: RE: remote debug with tomcat 3.3.2

 From: Kedzior Wojciech [mailto:wojciech.kedz...@gemalto.com]
 Subject: remote debug with tomcat 3.3.2
 
 I'm having a problem with setting up a remote debug session to my
 Tomcat 3.3.2 Final.

You're asking for help with a version of Tomcat that's six years old and hasn't 
been supported for ages?  Not to mention buggier and much slower than the 
current releases.

Your time would be better spent moving up to a supported level and then working 
on the debugging.

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Curious to know if the following is permitted

2010-03-02 Thread Caldarale, Charles R
 From: Karthik Nanjangude [mailto:karthik.nanjang...@xius-bcgi.com]
 Subject: RE: Curious to know if the following is permitted
 
 Are u saying about AXIS, Using Http protocol for loosely based Client
 usage.

I wouldn't think AXIS is necessary - just use whatever the webapps inside 
Tomcat are already expecting.

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: DB connection error -Tomcat 6 config

2010-03-02 Thread Propes, Barry L
Really? Well, when I was implementing connection pooling in 4.1.31, I 
specifically remember having to use  ojdbc14_g.jar instead of ojdbc14.jar to 
successfully get the conn pooling to work.

I'll swap out the ojdbc14_g.jar  for the ojdbc14.jar and just use the latter 
and see if that works.

Thanks, Karthik.

-Original Message-
From: Karthik Nanjangude [mailto:karthik.nanjang...@xius-bcgi.com] 
Sent: Monday, March 01, 2010 10:59 PM
To: Tomcat Users List
Subject: RE: DB connection error -Tomcat 6 config

Hi

Please double check the ojdbc14.jar size, Some times I find the jar files 
corrupt due to various reasons.

Also check only 1 copy of this 'jar' exists in /TOMCAT6.0.2.0/lib directory 
and make sure the same does not exist within the web application.

ojdbc14_g.jar is used for advance debug purpose, although it works try with 
normal ojdbc14.jar




With regards
karthik

-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Sent: Tuesday, March 02, 2010 4:44 AM
To: 'Tomcat Users List'
Subject: RE: DB connection error -Tomcat 6 config

Sorry, no.

webapps/chngctrl/META-INF/context.xml.

Thanks, Chuck.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
Sent: Monday, March 01, 2010 4:29 PM
To: Tomcat Users List
Subject: RE: DB connection error -Tomcat 6 config

 From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
 Subject: RE: DB connection error -Tomcat 6 config

 If I try to reference the resource reference in the 
 webapps/META-INF/context.xml file,

Is that the real location?  If so, it's not valid.  The webapps directory is 
the default directory under which each webapp is normally deployed; there must 
be a webapp name between webapps and META-INF (e.g., ROOT).  Any other 
construct is incorrect.

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Centralize settings...

2010-03-02 Thread Jason Brittain
Yes, using Tcat Server profiles is another way.  Create a new profile that
contains
all of the Tomcat configuration you want, and any files you want to add into
your
Tomcat installation (binary or text), and you can apply the profile to any
number
of regular Tomcat installations, potentially across multiple machines.  The
console
allows you a central point of administration of the server profile.  See
this page
for some more details:

http://blogs.mulesoft.org/saving-time-using-tcat-servers-centralized-configuration-management

Tcat Server is commercial software, but it is free for pre-production use.

There are other ways of centrally administering a set of configuration files
for
doing what you're asking about, though I think they're more time consuming,
or they involve some custom programming, or both.  Some examples include:
1. Writing your own Ant build files that use the SSH task to scp files to
the machines
  that should have the files.  This works fine, but involves lots of custom
  programming.
2. Writing a shell script that uses rsync or SSH, which ends up very similar
to #1.
3. Using a more complex configuration management tool such as SystemImager
   http://systemimager.org but it isn't as simple to get it working, it
makes some
   assumptions about what you're trying to do that probably aren't correct,
and it
   doesn't provide any Tomcat specific features, such as server diagnostics,
   webapp deployment, or server restarts.  SystemImager is only for imaging
   whole machines.

I hope this helps.
--
Jason Brittain
Mulesoft http://www.mulesoft.com


On Tue, Mar 2, 2010 at 4:00 AM, co...@sapo.pt wrote:

 Thanks.
 any more suggestion? I red some interesting about Tcat Server Server
 Profiles.

 Best Regards

 Citando Pid p...@pidster.com:


  On 01/03/2010 16:47, co...@sapo.pt wrote:


 Hello!

 Actually we have a lot of different web applications with specific
 settings for each one, namelly: JNDI, SPRING, logging properties, JMS
 properties, etc...
 Some of these webapplication could be deployed in different TOMCAT
 instances. The centralization of these settings would be a major
 improvement to facilitate the setup task and minimize the setup time.

 What is the best way to implement a central file with all of these
 settings?


 Do it at build time.  So many different configuration requirements would
 be very difficult to do otherwise.

 Putting configuration files into a source repository and writing scripts
 to generate multiple outputs is sometimes recommended here.


 p


  Thanks a lot

 Best Regards
 C.o.u.v.a


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: log4j :ERROR LogMananger.repositorySelector was null likely duetoerror

2010-03-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 2/26/2010 3:54 PM, Caldarale, Charles R wrote:
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Subject: Re: log4j :ERROR LogMananger.repositorySelector was null 
 likely duetoerror
 
 4) Use jinfo, a program that comes with the JDK for sure, possibly
 with the JRE as well.
 
 It doesn't come with the JRE (only the JDK), and it has severe
 limitations on Windows (the OP's platform).  For example, you may
 only look at specific command-line settings, one at a time, and not
 system properties in general.

That's too bad: on *NIX, I can use it to grab all system properties as
well as show me those that were specified on the command-line, etc. :(

One more reason to run *NIX in production. And development. And pretty
much everywhere.

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

iEYEARECAAYFAkuNTZkACgkQ9CaO5/Lv0PCoGQCfemspeRXNuXDd7tdQchBMPZhR
HY4AoLAbRZMk24k6AA/cRTwPw5P+gJu6
=S0QL
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Access Log /Filter/?

2010-03-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Xie,

On 2/26/2010 4:33 PM, Xie Xiaodong wrote:
 No, there is no AccessLogFilter in Tomcat 7 for now. I've got my
 version of AccessLogFilter during Google Summer Code 2009, but has
 not yet submit it for some reason.

Uh, why not submit it and get paid?

 Please attach your version so we could discuss it and make an
 AccessLogFilter in Tomcat 7.

I don't have a version, yet. I was checking to see if someone had done
it already. But if I give you my code so Google can pay you, I'd like
some of that money :)

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

iEYEARECAAYFAkuNTeUACgkQ9CaO5/Lv0PCOOwCeM78myOdUfyyHxTTrbQloeb3W
Ja8AnA4gDir14UAIIoG9hoc8YcKMEeJ6
=nst1
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: When I link to a *.do I get Page not found

2010-03-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Søren,

On 2/27/2010 8:31 AM, Søren Blidorf wrote:
 I have made a struts application and it works just fine on my testserver.
 
 I have now uploaded it to my hosted webserver and struts does not work.
 
 When I link to a *.do I get “Page not found”

Are you using a web server in front of Tomcat? If so, you'll need to map
*.do to Tomcat. Often, *.jsp and others are mapped but not *.do, so
you'll have to double-check.

If you don't have a web server in front of Tomcat, the only other things
I can think of are:

1. Your paths are absolute instead of relative, and you hard-coded the
context path in development, but deployed to production under a
different context path. In that case, you'll get references to
/oldname/foo.do instead of /newname/foo.do. You'll have to make sure you
properly format your links so that the correct context path is always used.

2. You don't have your Struts controller server mapped to /*.do in
web.xml. That would be a pretty big mistake, and wouldn't work in
development, but if you have a different web.xml file for each
environment, it might be the cause.

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

iEYEARECAAYFAkuNTq4ACgkQ9CaO5/Lv0PCeDgCfdhUPhgV+pxFZz/Vd77pVH8XA
/YkAoMNN1+d/V8CnJygeZuAKOo8O0/c7
=wkXT
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: unified doXXX()

2010-03-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aryeh,

On 3/2/2010 1:51 AM, Aryeh M. Friedman wrote:
 Yes we are and thats why I probably mistook the effect of it doing that
 as a side effect instead of a designed in feature... now that being said
 we have used that content day since the first few lines of our code was
 written and until this post (about 2 years) the servlet getting
 getParameter via GET *AND* POST was not an issue... but for some reason
 a new client side request format (which there is no easy way around not
 using) messed it up.

Ok, so what's next? Sometimes you are getting a null when you expect
data, right? Well, are you only getting null when the request is a GET?
POST? Or is it something else?

If you wanted to get cute, you could implement this
one-parameter-to-rule-them-all strategy as a Filter which wraps the
request and provides a simpler getParameter interface to your webapps.
Instead of this:

String everything = getParameter(everything);
String specific = parseSpecific(everything);

You could have your webapp code simply do this:

String specific = request.getParameter(specific);

... then the request wrapper does all the work to gather the parameter
information from the right place, decode it, and return the data to the
caller.

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

iEYEARECAAYFAkuNU4QACgkQ9CaO5/Lv0PDchQCgrQnhx7BOyqAXLBkBxPw0UHz8
Ak8AoJRNRyGI22Be11LjM4mS7bkRSmOt
=9AtG
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: unified doXXX()

2010-03-02 Thread Aryeh M. Friedman

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aryeh,

On 3/2/2010 1:51 AM, Aryeh M. Friedman wrote:
  

Yes we are and thats why I probably mistook the effect of it doing that
as a side effect instead of a designed in feature... now that being said
we have used that content day since the first few lines of our code was
written and until this post (about 2 years) the servlet getting
getParameter via GET *AND* POST was not an issue... but for some reason
a new client side request format (which there is no easy way around not
using) messed it up.



Ok, so what's next? Sometimes you are getting a null when you expect
data, right? Well, are you only getting null when the request is a GET?
POST? Or is it something else?
  


It gets null's on POST's only but only from the new input format (there 
are parts of the app that still use the old format and they work fine)

If you wanted to get cute, you could implement this
one-parameter-to-rule-them-all strategy as a Filter which wraps the
  


I will consider that as a future refactoring

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Access Log /Filter/?

2010-03-02 Thread Xie Xiaodong
Hello, Christopher,


I submitted some code but not including the AccessLogFilter since I had
something question about the implementation of it. Here I give you the
version I wrote last summer. Hope you could check it and submit a patch.


On Tue, Mar 2, 2010 at 6:41 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Xie,

 On 2/26/2010 4:33 PM, Xie Xiaodong wrote:
  No, there is no AccessLogFilter in Tomcat 7 for now. I've got my
  version of AccessLogFilter during Google Summer Code 2009, but has
  not yet submit it for some reason.

 Uh, why not submit it and get paid?

  Please attach your version so we could discuss it and make an
  AccessLogFilter in Tomcat 7.

 I don't have a version, yet. I was checking to see if someone had done
 it already. But if I give you my code so Google can pay you, I'd like
 some of that money :)

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

 iEYEARECAAYFAkuNTeUACgkQ9CaO5/Lv0PCOOwCeM78myOdUfyyHxTTrbQloeb3W
 Ja8AnA4gDir14UAIIoG9hoc8YcKMEeJ6
 =nst1
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




-- 
Sincerely yours and Best Regards,
Xie Xiaodong

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Re: unified doXXX()

2010-03-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aryeh,

On 3/2/2010 2:20 PM, Aryeh M. Friedman wrote:
 It gets null's on POST's only but only from the new input format (there
 are parts of the app that still use the old format and they work fine)

Is this a new client, or just a new data format? Mark's suggestion that
you may be using POST without the proper Content-Type would result in
getting null for this parameter (because Tomcat will not parse it for
you). If this is the case, you should either fix the new client to use
the proper Content-Type, or fall-back to reading and parsing the request
body manually when these requirements are not met.

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

iEYEARECAAYFAkuNeKYACgkQ9CaO5/Lv0PD9hQCguupor2zsCikSUCPUNQhnrDfK
TIQAn1Wli/dVvtXKgBVYIko2pHSBEYut
=O0Co
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Access Log /Filter/?

2010-03-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Xie (or is it Xiaodong?),

On 3/2/2010 2:57 PM, Xie Xiaodong wrote:
 I submitted some code but not including the AccessLogFilter since I had
 something question about the implementation of it. Here I give you the
 version I wrote last summer. Hope you could check it and submit a patch. 

Your attachment must have been stripped from the list. Please consider
re-posting inline.

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

iEYEARECAAYFAkuNeOkACgkQ9CaO5/Lv0PBqXQCfUCrW3JCxOfU7tL1mnuJjwumC
oRQAnRKH+Xizgh5iimVvQjq8rGZ1wTte
=tCKO
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: unified doXXX()

2010-03-02 Thread Aryeh M. Friedman

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aryeh,

On 3/2/2010 2:20 PM, Aryeh M. Friedman wrote:
  

It gets null's on POST's only but only from the new input format (there
are parts of the app that still use the old format and they work fine)



Is this a new client, or just a new data format? Mark's suggestion that
you may be using POST without the proper Content-Type would result in
getting null for this parameter (because Tomcat will not parse it for
you). If this is the case, you should either fix the new client to use
the proper Content-Type, or fall-back to reading and parsing the request
body manually when these requirements are not met.
  


New format same frontend client code which does use the proper content 
type. (the content type is defined at a lower level then the format and 
that code has not changed [using firebug on firefox confirms that fact])


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: unified doXXX()

2010-03-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aryeh,

On 3/2/2010 3:48 PM, Aryeh M. Friedman wrote:
 Christopher Schultz wrote:

 Is this a new client, or just a new data format? Mark's suggestion that
 you may be using POST without the proper Content-Type would result in
 getting null for this parameter (because Tomcat will not parse it for
 you). If this is the case, you should either fix the new client to use
 the proper Content-Type, or fall-back to reading and parsing the request
 body manually when these requirements are not met.
   
 
 New format same frontend client code which does use the proper content
 type. (the content type is defined at a lower level then the format and
 that code has not changed [using firebug on firefox confirms that fact])

Hmm.

So, POST + application/x-www-form-urlencoded yields a null parameter
with your new payload?

I know this sounds silly, but we're getting down to the
grasping-at-straws level, here, so bear with me: have you checked to see
that your request body is actually in the correct format (that is,
urlencoded, etc.)? I haven't looked at the Tomcat code, but Tomcat might
give up if the request body is not parsable.

Have you tried calling request.getInputStream and dumping the request
body when the parameter is null? That might give you some indication of
what's happening.

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

iEYEARECAAYFAkuNe+AACgkQ9CaO5/Lv0PArcwCdHf9ddwqWTKkoYb0jA9BHDs+/
LUoAnj6gNWY5mdPoCAxmgfKceWxSBy6r
=wn5q
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Access Log /Filter/?

2010-03-02 Thread Xie Xiaodong
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the License); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


package org.apache.catalina.filters;


import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.TimeZone;

import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.res.StringManager;


/**
 * pImplementation of the bFilter/b interface that generates a web
server
 * access log with the detailed line contents matching a configurable
pattern.
 * The syntax of the available patterns is similar to that supported by the
 * Apache codemod_log_config/code module.  As an additional feature,
 * automatic rollover of log files when the date changes is also
supported./p
 *
 * pPatterns for the logged message may include constant text or any of
the
 * following replacement strings, for which the corresponding information
 * from the specified Response is substituted:/p
 * ul
 * lib%a/b - Remote IP address
 * lib%A/b - Local IP address
 * lib%b/b - Bytes sent, excluding HTTP headers, or '-' if no bytes
 * were sent
 * lib%B/b - Bytes sent, excluding HTTP headers
 * lib%h/b - Remote host name
 * lib%H/b - Request protocol
 * lib%l/b - Remote logical username from identd (always returns '-')
 * lib%m/b - Request method
 * lib%p/b - Local port
 * lib%q/b - Query string (prepended with a '?' if it exists,
otherwise
 * an empty string
 * lib%r/b - First line of the request
 * lib%s/b - HTTP status code of the response
 * lib%S/b - User session ID
 * lib%t/b - Date and time, in Common Log Format format
 * lib%u/b - Remote user that was authenticated
 * lib%U/b - Requested URL path
 * lib%v/b - Local server name
 * lib%D/b - Time taken to process the request, in millis
 * lib%T/b - Time taken to process the request, in seconds
 * lib%I/b - current Request thread name (can compare later with
stacktraces)
 * /ul
 * pIn addition, the caller can specify one of the following aliases for
 * commonly utilized patterns:/p
 * ul
 * libcommon/b - code%h %l %u %t %r %s %b/code
 * libcombined/b -
 *   code%h %l %u %t %r %s %b %{Referer}i %{User-Agent}i/code
 * /ul
 *
 * p
 * There is also support to write information from the cookie, incoming
 * header, the Session or something else in the ServletRequest.br
 * It is modeled after the apache syntax:
 * ul
 * licode%{xxx}i/code for incoming headers
 * licode%{xxx}o/code for outgoing response headers
 * licode%{xxx}c/code for a specific cookie
 * licode%{xxx}r/code xxx is an attribute in the ServletRequest
 * licode%{xxx}s/code xxx is an attribute in the HttpSession
 * /ul
 * /p
 *
 * p
 * Conditional logging is also supported. This can be done with the
 * codecondition/code property.
 * If the value returned from ServletRequest.getAttribute(condition)
 * yields a non-null value. The logging will be skipped.
 * /p
 *
 * @author Craig R. McClanahan
 * @author Jason Brittain
 * @author Remy Maucherat
 * @author Takayuki Kaneko
 * @author Peter Rossbach
 *
 */

public class AccessLogFilter
extends FilterBase {

private static Log log = LogFactory.getLog(AccessLogFilter.class);

// - Instance
Variables


/**
 * The as-of date for the currently open log file, or a zero-length
 * string if there is no open log file.
 */
private volatile String dateStamp = ;


/**
 * The directory in which log files are created.
 */
private String directory = logs;


/**
 * The set of month abbreviations for log messages.
 */
protected static final String months[] =
{ Jan, Feb, Mar, Apr, May, Jun,
  Jul, Aug, Sep, Oct, Nov, 

Re: unified doXXX()

2010-03-02 Thread Aryeh M. Friedman

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aryeh,

On 3/2/2010 3:48 PM, Aryeh M. Friedman wrote:
  

Christopher Schultz wrote:



Is this a new client, or just a new data format? Mark's suggestion that
you may be using POST without the proper Content-Type would result in
getting null for this parameter (because Tomcat will not parse it for
you). If this is the case, you should either fix the new client to use
the proper Content-Type, or fall-back to reading and parsing the request
body manually when these requirements are not met.
  
  

New format same frontend client code which does use the proper content
type. (the content type is defined at a lower level then the format and
that code has not changed [using firebug on firefox confirms that fact])



Hmm.

So, POST + application/x-www-form-urlencoded yields a null parameter
with your new payload?

I know this sounds silly, but we're getting down to the
grasping-at-straws level, here, so bear with me: have you checked to see
that your request body is actually in the correct format (that is,
urlencoded, etc.)? I haven't looked at the Tomcat code, but Tomcat might
give up if the request body is not parsable.

Have you tried calling request.getInputStream and dumping the request
body when the parameter is null? That might give you some indication of
what's happening.
  
The client does url encode in addition to translating any chars that are 
used either by tomcat and/or or app to decode the reaquest (namely = is 
translated to ^, comma to #, right/left parens to @ and $ respectivally) 
then I use javascripts escape(string) method to url encode it the 
app by default uses post but if I cut and paste the resulting payload 
into a GET and pass it to the app it works fine (i.e. the app uses POST 
but I do manual testing with GET)


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Cannot create PoolableConnectionFactory

2010-03-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

RayDon,

On 3/1/2010 12:46 PM, RayDon1 wrote:
 Caused by: org.postgresql.util.PSQLException: Connection refused.

Seems pretty straightforward.

 SERVER
 Active Internet connections (servers and established)
 Proto Recv-Q Send-Q Local Address   Foreign Address State
 tcp0  0 *:5280  *:* LISTEN
 tcp0  0 linux:   *:* LISTEN
 tcp0  0 *:46178 *:* LISTEN
 tcp0  0 *:xmpp-client   *:* LISTEN
 tcp0  0 localhost:mysql *:* LISTEN

Running MySQL and Postgres on the same server?!

 tcp0  0 localhost:11211 *:* LISTEN
 tcp0  0 *:sunrpc*:* LISTEN
 tcp0  0 *:4369  *:* LISTEN
 tcp0  0 *:xmpp-server   *:* LISTEN
 tcp0  0 *:ssh   *:* LISTEN
 tcp0  0 *:postgresql*:* LISTEN
 tcp0  0 localhost:smtp  *:* LISTEN
 tcp0  0 *:60828 *:* LISTEN
 tcp0  0 localhost:44891 localhost:61613
 ESTABLISHED
 tcp0  0 localhost:44893 localhost:61613
 ESTABLISHED
 tcp0  0 linux:ssh   VAIO.lo:51445 ESTABLISHED
 tcp0  0 linux:ssh   VAIO.lo:51443 ESTABLISHED
 tcp0  0 linux:ssh   linux1:58261   
 ESTABLISHED
 tcp0  0 linux:49632   192.168.5.10:telnet
 ESTABLISHED
 tcp0  0 linux:xmpp-client192.168.5.127:42116
 ESTABLISHED
 tcp0  0 localhost:35745 localhost:11211
 TIME_WAIT
 tcp0  0 linux:ssh   VAIO.lo:51551 ESTABLISHED
 tcp0  0 linux:60873xmpp-client ESTABLISHED
 tcp0  0 linux:xmpp-client60873 ESTABLISHED
 tcp0  0 localhost:51494 localhost:4369 
 ESTABLISHED
 tcp0  0 localhost:4369  localhost:51494
 ESTABLISHED
 tcp0  0 localhost:44892 localhost:61613
 ESTABLISHED
 tcp6   0  0 [::]:8161   [::]:*  LISTEN
 tcp6   0  0 [::]:41025  [::]:*  LISTEN
 tcp6   0  0 localhost:8005  [::]:*  LISTEN
 tcp6   0  0 [::]:8009   [::]:*  LISTEN
 tcp6   0  0 localhost:61613 [::]:*  LISTEN
 tcp6   0  0 [::]:61616  [::]:*  LISTEN
 tcp6   0  0 [::]:www[::]:*  LISTEN
 tcp6   0  0 [::]:8180   [::]:*  LISTEN
 tcp6   0  0 [::]:ssh[::]:*  LISTEN
 tcp6   0  0 [::]:postgresql [::]:*  LISTEN

This one looks like PostgreSQL, though you appear to have the port
numbers translated into readable port names so it's tough to tell.

Note that the listen address is an IPv6 address, not IPv4.

 2) I checked pg_hba and the connections are set:
 
 # IPv4 local connections:
 hostall all 127.0.0.1/32  trust
 hostall all 192.168.5.5/24trust 
 hostall all 192.168.5.127/24  trust

 # IPv6 local connections:
 hostall all ::1/128   trust

The above should be authorization preferences, and shouldn't cause a
connection failure: instead, I would expect some other error.

 What else can I check to get to the bottom of this bug?

Do you have a software firewall? Make sure it allows
localhost-localhost communications.

Resource
   name=jdbcConnectionString
   auth=Container
   type=javax.sql.DataSource
   driverClassName=org.postgresql.Driver
   url=jdbc:postgresql://localhost:5432/testdb

I agree with Chuck: it's possible that localhost refers to an IPv4
address and therefore won't connect as your PostgreSQL looks like it's
bound to an IPv6 address. I'm not sure if they're entirely compatible.

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

iEYEARECAAYFAkuNfYQACgkQ9CaO5/Lv0PAG1ACfarawx8jTsSseojisnbqCte1I
BH0AoLGDc88N0YXxUBwnP6t3wzW70t/f
=W/Cm
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: unified doXXX()

2010-03-02 Thread Aryeh M. Friedman

Aryeh M. Friedman wrote:

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aryeh,

On 3/2/2010 3:48 PM, Aryeh M. Friedman wrote:
 

Christopher Schultz wrote:

   
Is this a new client, or just a new data format? Mark's suggestion 
that

you may be using POST without the proper Content-Type would result in
getting null for this parameter (because Tomcat will not parse it for
you). If this is the case, you should either fix the new client to use
the proper Content-Type, or fall-back to reading and parsing the 
request

body manually when these requirements are not met.


New format same frontend client code which does use the proper content
type. (the content type is defined at a lower level then the format and
that code has not changed [using firebug on firefox confirms that 
fact])



Hmm.

So, POST + application/x-www-form-urlencoded yields a null parameter
with your new payload?

I know this sounds silly, but we're getting down to the
grasping-at-straws level, here, so bear with me: have you checked to see
that your request body is actually in the correct format (that is,
urlencoded, etc.)? I haven't looked at the Tomcat code, but Tomcat might
give up if the request body is not parsable.

Have you tried calling request.getInputStream and dumping the request
body when the parameter is null? That might give you some indication of
what's happening.
  
The client does url encode in addition to translating any chars that 
are used either by tomcat and/or or app to decode the reaquest (namely 
= is translated to ^, comma to #, right/left parens to @ and $ 
respectivally) then I use javascripts escape(string) method to url 
encode it the app by default uses post but if I cut and paste the 
resulting payload into a GET and pass it to the app it works fine 
(i.e. the app uses POST but I do manual testing with GET)


opps forgot to mention the manual test works for both the new and old 
format but the automated method only works for the old format (both 
formats use the one param to rule them all strategy)


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat 6.0.18 fails to load webapp on container restart

2010-03-02 Thread dale77

Hi,

The application loads first time, but if tomcat is restarted, the app fails
with the the following error:

INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
Feb 23, 2010 8:42:54 AM org.apache.catalina.core.StandardContext
resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\Program Files\Apache
Software Foundation\Tomcat 6.0\webapps\services\myapp does not exist or is
not a readable directory
at
org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:141)
at
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3957)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4126)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

The application is packaged as services#myapp.jar, and has a
META-INF/context.xml containing a single ResourceLink tag. When the app is
deployed, this expands the jar into webapps/services#myapp and copies
context.xml to conf/Catalina/localhost/services#myapp.xml

The app runs fine at this point. If tomcat is restarted however, the error
occurs because the directory does indeed not exist, it is looking for the
wrong directory. It should be looking for C:\Program Files\Apache Software
Foundation\Tomcat 6.0\webapps\services#myapp.

If I delete conf/Catalina/localhost/services#myapp.xml, the app starts fine,
until the next tomcat restart.

Is this a bug with tomcat? Any workarounds?

Thanks

Dale
-- 
View this message in context: 
http://old.nabble.com/Tomcat-6.0.18-fails-to-load-webapp-on-container-restart-tp27761207p27761207.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: unified doXXX()

2010-03-02 Thread Aryeh M. Friedman

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aryeh,

On 3/2/2010 3:48 PM, Aryeh M. Friedman wrote:
  

Christopher Schultz wrote:



Is this a new client, or just a new data format? Mark's suggestion that
you may be using POST without the proper Content-Type would result in
getting null for this parameter (because Tomcat will not parse it for
you). If this is the case, you should either fix the new client to use
the proper Content-Type, or fall-back to reading and parsing the request
body manually when these requirements are not met.
  
  

New format same frontend client code which does use the proper content
type. (the content type is defined at a lower level then the format and
that code has not changed [using firebug on firefox confirms that fact])



Hmm.

So, POST + application/x-www-form-urlencoded yields a null parameter
with your new payload?

I know this sounds silly, but we're getting down to the
grasping-at-straws level, here, so bear with me: have you checked to see
that your request body is actually in the correct format (that is,
urlencoded, etc.)? I haven't looked at the Tomcat code, but Tomcat might
give up if the request body is not parsable.

Have you tried calling request.getInputStream and dumping the request
body when the parameter is null? That might give you some indication of
what's happening.

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

iEYEARECAAYFAkuNe+AACgkQ9CaO5/Lv0PArcwCdHf9ddwqWTKkoYb0jA9BHDs+/
LUoAnj6gNWY5mdPoCAxmgfKceWxSBy6r
=wn5q
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


  
Also forgot to mention I already refactored the servlet to use pure hex 
encoding (namely we convert the entire request into a hex string so for 
example a old format message of call=default.Session.getSession() gets 
translated into 
63616c6c3d64656661756c742e53657373696f6e2e67657453657373696f6e2829 
which the servlet then decodes and then does it own parsing (in both 
formats the call param [our does it all param] has roughly the format 
above [i.e. a psedo method call like format])... by new format I only 
mean we got a query string that exceeds 1k for the first time


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat 6.0.18 fails to load webapp on container restart

2010-03-02 Thread Caldarale, Charles R
 From: dale77 [mailto:dale.ogil...@trimble.co.nz]
 Subject: Tomcat 6.0.18 fails to load webapp on container restart
 
 The application loads first time, but if tomcat is restarted, the app
 fails with the the following error:
 
 Feb 23, 2010 8:42:54 AM org.apache.catalina.core.StandardContext
 resourcesStart
 SEVERE: Error starting static Resources
 java.lang.IllegalArgumentException: Document base C:\Program Files\
 Apache Software Foundation\Tomcat 6.0\webapps\services\myapp does not exist
 or is not a readable directory
 
 If I delete conf/Catalina/localhost/services#myapp.xml, the app starts
 fine, until the next tomcat restart.
 
 Is this a bug with tomcat? Any workarounds?

Likely a bug that was fixed in 6.0.19.  Please move up and try it again.

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



how to configure log4j path to work both in Tomcat and from the CLI?

2010-03-02 Thread fred basset
Hi All,

I use log4j, I'm trying to configure it so that log4j uses a non
hardcoded path, and it resolves the path both when running under
tomcat and running my unit tests from the CLI with ant.

Here's the relevant line from log4j.properties:

log4j.appender.R.File=${catalina.home}/logs/myapp.log


This works fine when I'm running my app. under Tomcat, but when I try
to run my unit tests from ant, log4j tries to log to /logs/myapp.log
(i.e. resolves ${catalina.home} to nothing).
The CATALINA_HOME environment variable is set correctly.

Thanks if anyone can help me on this.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: how to configure log4j path to work both in Tomcat and from the CLI?

2010-03-02 Thread Jon Brisbin
On Mar 2, 2010, at 4:10 PM, fred basset wrote:

 Hi All,
 
 I use log4j, I'm trying to configure it so that log4j uses a non
 hardcoded path, and it resolves the path both when running under
 tomcat and running my unit tests from the CLI with ant.
 
 Here's the relevant line from log4j.properties:
 
 log4j.appender.R.File=${catalina.home}/logs/myapp.log
 
 
 This works fine when I'm running my app. under Tomcat, but when I try
 to run my unit tests from ant, log4j tries to log to /logs/myapp.log
 (i.e. resolves ${catalina.home} to nothing).
 The CATALINA_HOME environment variable is set correctly.


Run your ant script with a -D defined for catalina.home (or any other 
properties that exist in your webapp's environment...ant -h is always helpful 
here ;). e.g.:

ant -Dcatalina.home=/opt/tomcat-6

Jon Brisbin
Portal Webmaster
NPC International, Inc.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Access Log /Filter/?

2010-03-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Xie,

On 3/2/2010 3:58 PM, Xie Xiaodong wrote:
 public class AccessLogFilter
 extends FilterBase {

For the most part, you've just replaced the invoke() method with a
doFilter() method and introduced init(), which calls start(). Then, you
removed all the Lifecycle stuff.

How will Filters be configured in TC7? If they will use the same

filter
  init-param

...style of configuration, then you'll need to have your init() method
fetch all the init-param values and set those values on the
AccessLogFilter before calling start().

I might just re-name start() to init() and make whatever changes are
necessary.

 private static Log log = LogFactory.getLog(AccessLogFilter.class);

Oh, the irony.

 public void doFilter(ServletRequest request, ServletResponse response,
 FilterChain chain) throws IOException, ServletException {
 
 log.info(In AccessLogFilter doFilter. );

Obviously, you can't have this log message at the INFO level. I'll
assume that all logging currently in the code is for development
purposes and will be removed for a final version.

  if (!isHttpServlet(request, response)) {
 chain.doFilter(request, response);
 return;
 }

Why does the request have to be an HTTP request in order to have the
access log run? I would flip the logic around to only do the logging if
the request is an HTTP request, rather than having this mid-method return.

  HttpServletRequest httpRequest = ((HttpServletRequest) request);
 
 HttpServletResponse httpResponse = ((HttpServletResponse) response);
 
 if (started  getEnabled()) {
 // Pass this request on to the next filter in the filterChain
 long t1 = System.currentTimeMillis();
 
 chain.doFilter(request, response);
 
 long t2 = System.currentTimeMillis();
 long time = t2 - t1;

This isn't your choice, it's in the original code, but why not just do:

long elapsed = System.currentTimeMillis();
...
elapsed = System.currentTimeMillis() - elapsed;

??

Fewer items on the stack, etc.

 Date date = getDate();
 StringBuffer result = new StringBuffer();

The original default size for the StringBuffer was 128 characters.
Presumably, this was done to avoid the cost of re-sizing the
StringBuffer whenever it grew too large. The default initial capacity of
a StringBuffer is 16 characters, which is almost certainly too small for
a reasonable access log entry. You should put the larger size back in.

While you're at it, use StringBuilder instead to avoid the overhead of
synchronization for an object in a single-threaded environment.

 public void log(String message) {

Maybe re-write this method to avoid having to convert from
StringBuffer/StringBuilder to String: why do the work if you don't have to?

 private static String lookup(String month) {
 int index;
 try {
 index = Integer.parseInt(month) - 1;

Why not have a dummy month at index 0 and /not/ subtract? Come on...
we're smarter than the Sun engineers, right? 0 = January? Stupid...

 private Date getDate() {
 // Only create a new Date once per second, max.
 long systime = System.currentTimeMillis();
 AccessDateStruct struct = currentDateStruct.get();
 if ((systime - struct.currentDate.getTime())  1000) {
 struct.currentDate.setTime(systime);
 struct.currentDateString = null;
 }
 return struct.currentDate;
 }

I don't understand why this is ThreadLocal, instead of just synchronized
across the object. Maybe it's slightly faster to avoid the
synchronization and just use ThreadLocals, but I'm not sure how many
requests per second a single Thread is going to process, so I'm not
convinced that caching this data is worth the complexity it requires in
this class. I'd love to hear from a Tomcat dev about this.

 protected static class ByteSentElement implements AccessLogElement {
 private boolean conversion;
 
 /**
  * if conversion is true, write '-' instead of 0 - %b
  */
 public ByteSentElement(boolean conversion) {
 this.conversion = conversion;
 }
 
 public void addElement(StringBuffer buf, Date date,
 HttpServletRequest request, HttpServletResponse response,
 long time) {
 long length = 0;
 if (response.getHeader(Content-Length) != null
  !.equals(response.getHeader(Content-Length))) {
 length =
 Long.parseLong(response.getHeader(Content-Length));
 }
 if (length = 0  response.getHeader(content-length) != null
  !.equals(response.getHeader(content-length))) {
 length =
 Long.parseLong(response.getHeader(content-length));
 }
 if (length = 0  conversion) {
 buf.append('-');
 } else {
 buf.append(length);
 }
 }
 }

Note that this class will only report what was sent with the
Content-Length header, rather than actually counting 

Re: unified doXXX()

2010-03-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aryeh,

On 3/2/2010 4:05 PM, Aryeh M. Friedman wrote:
 Aryeh M. Friedman wrote:
 Aryeh M. Friedman wrote:
 Christopher Schultz wrote:

 I know this sounds silly, but we're getting down to the
 grasping-at-straws level, here, so bear with me: have you checked to see
 that your request body is actually in the correct format (that is,
 urlencoded, etc.)? I haven't looked at the Tomcat code, but Tomcat might
 give up if the request body is not parsable.

 Have you tried calling request.getInputStream and dumping the request
 body when the parameter is null? That might give you some indication of
 what's happening.

 The client does url encode in addition to translating any chars that
 are used either by tomcat and/or or app to decode the reaquest (namely
 = is translated to ^, comma to #, right/left parens to @ and $
 respectivally) then I use javascripts escape(string) method to url
 encode it the app by default uses post but if I cut and paste the
 resulting payload into a GET and pass it to the app it works fine
 (i.e. the app uses POST but I do manual testing with GET)

Wait, what? Why all that extra encoding? Well, I guess you know what
you're doing.

 opps forgot to mention the manual test works for both the new and old
 format but the automated method only works for the old format (both
 formats use the one param to rule them all strategy)

Obviously, something is different. Check everything between your manual
and automated tests and see what is different. Maybe it's a trailing
newline. Maybe it's a Content-Length header. Whatever it is, apparently,
it's significant.

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

iEYEARECAAYFAkuNl08ACgkQ9CaO5/Lv0PDBlgCgsgeTljstZhft+VK0ail2xfPC
hWsAnje2YQ7OMKt3u6bjfBT6z5zSXTs8
=gh1k
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: unified doXXX()

2010-03-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aryeh,

On 3/2/2010 4:12 PM, Aryeh M. Friedman wrote:
 Also forgot to mention I already refactored the servlet to use pure
 hex encoding (namely we convert the entire request into a hex string
 so for example a old format message of
 call=default.Session.getSession() gets translated into 
 63616c6c3d64656661756c742e53657373696f6e2e67657453657373696f6e2829
 

If that string above is your entire POST request body, then it's not
properly formatted. Instead, it should be:

call=8347812459870132405987234985023450987

or whatever. The parameter has to have a name :)

 by new format I only mean we got a query string that exceeds 1k for
 the first time

You'll likely to have to switch to POST for query strings that exceed
1k. Good motivation to get this working!

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

iEYEARECAAYFAkuNl9sACgkQ9CaO5/Lv0PA/TwCfTYmTmuLNR2ZMyQNd+vKKNwm+
YcMAoIWqULxZ9s2v1mZ63xAZFjhO+/CR
=S8tm
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: remote debug with tomcat 3.3.2

2010-03-02 Thread Pid

On 02/03/2010 15:28, Kedzior Wojciech wrote:

Hi Chuck,

Thanks for your answer.

That is exactly how I feel.  However I'm not the person responsible for these 
kinds of decisions within the company.  I am merely trying to help the guys 
here by being more (much much more) efficient by using a debugger instead of 
log files when developing code.

To be honest I have no idea why they use such an old version of Tomcat.  And I 
hope RND or someone is looking at upgrading.  I also suspect that there are 
some proprietary libraries involved here, which may hinder a tomcat upgrade.

I hate it, but I have to do with what I have and I'm just trying to get the 
best out of what I have.

So, any other suggestions?


http://www.monster.fr/   ;o)


p


Cheers

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
Sent: 2. března 2010 15:16
To: Tomcat Users List
Subject: RE: remote debug with tomcat 3.3.2


From: Kedzior Wojciech [mailto:wojciech.kedz...@gemalto.com]
Subject: remote debug with tomcat 3.3.2

I'm having a problem with setting up a remote debug session to my
Tomcat 3.3.2 Final.


You're asking for help with a version of Tomcat that's six years old and hasn't 
been supported for ages?  Not to mention buggier and much slower than the 
current releases.

Your time would be better spent moving up to a supported level and then working 
on the debugging.

  - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: DB connection error -Tomcat 6 config

2010-03-02 Thread Propes, Barry L
I wonder now...should I perhaps be using this jar?   ojdbc6.jar  ?

Has anyone upgraded their Oracle drivers that's using TC 6 and JDK 1.6?

If anyone has used these environments together and needed to make the change, 
please apprise.

Thanks,

Barry 

-Original Message-
From: Propes, Barry L [GCG-NAOT] 
Sent: Tuesday, March 02, 2010 9:50 AM
To: 'Tomcat Users List'
Subject: RE: DB connection error -Tomcat 6 config

Really? Well, when I was implementing connection pooling in 4.1.31, I 
specifically remember having to use  ojdbc14_g.jar instead of ojdbc14.jar to 
successfully get the conn pooling to work.

I'll swap out the ojdbc14_g.jar  for the ojdbc14.jar and just use the latter 
and see if that works.

Thanks, Karthik.

-Original Message-
From: Karthik Nanjangude [mailto:karthik.nanjang...@xius-bcgi.com]
Sent: Monday, March 01, 2010 10:59 PM
To: Tomcat Users List
Subject: RE: DB connection error -Tomcat 6 config

Hi

Please double check the ojdbc14.jar size, Some times I find the jar files 
corrupt due to various reasons.

Also check only 1 copy of this 'jar' exists in /TOMCAT6.0.2.0/lib directory 
and make sure the same does not exist within the web application.

ojdbc14_g.jar is used for advance debug purpose, although it works try with 
normal ojdbc14.jar




With regards
karthik

-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Sent: Tuesday, March 02, 2010 4:44 AM
To: 'Tomcat Users List'
Subject: RE: DB connection error -Tomcat 6 config

Sorry, no.

webapps/chngctrl/META-INF/context.xml.

Thanks, Chuck.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
Sent: Monday, March 01, 2010 4:29 PM
To: Tomcat Users List
Subject: RE: DB connection error -Tomcat 6 config

 From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
 Subject: RE: DB connection error -Tomcat 6 config

 If I try to reference the resource reference in the 
 webapps/META-INF/context.xml file,

Is that the real location?  If so, it's not valid.  The webapps directory is 
the default directory under which each webapp is normally deployed; there must 
be a webapp name between webapps and META-INF (e.g., ROOT).  Any other 
construct is incorrect.

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Access Log /Filter/?

2010-03-02 Thread Xie Xiaodong
Thank the comments. I should have rechecked this file before I sent it here.
:)

First, for the init() part: in the super class FilterBase, we have a init()
method which will do the initialization work you mentioned.

Second, you are absolutely right about the log.info(). I first wrote
like this for testing and forgot to get it back to debug level.

In modern jvm, it does not matter much between StringBuffer and
StringBuilder, jvm will change StringBuffer used in single
thread scenario into StringBuilder automaticlly. You could google this
information. There are some benchmark test about it.

I'll check the remaining part tomorrow morning. It is rather late now.

Wish you have a nice day.

Thanks for the comments.


On Tue, Mar 2, 2010 at 11:51 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Xie,

 On 3/2/2010 3:58 PM, Xie Xiaodong wrote:
  public class AccessLogFilter
  extends FilterBase {

 For the most part, you've just replaced the invoke() method with a
 doFilter() method and introduced init(), which calls start(). Then, you
 removed all the Lifecycle stuff.

 How will Filters be configured in TC7? If they will use the same

 filter
  init-param

 ...style of configuration, then you'll need to have your init() method
 fetch all the init-param values and set those values on the
 AccessLogFilter before calling start().

 I might just re-name start() to init() and make whatever changes are
 necessary.

  private static Log log = LogFactory.getLog(AccessLogFilter.class);

 Oh, the irony.

  public void doFilter(ServletRequest request, ServletResponse response,
  FilterChain chain) throws IOException, ServletException {
 
  log.info(In AccessLogFilter doFilter. );

 Obviously, you can't have this log message at the INFO level. I'll
 assume that all logging currently in the code is for development
 purposes and will be removed for a final version.

   if (!isHttpServlet(request, response)) {
  chain.doFilter(request, response);
  return;
  }

 Why does the request have to be an HTTP request in order to have the
 access log run? I would flip the logic around to only do the logging if
 the request is an HTTP request, rather than having this mid-method return.

   HttpServletRequest httpRequest = ((HttpServletRequest) request);
 
  HttpServletResponse httpResponse = ((HttpServletResponse) response);
 
  if (started  getEnabled()) {
  // Pass this request on to the next filter in the filterChain
  long t1 = System.currentTimeMillis();
 
  chain.doFilter(request, response);
 
  long t2 = System.currentTimeMillis();
  long time = t2 - t1;

 This isn't your choice, it's in the original code, but why not just do:

 long elapsed = System.currentTimeMillis();
 ...
 elapsed = System.currentTimeMillis() - elapsed;

 ??

 Fewer items on the stack, etc.

  Date date = getDate();
  StringBuffer result = new StringBuffer();

 The original default size for the StringBuffer was 128 characters.
 Presumably, this was done to avoid the cost of re-sizing the
 StringBuffer whenever it grew too large. The default initial capacity of
 a StringBuffer is 16 characters, which is almost certainly too small for
 a reasonable access log entry. You should put the larger size back in.

 While you're at it, use StringBuilder instead to avoid the overhead of
 synchronization for an object in a single-threaded environment.

  public void log(String message) {

 Maybe re-write this method to avoid having to convert from
 StringBuffer/StringBuilder to String: why do the work if you don't have to?

  private static String lookup(String month) {
  int index;
  try {
  index = Integer.parseInt(month) - 1;

 Why not have a dummy month at index 0 and /not/ subtract? Come on...
 we're smarter than the Sun engineers, right? 0 = January? Stupid...

  private Date getDate() {
  // Only create a new Date once per second, max.
  long systime = System.currentTimeMillis();
  AccessDateStruct struct = currentDateStruct.get();
  if ((systime - struct.currentDate.getTime())  1000) {
  struct.currentDate.setTime(systime);
  struct.currentDateString = null;
  }
  return struct.currentDate;
  }

 I don't understand why this is ThreadLocal, instead of just synchronized
 across the object. Maybe it's slightly faster to avoid the
 synchronization and just use ThreadLocals, but I'm not sure how many
 requests per second a single Thread is going to process, so I'm not
 convinced that caching this data is worth the complexity it requires in
 this class. I'd love to hear from a Tomcat dev about this.

  protected static class ByteSentElement implements AccessLogElement {
  private boolean conversion;
 
  /**
   * if conversion is true, write '-' instead of 0 - %b
   */
  public ByteSentElement(boolean 

Re: DB connection error -Tomcat 6 config

2010-03-02 Thread Hassan Schroeder
On Tue, Mar 2, 2010 at 3:18 PM, Propes, Barry L barry.l.pro...@citi.com wrote:
 I wonder now...should I perhaps be using this jar?   ojdbc6.jar  ?

 Has anyone upgraded their Oracle drivers that's using TC 6 and JDK 1.6?

 If anyone has used these environments together and needed to make the change, 
 please apprise.

Not sure how relevant this is, but last year I had a test installation of
Tomcat 6.0.18 + Java 6 (not sure now which release exactly) running
a JRuby on Rails app with ojdbc14.jar as the driver (in WEB-INF/lib).

So it works, for some value of work :-)

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: unified doXXX()

2010-03-02 Thread Pid

On 02/03/2010 21:04, Aryeh M. Friedman wrote:

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aryeh,

On 3/2/2010 3:48 PM, Aryeh M. Friedman wrote:

Christopher Schultz wrote:


Is this a new client, or just a new data format? Mark's suggestion that
you may be using POST without the proper Content-Type would result in
getting null for this parameter (because Tomcat will not parse it for
you). If this is the case, you should either fix the new client to use
the proper Content-Type, or fall-back to reading and parsing the
request
body manually when these requirements are not met.

New format same frontend client code which does use the proper content
type. (the content type is defined at a lower level then the format and
that code has not changed [using firebug on firefox confirms that fact])


Hmm.

So, POST + application/x-www-form-urlencoded yields a null parameter
with your new payload?

I know this sounds silly, but we're getting down to the
grasping-at-straws level, here, so bear with me: have you checked to see
that your request body is actually in the correct format (that is,
urlencoded, etc.)? I haven't looked at the Tomcat code, but Tomcat might
give up if the request body is not parsable.

Have you tried calling request.getInputStream and dumping the request
body when the parameter is null? That might give you some indication of
what's happening.

The client does url encode in addition to translating any chars that are
used either by tomcat and/or or app to decode the reaquest (namely = is
translated to ^, comma to #, right/left parens to @ and $ respectivally)
then I use javascripts escape(string) method to url encode it the
app by default uses post but if I cut and paste the resulting payload
into a GET and pass it to the app it works fine (i.e. the app uses POST
but I do manual testing with GET)


Small aside: are javascript encodeURI() or encodeURIComponent() not 
suitable for some reason?  (I ask out of curiosity)



p


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: DB connection error -Tomcat 6 config

2010-03-02 Thread Propes, Barry L
Then that should work...are you using DBCP with it?

Thanks. 

-Original Message-
From: Hassan Schroeder [mailto:hassan.schroe...@gmail.com] 
Sent: Tuesday, March 02, 2010 5:34 PM
To: Tomcat Users List
Subject: Re: DB connection error -Tomcat 6 config

On Tue, Mar 2, 2010 at 3:18 PM, Propes, Barry L barry.l.pro...@citi.com wrote:
 I wonder now...should I perhaps be using this jar?   ojdbc6.jar  ?

 Has anyone upgraded their Oracle drivers that's using TC 6 and JDK 1.6?

 If anyone has used these environments together and needed to make the change, 
 please apprise.

Not sure how relevant this is, but last year I had a test installation of 
Tomcat 6.0.18 + Java 6 (not sure now which release exactly) running a JRuby on 
Rails app with ojdbc14.jar as the driver (in WEB-INF/lib).

So it works, for some value of work :-)

--
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat threads

2010-03-02 Thread Bharath Vasudevan
Hi,

I would like to know more on the threads created in tomcat. Are they user
level threads or kernel threads?

I see that the requests are kicked off through the threads from a pool
(which has a configured size), how can this be scalable?

Also, from my understanding in servlets, the response for a request in has
to be done then and there (as in I cant respond for a request later in
future from some random thread) .

If there is contention for a resource which might take time (causing the
response to take time), wont tomcat run out of threads?

Regards,
Bharath


Re: DB connection error -Tomcat 6 config

2010-03-02 Thread Hassan Schroeder
On Tue, Mar 2, 2010 at 3:39 PM, Propes, Barry L barry.l.pro...@citi.com wrote:
 Then that should work...are you using DBCP with it?

I don't *believe* so; possibly ActiveRecord/activerecord-jdbc-adapter
was doing pooling under the hood but it was strictly a proof of concept
for the client so I really didn't care about performance at that point.

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat threads

2010-03-02 Thread Caldarale, Charles R
 From: Bharath Vasudevan [mailto:bharath@gmail.com]
 Subject: Tomcat threads
 
 Are they user level threads or kernel threads?

Depends on the particular JVM being used, not on Tomcat.  Pretty much all 
modern JVMs use a kernel thread for each java.lang.Thread instance on which 
start() has been called.

 I see that the requests are kicked off through the threads from a pool
 (which has a configured size), how can this be scalable?

Because you can make the limit as large as you want.  Making it too large 
leaves you open to DOS attacks and running out of resources on the server.

 Also, from my understanding in servlets, the response for a 
 request in has to be done then and there (as in I cant respond
 for a request later in future from some random thread) .

That's the nature of HTTP, not servlets in particular.  A properly designed 
application facing a long-duration situation will usually send an interim 
status back to the client, and kick off an auxiliary thread to do whatever is 
going to run for a while.  The auxiliary thread places the final response in 
some location associated with the client when it's ready.  The client polls for 
status and the final response using JavaScript or some other mechanism.

 If there is contention for a resource which might take time
 (causing the response to take time), wont tomcat run out of
 threads?

Yes; Tomcat won't care, but your users might.  Don't use poorly designed 
applications.

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: DB connection error -Tomcat 6 config

2010-03-02 Thread Propes, Barry L
Oh ok.

Thanks. 

-Original Message-
From: Hassan Schroeder [mailto:hassan.schroe...@gmail.com] 
Sent: Tuesday, March 02, 2010 5:53 PM
To: Tomcat Users List
Subject: Re: DB connection error -Tomcat 6 config

On Tue, Mar 2, 2010 at 3:39 PM, Propes, Barry L barry.l.pro...@citi.com wrote:
 Then that should work...are you using DBCP with it?

I don't *believe* so; possibly ActiveRecord/activerecord-jdbc-adapter
was doing pooling under the hood but it was strictly a proof of concept for the 
client so I really didn't care about performance at that point.

--
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: unified doXXX()

2010-03-02 Thread Aryeh M. Friedman

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aryeh,

On 3/2/2010 4:05 PM, Aryeh M. Friedman wrote:
  

Aryeh M. Friedman wrote:


Aryeh M. Friedman wrote:
  

Christopher Schultz wrote:

I know this sounds silly, but we're getting down to the
grasping-at-straws level, here, so bear with me: have you checked to see
that your request body is actually in the correct format (that is,
urlencoded, etc.)? I haven't looked at the Tomcat code, but Tomcat might
give up if the request body is not parsable.

Have you tried calling request.getInputStream and dumping the request
body when the parameter is null? That might give you some indication of
what's happening.


The client does url encode in addition to translating any chars that
are used either by tomcat and/or or app to decode the reaquest (namely
= is translated to ^, comma to #, right/left parens to @ and $
respectivally) then I use javascripts escape(string) method to url
encode it the app by default uses post but if I cut and paste the
resulting payload into a GET and pass it to the app it works fine
(i.e. the app uses POST but I do manual testing with GET)
  


Wait, what? Why all that extra encoding? Well, I guess you know what
you're doing.

  

opps forgot to mention the manual test works for both the new and old
format but the automated method only works for the old format (both
formats use the one param to rule them all strategy)



Obviously, something is different. Check everything between your manual
and automated tests and see what is different. Maybe it's a trailing
newline. Maybe it's a Content-Length header. Whatever it is, apparently,
it's significant.

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

iEYEARECAAYFAkuNl08ACgkQ9CaO5/Lv0PDBlgCgsgeTljstZhft+VK0ail2xfPC
hWsAnje2YQ7OMKt3u6bjfBT6z5zSXTs8
=gh1k
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


  

The above issues is why we switched to the hex encoding scheme

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: unified doXXX()

2010-03-02 Thread Aryeh M. Friedman

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aryeh,

On 3/2/2010 4:12 PM, Aryeh M. Friedman wrote:
  

Also forgot to mention I already refactored the servlet to use pure
hex encoding (namely we convert the entire request into a hex string
so for example a old format message of
call=default.Session.getSession() gets translated into 
63616c6c3d64656661756c742e53657373696f6e2e67657453657373696f6e2829





If that string above is your entire POST request body, then it's not
properly formatted. Instead, it should be:

call=8347812459870132405987234985023450987

or whatever. The parameter has to have a name :)
  


Design decision for two reasons:

1. If we are already decoding the request from hex to plain text 
mightiest  use getReader()


2. Our app needs to support several frontends (not just the web via a 
servlet)


Just for reference here is the refactored servlet with any trade secret 
code removed (all the tomcat--servlet logic is kept)


// src/backend/servlet/Servlet.java
package backend.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.Reader;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import backend.util.StringUtil; // hex encoding/decoding

public class Servlet extends HttpServlet
{
   public void doGet(HttpServletRequest request,
  HttpServletResponse response)
   throws IOException
   {
   handleRequest(request,response);
   }

   public void doPost(HttpServletRequest request,
  HttpServletResponse response)
   throws IOException
   {
   handleRequest(request,response);
   }

   private void handleRequest(HttpServletRequest request,
  HttpServletResponse response)
   throws IOException
   {
// not possible to do custom error reporting yet 
because we have no writer to write to

   PrintWriter pw=new PrintWriter(response.getWriter());
   String call=null;

   try {
   call=StringUtil.hexToString(
   readRequest(request)).substring(5);
   } catch(IOException e) {
   write out error in custom format
   }

   code to do something with the request
   }

   private String readRequest(HttpServletRequest request)
   throws IOException
   {
   if(request.getMethod().equals(GET))
   return request.getQueryString();

   String out=;
   Reader reader=request.getReader();

   // reading all the content in one read causes problems 
sometimes so we read it char by char

   for(int i=0;irequest.getContentLength();i++)
   out+=(char) reader.read();

   return out;
   }

   private static final long serialVersionUID=0L;
}


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Access Log /Filter/?

2010-03-02 Thread Jason Brittain
Hi Christopher.

On Tue, Mar 2, 2010 at 2:51 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Xie,

 [snip]

   if (!isHttpServlet(request, response)) {
  chain.doFilter(request, response);
  return;
  }

 Why does the request have to be an HTTP request in order to have the
 access log run?


That does seem to be a bug.  By default, the access logger logs the common
log web server
format, but of course it doesn't have to, so it should log non-HTTP requests
as well, but maybe
only if a non-default pattern is configured?


  long t2 = System.currentTimeMillis();
  long time = t2 - t1;

 This isn't your choice, it's in the original code, but why not just do:

 long elapsed = System.currentTimeMillis();
 ...
 elapsed = System.currentTimeMillis() - elapsed;

 ??

 Fewer items on the stack, etc.


Except that then it is more difficult to debug.  Right?  It isn't as easy to
inspect the value of
the current time if you perform the subtraction without first assigning the
current time to a
variable.


   Date date = getDate();
  StringBuffer result = new StringBuffer();

 The original default size for the StringBuffer was 128 characters.
 Presumably, this was done to avoid the cost of re-sizing the
 StringBuffer whenever it grew too large. The default initial capacity of
 a StringBuffer is 16 characters, which is almost certainly too small for
 a reasonable access log entry. You should put the larger size back in.

 While you're at it, use StringBuilder instead to avoid the overhead of
 synchronization for an object in a single-threaded environment.


Yes, using StringBuilder would probably make people worry less.  :)


   public void log(String message) {

 Maybe re-write this method to avoid having to convert from
 StringBuffer/StringBuilder to String: why do the work if you don't have to?

  private static String lookup(String month) {
  int index;
  try {
  index = Integer.parseInt(month) - 1;

 Why not have a dummy month at index 0 and /not/ subtract? Come on...
 we're smarter than the Sun engineers, right? 0 = January? Stupid...


There might be a small opportunity for optimization/cleanup there.


   private Date getDate() {
  // Only create a new Date once per second, max.
  long systime = System.currentTimeMillis();
  AccessDateStruct struct = currentDateStruct.get();
  if ((systime - struct.currentDate.getTime())  1000) {
  struct.currentDate.setTime(systime);
  struct.currentDateString = null;
  }
  return struct.currentDate;
  }

 I don't understand why this is ThreadLocal, instead of just synchronized
 across the object. Maybe it's slightly faster to avoid the
 synchronization and just use ThreadLocals, but I'm not sure how many
 requests per second a single Thread is going to process, so I'm not
 convinced that caching this data is worth the complexity it requires in
 this class. I'd love to hear from a Tomcat dev about this.


Tomcat can (hopefully) answer a larger number of requests per second
every year on decently modern hardware.  Benchmark it both ways on
a reasonably good/wide machine and you'll see why avoiding the sync
is helpful.  I don't think it muddies the code very badly here.


  protected static class ByteSentElement implements AccessLogElement {
  private boolean conversion;
 
  /**
   * if conversion is true, write '-' instead of 0 - %b
   */
  public ByteSentElement(boolean conversion) {
  this.conversion = conversion;
  }
 
  public void addElement(StringBuffer buf, Date date,
  HttpServletRequest request, HttpServletResponse response,
  long time) {
  long length = 0;
  if (response.getHeader(Content-Length) != null
   !.equals(response.getHeader(Content-Length)))
 {
  length =
  Long.parseLong(response.getHeader(Content-Length));
  }
  if (length = 0  response.getHeader(content-length) !=
 null
   !.equals(response.getHeader(content-length)))
 {
  length =
  Long.parseLong(response.getHeader(content-length));
  }
  if (length = 0  conversion) {
  buf.append('-');
  } else {
  buf.append(length);
  }
  }
  }

 Note that this class will only report what was sent with the
 Content-Length header, rather than actually counting the bytes that were
 sent. Fixing this requires an architectural change: the BytesSentElement
 must be able to observe the OutputStream/Writer used by the servlet and
 count the bytes that were sent.

 Also, this method can cause an error if the Content-Type exceeds 2^31-1,
 which is bad. :( Why bother parsing the Content-Length in this case?

 This leads to another question: if the class is improved to actually
 count bytes, how will you 

Re: Tomcat threads

2010-03-02 Thread Bharath Vasudevan
Thanks Chuck.

One thing I am not able to get is why would the user care if the response
was done from a different thread? Is it not going to be opaque to the user
as long as its fast?

If we get a request on a thread, let some other thread do the work for it
and store the response info. The thread which does the work writes the
response on that request.

Regards,
Bharath

On Tue, Mar 2, 2010 at 3:57 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Bharath Vasudevan [mailto:bharath@gmail.com]
  Subject: Tomcat threads
 
  Are they user level threads or kernel threads?

 Depends on the particular JVM being used, not on Tomcat.  Pretty much all
 modern JVMs use a kernel thread for each java.lang.Thread instance on which
 start() has been called.

  I see that the requests are kicked off through the threads from a pool
  (which has a configured size), how can this be scalable?

 Because you can make the limit as large as you want.  Making it too large
 leaves you open to DOS attacks and running out of resources on the server.

  Also, from my understanding in servlets, the response for a
  request in has to be done then and there (as in I cant respond
  for a request later in future from some random thread) .

 That's the nature of HTTP, not servlets in particular.  A properly designed
 application facing a long-duration situation will usually send an interim
 status back to the client, and kick off an auxiliary thread to do whatever
 is going to run for a while.  The auxiliary thread places the final response
 in some location associated with the client when it's ready.  The client
 polls for status and the final response using JavaScript or some other
 mechanism.

  If there is contention for a resource which might take time
  (causing the response to take time), wont tomcat run out of
  threads?

 Yes; Tomcat won't care, but your users might.  Don't use poorly designed
 applications.

  - Chuck


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


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




RE: Tomcat threads

2010-03-02 Thread Caldarale, Charles R
 From: Bharath Vasudevan [mailto:bharath@gmail.com]
 Subject: Re: Tomcat threads
 
 If we get a request on a thread, let some other thread do 
 the work for it and store the response info. The thread 
 which does the work writes the response on that request.

If the processing is fast, why would you go to the complexity and overhead of 
switching to another thread to process the request?

You should also read the servlet spec, in particular SRV.2.3.3.3:

Implementations of the request and response objects are not guaranteed to be 
thread
safe. This means that they should only be used within the scope of the request 
handling
thread.

References to the request and response objects should not be given to objects
executing in other threads as the resulting behavior may be nondeterministic. If
the thread created by the application uses the container-managed objects, such 
as
the request or response object, those objects must be accessed only within the
servlet's service life cycle and such thread itself should have a life cycle 
within
the life cycle of the servlet's service method because accessing those objects
after the service method ends may cause undeterministic problems.

The illogical behavior you're asking for simply isn't allowed.

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat threads

2010-03-02 Thread Bharath Vasudevan
Why is it illlogical? Fast is a relative term. If the number of requests
increases, the number of threads that can be handled by the system goes down
. The context switches and the pain to handle the switches makes handling of
the requests in lesser threads which is scalable.

On Tue, Mar 2, 2010 at 4:34 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Bharath Vasudevan [mailto:bharath@gmail.com]
  Subject: Re: Tomcat threads
 
  If we get a request on a thread, let some other thread do
  the work for it and store the response info. The thread
  which does the work writes the response on that request.

 If the processing is fast, why would you go to the complexity and overhead
 of switching to another thread to process the request?

 You should also read the servlet spec, in particular SRV.2.3.3.3:

 Implementations of the request and response objects are not guaranteed to
 be thread
 safe. This means that they should only be used within the scope of the
 request handling
 thread.

 References to the request and response objects should not be given to
 objects
 executing in other threads as the resulting behavior may be
 nondeterministic. If
 the thread created by the application uses the container-managed objects,
 such as
 the request or response object, those objects must be accessed only within
 the
 servlet's service life cycle and such thread itself should have a life
 cycle within
 the life cycle of the servlet's service method because accessing those
 objects
 after the service method ends may cause undeterministic problems.

 The illogical behavior you're asking for simply isn't allowed.

  - Chuck


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


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: DB connection error -Tomcat 6 config

2010-03-02 Thread Mark Shifman

Propes, Barry L wrote:

I wonder now...should I perhaps be using this jar?   ojdbc6.jar  ?

Has anyone upgraded their Oracle drivers that's using TC 6 and JDK 1.6?

If anyone has used these environments together and needed to make the change, 
please apprise.
  
I am using ojdbc6.jar with tomcat 6 (two different versions) and it 
works just fine.  I am using dbcp that comes with tomcat 6 without any 
problems.


There were some things that weren't implemented correctly/well in 
ojdbc14, which work with ojdbc6, some calls for getting metadata from 
prepared
statements or result sets (can't remember the exact details).  ojdbc6 
seems to work just fine.


mas

Thanks,

Barry 


-Original Message-
From: Propes, Barry L [GCG-NAOT] 
Sent: Tuesday, March 02, 2010 9:50 AM

To: 'Tomcat Users List'
Subject: RE: DB connection error -Tomcat 6 config

Really? Well, when I was implementing connection pooling in 4.1.31, I 
specifically remember having to use  ojdbc14_g.jar instead of ojdbc14.jar to 
successfully get the conn pooling to work.

I'll swap out the ojdbc14_g.jar  for the ojdbc14.jar and just use the latter 
and see if that works.

Thanks, Karthik.

-Original Message-
From: Karthik Nanjangude [mailto:karthik.nanjang...@xius-bcgi.com]
Sent: Monday, March 01, 2010 10:59 PM
To: Tomcat Users List
Subject: RE: DB connection error -Tomcat 6 config

Hi

Please double check the ojdbc14.jar size, Some times I find the jar files 
corrupt due to various reasons.

Also check only 1 copy of this 'jar' exists in /TOMCAT6.0.2.0/lib directory 
and make sure the same does not exist within the web application.

ojdbc14_g.jar is used for advance debug purpose, although it works try with 
normal ojdbc14.jar




With regards
karthik

-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Sent: Tuesday, March 02, 2010 4:44 AM
To: 'Tomcat Users List'
Subject: RE: DB connection error -Tomcat 6 config

Sorry, no.

webapps/chngctrl/META-INF/context.xml.

Thanks, Chuck.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
Sent: Monday, March 01, 2010 4:29 PM
To: Tomcat Users List
Subject: RE: DB connection error -Tomcat 6 config

  

From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Subject: RE: DB connection error -Tomcat 6 config

If I try to reference the resource reference in the 
webapps/META-INF/context.xml file,



Is that the real location?  If so, it's not valid.  The webapps directory is the default directory 
under which each webapp is normally deployed; there must be a webapp name between 
webapps and META-INF (e.g., ROOT).  Any other construct is incorrect.

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

  



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: DB connection error -Tomcat 6 config

2010-03-02 Thread Bob Hall
--- On Tue, 3/2/10 at 3:39 PM, Propes, Barry L barry.l.pro...@citi.com wrote:

 Then that should work...are you using
 DBCP with it?
 
  I wonder now...should I perhaps be using this jar?  
 ojdbc6.jar  ?
 
  Has anyone upgraded their Oracle drivers that's using
 TC 6 and JDK 1.6?
 
  If anyone has used these environments together and
 needed to make the change, please apprise.
 

We did *not* have to upgrade to ojdbc6; we are using:
  ojdbc14 (10.2.0.3.0)
  DBCP
  tomcat 6.0.20
  Java 1.6.0_16
  Oracle 10.2.0.4.0

- Bob




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat dies suddenly

2010-03-02 Thread Carl

This is an update.

Tried Sun JVM 1.6.0_16 (I had already tried 1.6.0_17 and 1.6.0_18... Taylan 
thought 1.6.0_16 worked properly in his environment.)  Failed with the same 
indicator as the other tests: brought it up on Sunday, failed about 11:00AM 
this morning (the T105 AMD 64 bit Slackware, etc.)


Switched to the T110 (64 bit Intel Slackware, etc.) and it failed at about 
2:30PM today.  The load today has been steady but not overly heavy.


Have had problems getting any information from strace.  Konstantin was 
correct that using start.sh caused a fork which meant strace had to be 
started with the '-f' option.  However, my first attempts caused strace to 
crash:


r...@tomcat2:/usr/local/tomcat_wars# *** glibc detected *** strace: free(): 
invalid next size (normal): 0x00657dd0 ***

=== Backtrace: =
/lib64/libc.so.6[0x7f1f530347e8]
/lib64/libc.so.6(cfree+0x76)[0x7f1f53036da6]
strace[0x40b700]
strace[0x4061a5]
strace[0x40442e]
strace[0x405434]
/lib64/libc.so.6(__libc_start_main+0xe6)[0x7f1f52fdb526]
strace[0x402cf9]
=== Memory map: 
0040-0042c000 r-xp  08:03 55356 
/usr/bin/strace
0062b000-00648000 rw-p 0002b000 08:03 55356 
/usr/bin/strace
00648000-00678000 rw-p 00648000 00:00 0 
[heap]

7f1f4c00-7f1f4c021000 rw-p 7f1f4c00 00:00 0
7f1f4c021000-7f1f5000 ---p 7f1f4c021000 00:00 0
7f1f52da6000-7f1f52dbc000 r-xp  08:03 105 
/usr/lib64/libgcc_s.so.1
7f1f52dbc000-7f1f52fbc000 ---p 00016000 08:03 105 
/usr/lib64/libgcc_s.so.1
7f1f52fbc000-7f1f52fbd000 rw-p 00016000 08:03 105 
/usr/lib64/libgcc_s.so.1
7f1f52fbd000-7f1f53124000 r-xp  08:01 10709 
/lib64/libc-2.9.so
7f1f53124000-7f1f53323000 ---p 00167000 08:01 10709 
/lib64/libc-2.9.so
7f1f53323000-7f1f53327000 r--p 00166000 08:01 10709 
/lib64/libc-2.9.so
7f1f53327000-7f1f53328000 rw-p 0016a000 08:01 10709 
/lib64/libc-2.9.so

7f1f53328000-7f1f5332d000 rw-p 7f1f53328000 00:00 0
7f1f5332d000-7f1f5334d000 r-xp  08:01 10751 
/lib64/ld-2.9.so

7f1f53525000-7f1f53527000 rw-p 7f1f53525000 00:00 0
7f1f53549000-7f1f5354c000 rw-p 7f1f53549000 00:00 0
7f1f5354c000-7f1f5354d000 r--p 0001f000 08:01 10751 
/lib64/ld-2.9.so
7f1f5354d000-7f1f5354e000 rw-p 0002 08:01 10751 
/lib64/ld-2.9.so
7fffa9d8a000-7fffa9d9f000 rw-p 7ffea000 00:00 0 
[stack]
7fffa9df8000-7fffa9df9000 r-xp 7fffa9df8000 00:00 0 
[vdso]
ff60-ff601000 r-xp  00:00 0 
[vsyscall]


If I started it as a background process:

r...@tomcat2:/usr/local/tomcat/bin# strace -f -o 
/usr/local/tomcat/logs/trace_log.txt.`date '+%Y-%m-%d:%H:%M:%S'` 
/usr/local/tomcat/bin/catalina.sh start 


it quickly crashed:

r...@tomcat2:/usr/local/tomcat/bin# #Using CATALINA_BASE: 
/usr/local/tomcat

Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:/usr/local/java
Using CLASSPATH:   /usr/local/tomcat/bin/bootstrap.jar
*** glibc detected *** strace: munmap_chunk(): invalid pointer: 
0x00657dd0 ***

=== Backtrace: =
/lib64/libc.so.6[0x7f2ff7aa57e8]
strace[0x40b700]
strace[0x4061a5]
strace[0x40442e]
strace[0x405434]
/lib64/libc.so.6(__libc_start_main+0xe6)[0x7f2ff7a4c526]
strace[0x402cf9]
=== Memory map: 
0040-0042c000 r-xp  08:03 55356 
/usr/bin/strace
0062b000-00648000 rw-p 0002b000 08:03 55356 
/usr/bin/strace
00648000-00678000 rw-p 00648000 00:00 0 
[heap]
7f2ff7817000-7f2ff782d000 r-xp  08:03 105 
/usr/lib64/libgcc_s.so.1
7f2ff782d000-7f2ff7a2d000 ---p 00016000 08:03 105 
/usr/lib64/libgcc_s.so.1
7f2ff7a2d000-7f2ff7a2e000 rw-p 00016000 08:03 105 
/usr/lib64/libgcc_s.so.1
7f2ff7a2e000-7f2ff7b95000 r-xp  08:01 10709 
/lib64/libc-2.9.so
7f2ff7b95000-7f2ff7d94000 ---p 00167000 08:01 10709 
/lib64/libc-2.9.so
7f2ff7d94000-7f2ff7d98000 r--p 00166000 08:01 10709 
/lib64/libc-2.9.so
7f2ff7d98000-7f2ff7d99000 rw-p 0016a000 08:01 10709 
/lib64/libc-2.9.so

7f2ff7d99000-7f2ff7d9e000 rw-p 7f2ff7d99000 00:00 0
7f2ff7d9e000-7f2ff7dbe000 r-xp  08:01 10751 
/lib64/ld-2.9.so

7f2ff7f96000-7f2ff7f98000 rw-p 7f2ff7f96000 00:00 0
7f2ff7fba000-7f2ff7fbd000 rw-p 7f2ff7fba000 00:00 0
7f2ff7fbd000-7f2ff7fbe000 r--p 0001f000 08:01 10751 
/lib64/ld-2.9.so
7f2ff7fbe000-7f2ff7fbf000 rw-p 0002 08:01 10751 
/lib64/ld-2.9.so
73ca2000-73cb7000 rw-p 7ffea000 00:00 0 
[stack]
73d2b000-73d2c000 r-xp 73d2b000 00:00 0 
[vdso]
ff60-ff601000 r-xp  00:00 0 
[vsyscall]


I have now started strace (on the T105, AMD, 64 bit Slackware, etc.) from 
the command line in a terminal and it seems to be holding up and the output 
is going to a rapidly growing file.


I have the latest IBM JVM on the T110.  I will switch this to production in 
the morning while holding the above T105 in reserve in case this one goes 
down.


Still looking for the exorcist but we now know that an older version of the 
Sun JVM doesn't do the trick.  Be interesting to see if the IBM JVM cures 

RE: DB connection error -Tomcat 6 config

2010-03-02 Thread Anthony J. Biacco
We're using the 11.2.0.1 oracle jar with the seperate commons-dbcp 1.4 without 
any problems or modifications. This is with 6.0.24 and 6.0.20 under 1.6.0_18 on 
centos 5.

-Tony




Sent from my Windows® phone.

-Original Message-
From: Mark Shifman mark.shif...@yale.edu
Sent: Tuesday, March 02, 2010 6:08 PM
To: Tomcat Users List users@tomcat.apache.org
Subject: Re: DB connection error -Tomcat 6 config

Propes, Barry L wrote:
 I wonder now...should I perhaps be using this jar?   ojdbc6.jar  ?

 Has anyone upgraded their Oracle drivers that's using TC 6 and JDK 1.6?

 If anyone has used these environments together and needed to make the change, 
 please apprise.
   
I am using ojdbc6.jar with tomcat 6 (two different versions) and it 
works just fine.  I am using dbcp that comes with tomcat 6 without any 
problems.

There were some things that weren't implemented correctly/well in 
ojdbc14, which work with ojdbc6, some calls for getting metadata from 
prepared
statements or result sets (can't remember the exact details).  ojdbc6 
seems to work just fine.

mas
 Thanks,

 Barry 

 -Original Message-
 From: Propes, Barry L [GCG-NAOT] 
 Sent: Tuesday, March 02, 2010 9:50 AM
 To: 'Tomcat Users List'
 Subject: RE: DB connection error -Tomcat 6 config

 Really? Well, when I was implementing connection pooling in 4.1.31, I 
 specifically remember having to use  ojdbc14_g.jar instead of ojdbc14.jar to 
 successfully get the conn pooling to work.

 I'll swap out the ojdbc14_g.jar  for the ojdbc14.jar and just use the latter 
 and see if that works.

 Thanks, Karthik.

 -Original Message-
 From: Karthik Nanjangude [mailto:karthik.nanjang...@xius-bcgi.com]
 Sent: Monday, March 01, 2010 10:59 PM
 To: Tomcat Users List
 Subject: RE: DB connection error -Tomcat 6 config

 Hi

 Please double check the ojdbc14.jar size, Some times I find the jar files 
 corrupt due to various reasons.

 Also check only 1 copy of this 'jar' exists in /TOMCAT6.0.2.0/lib directory 
 and make sure the same does not exist within the web application.

 ojdbc14_g.jar is used for advance debug purpose, although it works try with 
 normal ojdbc14.jar




 With regards
 karthik

 -Original Message-
 From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
 Sent: Tuesday, March 02, 2010 4:44 AM
 To: 'Tomcat Users List'
 Subject: RE: DB connection error -Tomcat 6 config

 Sorry, no.

 webapps/chngctrl/META-INF/context.xml.

 Thanks, Chuck.

 -Original Message-
 From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
 Sent: Monday, March 01, 2010 4:29 PM
 To: Tomcat Users List
 Subject: RE: DB connection error -Tomcat 6 config

   
 From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
 Subject: RE: DB connection error -Tomcat 6 config

 If I try to reference the resource reference in the 
 webapps/META-INF/context.xml file,
 

 Is that the real location?  If so, it's not valid.  The webapps directory is 
 the default directory under which each webapp is normally deployed; there 
 must be a webapp name between webapps and META-INF (e.g., ROOT).  Any 
 other construct is incorrect.

  - Chuck


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


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org

   


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat dies suddenly

2010-03-02 Thread Caldarale, Charles R
 From: Carl [mailto:c...@etrak-plus.com]
 Subject: Re: Tomcat dies suddenly
 
 Still looking for the exorcist but we now know that an older 
 version of the Sun JVM doesn't do the trick.

Not necessarily.  6u10 was a major internal upgrade, so it might be interesting 
to try 6u7:

http://java.sun.com/products/archive/j2se/6u7/index.html

(There were no 6u8 or 6u9 releases.)

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




Re: remote debug with tomcat 3.3.2

2010-03-02 Thread Bill Barker
I'm pretty sure that I compiled the binary for 3.3.2 without debugging 
support.  The only thing I can think of is to download the source release of 
3.3.2 and compile it with debugging.


At the time 3.3.2 was released, using a debugger in Java was so painful that 
almost nobody did it.


Kedzior Wojciech wojciech.kedz...@gemalto.com wrote in message 
news:a8dd7b2abeb7b842af607d392ff73c7ee4834af...@croexcfwp03.gemalto.com...

Hello,

I'm having a problem with setting up a remote debug session to my Tomcat 
3.3.2 Final.  I am copying some classes I developed into the working 
directory of an application deployed on tomcat.  I can connect to the 
remote debug port from eclipse but the debugger will not stop on any break 
points what so ever.  Here is my environment:


I specify the following system variables:

JPDA_ADDRESS=8000
JPDA_TRANSPORT=dt_socket

I start my Tomcat with the jpda start parameters.

While tailing the logs I can see the following line:

Listening for transport dt_socket at address: 8000


At this point I can connect to the remote debug port from Eclipse.  I can 
see all the treads running within Tomcat, but my debug will not stop on 
any breakpoints.  Even though the class I am trying to debug was created 
by me in Eclipse and I have the correct source.


The classes were compiled using Java 1.5.0_09.  Tomcat also uses the same 
version of Java.


The tomcat is deployed on Linux RedHat 5.
Eclipse version is 3.5.1


The complied classes have a reference to the .java file.

To prove that the problem occurs with the entire deployment I obtained the 
sources for the deployed application, linked them in my eclipse and set 
some debug points.  I know the flow goes through the line with break 
points because I used some dirty System.err output to prove this.



One thing that may be a hint is that the Tomcat startup log shows the 
following line:


EmbededTomcat: Startup time 45

The thing to note here is that I don't have control over the actual war 
file deployed in tomcat.  I simply get the war from a different department 
in the company, deploy it, and write some classes that the deployed 
application will pick up and use.


I have studied this Embedded Tomcat a little bit and I don't know if this 
could be a problem.


Has someone experienced anything like this before? If so, I would 
appreciate it very much if you could shed some (even the dimmest) light 
onto this.


Thanks,

Wojtek Kedzior






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat threads

2010-03-02 Thread Bill Barker



Caldarale, Charles R chuck.caldar...@unisys.com wrote in message 
news:99c8b2929b39c24493377ac7a121e21f96cb817...@usea-exch8.na.uis.unisys.com...

From: Bharath Vasudevan [mailto:bharath@gmail.com]
Subject: Re: Tomcat threads

If we get a request on a thread, let some other thread do
the work for it and store the response info. The thread
which does the work writes the response on that request.


If the processing is fast, why would you go to the complexity and overhead 
of switching to another thread to process the request?


You should also read the servlet spec, in particular SRV.2.3.3.3:

Implementations of the request and response objects are not guaranteed to 
be thread
safe. This means that they should only be used within the scope of the 
request handling

thread.

References to the request and response objects should not be given to 
objects
executing in other threads as the resulting behavior may be 
nondeterministic. If
the thread created by the application uses the container-managed objects, 
such as
the request or response object, those objects must be accessed only within 
the
servlet's service life cycle and such thread itself should have a life 
cycle within
the life cycle of the servlet's service method because accessing those 
objects

after the service method ends may cause undeterministic problems.

The illogical behavior you're asking for simply isn't allowed.



At least not until Tomcat 7 ;).  In there, you can do exactly what the user 
is asking for using the AsyncContext.  The details are in the Servlet 3.0 
spec, but basically the request is handed off to another thread and the 
original one returns to the pool.  This also allows for two-way 
communication instead of relying on polling.


Of course Comet offers similar functionality in Tomcat 6 if you don't mind 
being bound to Tomcat.



- Chuck


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




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat threads

2010-03-02 Thread Caldarale, Charles R
 From: Bharath Vasudevan [mailto:bharath@gmail.com]
 Subject: Re: Tomcat threads
 
 Why is it illlogical?

40+ years of system architecture experience.

 If the number of requests increases, the number of threads 
 that can be handled by the system goes down.

You'll have to explain that one, since it doesn't make sense as written.

 The context switches and the pain to handle the switches makes
 handling of the requests in lesser threads which is scalable.

Nor does that.  What are you categorizing as a lesser thread?  What makes 
those any more scalable than any other kind of thread?  You're free to set the 
thread pool limit to any value you want, including infinity.  Setting the limit 
to larger than what the logical and physical resources of the system you're 
running on can handle will induce performance problems (e.g., page thrashing, 
excessive GCs) or outright failures as soon as someone decides to start 
pounding on your server.

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat threads

2010-03-02 Thread Caldarale, Charles R
 From: Bill Barker [mailto:billwbar...@verizon.net]
 Subject: Re: Tomcat threads
 
 basically the request is handed off to another thread and the
 original one returns to the pool.  This also allows for two-way
 communication instead of relying on polling.

What's required on the client end?  You can't simply push HTML or other content 
to a browser.  Is a specialized (or at least scripted) client required?

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



java.util.logging - help needed with configuration and problem determination

2010-03-02 Thread Stuart Grace
I'm using JSVC to start Tomcat 6.0.20 as a daemon on Solaris.  Java is 
jdk1.6.0_16. 
I need to deploy the same war file as 2 different contexts.  Each context 
has the same logging.properties file in the classes directory.  The 
conf/logging.properties has not been changed.

Problem:  The logging from both contexts IBINET and IBMIN are being 
written to both logs.  ie IBINET.-mm-dd.log and IBMIN--mm-dd.log.  


This did work on my PC where jsvc was not being used.   Very difficult to 
test with out jsvc on Solaris due to firewall. 

Does the logging.properties file below look correct for loggers named 
eocene.web.*  ? 



logging.properties
handlers = 6IBINET.org.apache.juli.FileHandler, 
7IBMIN.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

6IBINET.org.apache.juli.FileHandler.level = FINE
6IBINET.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
6IBINET.org.apache.juli.FileHandler.prefix = IBINET.

7IBMIN.org.apache.juli.FileHandler.level = FINE
7IBMIN.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
7IBMIN.org.apache.juli.FileHandler.prefix = IBMIN.

eocene.web.*.[Catalina].[localhost].[/IBINET].level = FINE
eocene.web.*.[Catalina].[localhost].[/IBINET].handlers = 
6IBINET.org.apache.juli.FileHandler

eocene.web.*.[Catalina].[localhost].[/IBMIN].level = FINE
eocene.web.*.[Catalina].[localhost].[/IBMIN].handlers = 
7IBMIN.org.apache.juli.FileHandler

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = 
java.util.logging.SimpleFormatter

startup script looks like 
case $1 in
  start)
#
# Start Tomcat
#
$DAEMON_HOME/jsvc \
-user $TOMCAT_USER \
-home $JAVA_HOME \
-Dcatalina.home=$CATALINA_HOME \
-Dcatalina.base=$CATALINA_BASE \
-Djava.io.tmpdir=$TMP_DIR \
-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties 
\
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
-wait 10 \
-pidfile $PID_FILE \
-outfile $CATALINA_HOME/logs/catalina.out \
-errfile '1' \
$CATALINA_OPTS \
-cp $CLASSPATH \
org.apache.catalina.startup.Bootstrap
#
# To get a verbose JVM
#-verbose \
# To get a debug of jsvc.
#-debug \
exit $?
;;

IBINET and IBMIN logs contain the same exact data from both contexts
 =ls -l logs
total 82
-rw-r--r--   1 eocene01 atthb3589930 Mar  2 23:26 
IBINET.2010-03-02.log
-rw-r--r--   1 eocene01 atthb3589930 Mar  2 23:26 IBMIN.2010-03-02.log
-rw-r--r--   1 root other   1377 Mar  2 23:25 
catalina.2010-03-02.log
-rw-r--r--   1 root other  15722 Mar  2 23:26 catalina.out
-rw-r--r--   1 root other  0 Mar  2 23:22 
host-manager.2010-03-02.log
-rw-r--r--   1 root other232 Mar  2 23:22 
localhost.2010-03-02.log
-rw-r--r--   1 root other   1132 Mar  2 23:25 
manager.2010-03-02.log


check number of http connection in tomcat

2010-03-02 Thread chuikingman

I use tomcat .
I want to know how to check the number of http connection in the existing
Tomcat web server ??
Any advice ???
-- 
View this message in context: 
http://old.nabble.com/check-number-of-http-connection-in-tomcat-tp27764524p27764524.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat threads

2010-03-02 Thread Bill Barker



Caldarale, Charles R chuck.caldar...@unisys.com wrote in message 
news:99c8b2929b39c24493377ac7a121e21f96cb817...@usea-exch8.na.uis.unisys.com...

From: Bill Barker [mailto:billwbar...@verizon.net]
Subject: Re: Tomcat threads

basically the request is handed off to another thread and the
original one returns to the pool.  This also allows for two-way
communication instead of relying on polling.


What's required on the client end?  You can't simply push HTML or other 
content to a browser.  Is a specialized (or at least scripted) client 
required?




Mostly useful for custom clients channeling under HTTP, but you could 
probably write a scripted client as well that works with it (haven't tried). 
The examples in Tomcat 7 are mostly server-push (e.g. fake stock ticker, 
chat).  These are done by not completing the connection, and just pumping 
more data to a chunked response (so you get the spinning wheel the entire 
time the apps is running).   They work in most browsers (only most, because 
I've only tested them in IE and FireFox).


But as I said before, would probably help the OP, assuming that traffic 
isn't too great.



- Chuck


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




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: DB connection error -Tomcat 6 config

2010-03-02 Thread Karthik Nanjangude
Hi

 
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_111060.html

This one is for Oracle Database 11g an up only

Tried this Driver ojdbc15/jdk5  ojdbc16/jdk6   with my existing 4 year old 
application and started getting Compile time exceptions did not proceed 
future





With regards
karthik


-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Sent: Wednesday, March 03, 2010 4:48 AM
To: 'Tomcat Users List'
Subject: RE: DB connection error -Tomcat 6 config

I wonder now...should I perhaps be using this jar?   ojdbc6.jar  ?

Has anyone upgraded their Oracle drivers that's using TC 6 and JDK 1.6?

If anyone has used these environments together and needed to make the change, 
please apprise.

Thanks,

Barry

-Original Message-
From: Propes, Barry L [GCG-NAOT]
Sent: Tuesday, March 02, 2010 9:50 AM
To: 'Tomcat Users List'
Subject: RE: DB connection error -Tomcat 6 config

Really? Well, when I was implementing connection pooling in 4.1.31, I 
specifically remember having to use  ojdbc14_g.jar instead of ojdbc14.jar to 
successfully get the conn pooling to work.

I'll swap out the ojdbc14_g.jar  for the ojdbc14.jar and just use the latter 
and see if that works.

Thanks, Karthik.

-Original Message-
From: Karthik Nanjangude [mailto:karthik.nanjang...@xius-bcgi.com]
Sent: Monday, March 01, 2010 10:59 PM
To: Tomcat Users List
Subject: RE: DB connection error -Tomcat 6 config

Hi

Please double check the ojdbc14.jar size, Some times I find the jar files 
corrupt due to various reasons.

Also check only 1 copy of this 'jar' exists in /TOMCAT6.0.2.0/lib directory 
and make sure the same does not exist within the web application.

ojdbc14_g.jar is used for advance debug purpose, although it works try with 
normal ojdbc14.jar




With regards
karthik

-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Sent: Tuesday, March 02, 2010 4:44 AM
To: 'Tomcat Users List'
Subject: RE: DB connection error -Tomcat 6 config

Sorry, no.

webapps/chngctrl/META-INF/context.xml.

Thanks, Chuck.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
Sent: Monday, March 01, 2010 4:29 PM
To: Tomcat Users List
Subject: RE: DB connection error -Tomcat 6 config

 From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
 Subject: RE: DB connection error -Tomcat 6 config

 If I try to reference the resource reference in the
 webapps/META-INF/context.xml file,

Is that the real location?  If so, it's not valid.  The webapps directory is 
the default directory under which each webapp is normally deployed; there must 
be a webapp name between webapps and META-INF (e.g., ROOT).  Any other 
construct is incorrect.

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Access to Tomcat's MBeans

2010-03-02 Thread Cummins College
Hi,

Could someone please help us how to access Tomcat's Mbeans using Java code.
How is the basic logic to access the default mbeans present in Tomcat.

Please help.


RE: Tomcat threads

2010-03-02 Thread Caldarale, Charles R
 From: Bill Barker [mailto:billwbar...@verizon.net]
 Subject: Re: Tomcat threads
 
 The examples in Tomcat 7 are mostly server-push (e.g. fake stock
 ticker, chat).  These are done by not completing the connection,
 and just pumping more data to a chunked response (so you get the
 spinning wheel the entire time the apps is running).

An interesting trick; thanks for the info.

 - Chuck


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



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Access to Tomcat's MBeans

2010-03-02 Thread Caldarale, Charles R
 From: Cummins College [mailto:cummins.grou...@gmail.com]
 Subject: Access to Tomcat's MBeans
 
 Could someone please help us how to access Tomcat's Mbeans 
 using Java code.

This is not a direct answer, but you could download the source for Lambda Probe 
(www.lambdaprobe.org) and see how it does it.

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: check number of http connection in tomcat

2010-03-02 Thread Caldarale, Charles R
 From: chuikingman [mailto:chuiking...@yahoo.com.hk]
 Subject: check number of http connection in tomcat
 
 I use tomcat .

Congratulations.  What version?  What platform?

 I want to know how to check the number of http connection in the
 existing Tomcat web server ??

It's not perfectly clear what you want, but the netstat tool is available on 
most platforms and will display all active connections.  The manager webapp 
that is part of the standard Tomcat download shows the number of active 
sessions, and Lambda Probe (www.lambdaprobe.org) and MoSKito 
(moskito.anotheria.net) can give you detailed statistics.

 - Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: RE: check number of http connection in tomcat

2010-03-02 Thread Guifre Bosch Fabregas
in linux you can use:
ps -ef | grep http | grep -v grep | wc -l

This command returns the number of http active process

El 03/03/2010 07:42, Caldarale, Charles R chuck.caldar...@unisys.com
escribió:

 From: chuikingman [mailto:chuiking...@yahoo.com.hk]
 Subject: check number of http connection in tomcat

 I use tomcat .

Congratulations.  What version?  What platform?


 I want to know how to check the number of http connection in the
 existing Tomcat web server ??
...
It's not perfectly clear what you want, but the netstat tool is available on
most platforms and will display all active connections.  The manager webapp
that is part of the standard Tomcat download shows the number of active
sessions, and Lambda Probe (www.lambdaprobe.org) and MoSKito (
moskito.anotheria.net) can give you detailed statistics.

 - Chuck


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



-
To unsubscribe, e-mail: user...


RE: remote debug with tomcat 3.3.2

2010-03-02 Thread Kedzior Wojciech
Hahaha! 

-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: 3. března 2010 0:13
To: Tomcat Users List
Subject: Re: remote debug with tomcat 3.3.2

On 02/03/2010 15:28, Kedzior Wojciech wrote:
 Hi Chuck,

 Thanks for your answer.

 That is exactly how I feel.  However I'm not the person responsible for these 
 kinds of decisions within the company.  I am merely trying to help the guys 
 here by being more (much much more) efficient by using a debugger instead of 
 log files when developing code.

 To be honest I have no idea why they use such an old version of Tomcat.  And 
 I hope RND or someone is looking at upgrading.  I also suspect that there are 
 some proprietary libraries involved here, which may hinder a tomcat upgrade.

 I hate it, but I have to do with what I have and I'm just trying to get the 
 best out of what I have.

 So, any other suggestions?

http://www.monster.fr/   ;o)


p

 Cheers

 -Original Message-
 From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
 Sent: 2. března 2010 15:16
 To: Tomcat Users List
 Subject: RE: remote debug with tomcat 3.3.2

 From: Kedzior Wojciech [mailto:wojciech.kedz...@gemalto.com]
 Subject: remote debug with tomcat 3.3.2

 I'm having a problem with setting up a remote debug session to my
 Tomcat 3.3.2 Final.

 You're asking for help with a version of Tomcat that's six years old and 
 hasn't been supported for ages?  Not to mention buggier and much slower than 
 the current releases.

 Your time would be better spent moving up to a supported level and then 
 working on the debugging.

   - Chuck


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


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: remote debug with tomcat 3.3.2

2010-03-02 Thread Kedzior Wojciech
I see.  Thanks for the input.

I think I will try to run the app (as a local experiment only) on tomcat 6 to 
see what happens.  If that fails I may try to recompile 3.3.2.

Cheers 

-Original Message-
From: Bill Barker [mailto:billwbar...@verizon.net] 
Sent: 3. března 2010 4:13
To: users@tomcat.apache.org
Subject: Re: remote debug with tomcat 3.3.2

I'm pretty sure that I compiled the binary for 3.3.2 without debugging 
support.  The only thing I can think of is to download the source release of 
3.3.2 and compile it with debugging.

At the time 3.3.2 was released, using a debugger in Java was so painful that 
almost nobody did it.

Kedzior Wojciech wojciech.kedz...@gemalto.com wrote in message 
news:a8dd7b2abeb7b842af607d392ff73c7ee4834af...@croexcfwp03.gemalto.com...
 Hello,

 I'm having a problem with setting up a remote debug session to my Tomcat 
 3.3.2 Final.  I am copying some classes I developed into the working 
 directory of an application deployed on tomcat.  I can connect to the 
 remote debug port from eclipse but the debugger will not stop on any break 
 points what so ever.  Here is my environment:

 I specify the following system variables:

 JPDA_ADDRESS=8000
 JPDA_TRANSPORT=dt_socket

 I start my Tomcat with the jpda start parameters.

 While tailing the logs I can see the following line:

 Listening for transport dt_socket at address: 8000


 At this point I can connect to the remote debug port from Eclipse.  I can 
 see all the treads running within Tomcat, but my debug will not stop on 
 any breakpoints.  Even though the class I am trying to debug was created 
 by me in Eclipse and I have the correct source.

 The classes were compiled using Java 1.5.0_09.  Tomcat also uses the same 
 version of Java.

 The tomcat is deployed on Linux RedHat 5.
 Eclipse version is 3.5.1


 The complied classes have a reference to the .java file.

 To prove that the problem occurs with the entire deployment I obtained the 
 sources for the deployed application, linked them in my eclipse and set 
 some debug points.  I know the flow goes through the line with break 
 points because I used some dirty System.err output to prove this.


 One thing that may be a hint is that the Tomcat startup log shows the 
 following line:

 EmbededTomcat: Startup time 45

 The thing to note here is that I don't have control over the actual war 
 file deployed in tomcat.  I simply get the war from a different department 
 in the company, deploy it, and write some classes that the deployed 
 application will pick up and use.

 I have studied this Embedded Tomcat a little bit and I don't know if this 
 could be a problem.

 Has someone experienced anything like this before? If so, I would 
 appreciate it very much if you could shed some (even the dimmest) light 
 onto this.

 Thanks,

 Wojtek Kedzior


 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: check number of http connection in tomcat

2010-03-02 Thread chuikingman

It is tomcat-3.3.2 in red hat linux AS4 , kernel 2.6.9
Can you take exmaple how to use manager webapp 
Please advice 


n828cl wrote:
 
 From: chuikingman [mailto:chuiking...@yahoo.com.hk]
 Subject: check number of http connection in tomcat
 
 I use tomcat .
 
 Congratulations.  What version?  What platform?
 
 I want to know how to check the number of http connection in the
 existing Tomcat web server ??
 
 It's not perfectly clear what you want, but the netstat tool is available
 on most platforms and will display all active connections.  The manager
 webapp that is part of the standard Tomcat download shows the number of
 active sessions, and Lambda Probe (www.lambdaprobe.org) and MoSKito
 (moskito.anotheria.net) can give you detailed statistics.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/check-number-of-http-connection-in-tomcat-tp27764524p27765147.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org