[OT] Re: Tomcat JDBC Error

2014-01-28 Thread Ognjen Blagojevic

Leo,

On 27.1.2014 18:17, Leo Medina wrote:

Can you please elaborate more as to what you meant by:  com.mysql.jdbc.Driver
must be present in one of your webapps. I'd expect
it to be in a JAR that has mysql in the name. If you don't need it remove
it.  I meant that we don't have a mysql db.  in our original integration.
  You also mention that it *must* be present, yet if I don't need it to
remove it.  Sorry a little confused on that statement, can you please
clarify.


The phrase it must be means it is very probably or it is most likely.

Therefore:

It must be present, you should remove it

means

It is most likely present, you should remove it.


Let's face it -- English is a crazy language:

  http://www.wordsmith.org/awad/english8.html

-Ognjen



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



Re: JAVA_OPTS vs CATALINA_OPTS

2014-01-28 Thread André Warnier

Арсений Зинченко wrote:

OK, thanks - I'll do it from now (really - never used this file before,
just now found reference to it in catalina.bat) . But - last question,
please: in setenv.bat - must be used CATALINA_OPTS or JAVA_OPTS?



Ok, let us be really clear here.

1) The command to *stop* Tomcat starts *another* instance of Java JVM (and Tomcat), *just* 
to send a stop signal to the running Tomcat. And after that, this second instance of Java 
and Tomcat exits.


2) Options given in JAVA_OPTS are used in *both* the command to start and to 
stop Tomcat.
Options given in CATALINA_OPTS are used *only* in the command that starts Tomcat, and not 
in the command that stops Tomcat.

In other words :
- startup.(bat|sh) : java %JAVA_OPTS% %CATALINA_OPTS% tomcat-stuff
- shutdown.(bat|sh) : java %JAVA_OPTS% tomcat-stuff

That is just the way that these command files are written.

3) So,
- if you use JAVA_OPTS to indicate a Heap of 4 GB, then this Heap of 4 GB will 
be allocated :
  - for the JVM instance that starts and runs Tomcat (which is what you want)
  - but *also* for the JVM instance that stops Tomcat (which you probably do not want, 
just to send a stop signal)(because then, just for a short moment, you need 4 + 4 = 8 GB 
of Heap)


- if you use CATALINA_OPTS to indicate a Heap of 4 GB, then this Heap will be 
allocated
- *only* for the JVM instance which starts and runs Tomcat
- and *not* for JVM instance that stops Tomcat (that one will use a minimal Heap, so the 
total would be only 4 + 0.1 GB)


4) and if you make either one of the above be a general system variable, then they will 
be used by *any* Java JVM that you start on that system.  This is probably not what you 
want either, so don't do that.





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



Re: JAVA_OPTS vs CATALINA_OPTS

2014-01-28 Thread Арсений Зинченко
A lot of thanks, Neven! This is perfect explanation - considering my
English :-)

About point 4 - this is main goal: as we have few Java-applications running
in this very system - they must use global memory options, thats why I
suggested set System variable JAVA_OPTS. But namely Tomcat - must use
another memory perametrs.

So, if I correctly understood - for me better solution will be:

1) set CATALINA_OPTS with Xmx4G etc - in /bin/setenv.bat;
2) set JAVA_OPTS with Xmx1G etc - as system variable.

Yep?



2014/1/28 André Warnier a...@ice-sa.com

 Арсений Зинченко wrote:

 OK, thanks - I'll do it from now (really - never used this file before,
 just now found reference to it in catalina.bat) . But - last question,
 please: in setenv.bat - must be used CATALINA_OPTS or JAVA_OPTS?


 Ok, let us be really clear here.

 1) The command to *stop* Tomcat starts *another* instance of Java JVM (and
 Tomcat), *just* to send a stop signal to the running Tomcat. And after
 that, this second instance of Java and Tomcat exits.

 2) Options given in JAVA_OPTS are used in *both* the command to start and
 to stop Tomcat.
 Options given in CATALINA_OPTS are used *only* in the command that starts
 Tomcat, and not in the command that stops Tomcat.
 In other words :
 - startup.(bat|sh) : java %JAVA_OPTS% %CATALINA_OPTS% tomcat-stuff
 - shutdown.(bat|sh) : java %JAVA_OPTS% tomcat-stuff

 That is just the way that these command files are written.

 3) So,
 - if you use JAVA_OPTS to indicate a Heap of 4 GB, then this Heap of 4 GB
 will be allocated :
   - for the JVM instance that starts and runs Tomcat (which is what you
 want)
   - but *also* for the JVM instance that stops Tomcat (which you probably
 do not want, just to send a stop signal)(because then, just for a short
 moment, you need 4 + 4 = 8 GB of Heap)

 - if you use CATALINA_OPTS to indicate a Heap of 4 GB, then this Heap will
 be allocated
 - *only* for the JVM instance which starts and runs Tomcat
 - and *not* for JVM instance that stops Tomcat (that one will use a
 minimal Heap, so the total would be only 4 + 0.1 GB)

 4) and if you make either one of the above be a general system variable,
 then they will be used by *any* Java JVM that you start on that system.
  This is probably not what you want either, so don't do that.





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




Tomcat WebDav directory configuration

2014-01-28 Thread Sampers, Ruud
Thx for all your reactions,

I've been unable to configure the webdav functionality, using the
docBase/virtualpath in the server.xml. Enabling webdav via the servlet
is ok, redirecting a webapps docbase to c:\temp works ok, but the
combination of those 2 fails.

It seems like either, you enable the webdav servlet or use the docbase
but you cannot use them both at the same time or at least I'm unable to
configure this in such manner.

Does anyone have experience with this and if so, please would share the
configuration files 


Thx in advance
Ruud.



-Original Message-
From: Sampers, Ruud 
Sent: donderdag 23 januari 2014 13:07
To: users@tomcat.apache.org
Subject: Tomcat WebDav directory configuration

LS,

 

Tomcat 7.0.47. 

Windows 7

 

I want to enable WebDav functionality in a different directory that the
root:

Assume my data directory : c:\DATA.

 

  servlet

servlet-namewebdav/servlet-name

 
servlet-classorg.apache.catalina.servlets.WebdavServlet/servlet-class


init-param

param-namedebug/param-name

param-value0/param-value

/init-param

init-param

param-namelistings/param-name

param-valuetrue/param-value   

/init-param

load-on-startup6/load-on-startup

/servlet

 

servlet-mapping

servlet-namewebdav/servlet-name

url-pattern/dav/url-pattern

/servlet-mapping

 

When I hit the url .../dav I see the content of the root files and dirs.


Now I want to publish the data that is available in C:\DATA. 

I'm unable to do this...

 

Thanks would be greatly appreciated.

 

Best Regards,

 

Ruud Sampers

 



This message and attachment(s) are intended solely for use by the
addressee and may contain information that is privileged, confidential
or otherwise exempt from disclosure under applicable law.

If you are not the intended recipient or agent thereof responsible for
delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please notify the
sender immediately by telephone and with a 'reply' message.

Thank you for your co-operation.


This message and attachment(s) are intended solely for use by the addressee and 
may contain information that is privileged, confidential or otherwise exempt 
from disclosure under applicable law.

If you are not the intended recipient or agent thereof responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.

If you have received this communication in error, please notify the sender 
immediately by telephone and with a 'reply' message.

Thank you for your co-operation.



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



Re: JAVA_OPTS vs CATALINA_OPTS

2014-01-28 Thread Neven Cvetkovic
On Tue, Jan 28, 2014 at 4:00 AM, Арсений Зинченко setev...@gmail.comwrote:

  About point 4 - this is main goal: as we have few Java-applications
 running
 in this very system - they must use global memory options, thats why I
 suggested set System variable JAVA_OPTS. But namely Tomcat - must use
 another memory perametrs.


Arsenije,

That's one way of doing it, yes.  My personal preference is to keep
system-wide settings empty, and then size each Java process separately (in
their corresponding startup script). Having said that, it really depends on
type of applications you are running on you system. Are they same type of
applications, or are they significantly different? If different, I probably
want to size them differently, and customize each one of them. Yes, it is
easy to set default values in the JAVA_OPTS globally, but that's rarely
what I want for my applications.

Also, others pointed out - it is confusing to see both JAVA_OPTS and
CATALINA_OPTS both setting up -Xmx and -Xms values. Ultimately, everything
boils down to a single line:

java.exe %JAVA_OPTS% %CATALINA_OPTS% ...
java.exe -Xmx1G -Xms512M -Xmx4G -Xms2G ...

Yes, the later will override former parameter, but I wouldn't count on it :)

Think if you need to add another Java process that requires 4G, how would
you set the size of memory of that process?

So, unless all Java applications on that box (you said you had only few) -
are of similar type and require same sizing, I wouldn't use JAVA_OPTS
system-wide setting.



 So, if I correctly understood - for me better solution will be:

 1) set CATALINA_OPTS with Xmx4G etc - in /bin/setenv.bat;
 2) set JAVA_OPTS with Xmx1G etc - as system variable.

 Yep?


It is TOMCAT_HOME/bin/setenv.bat (wherever you installed Tomcat).

Yes, that is one possible solution, if all your Java apps need to be sized
the same.

I prefer sizing each Java application separately in a script that starts it.

Hope that helps!
n.


Re: Tomcat JDBC Error

2014-01-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Leo,

On 1/27/14, 12:17 PM, Leo Medina wrote:
 Good morning Mark,
 
 Can you please elaborate more as to what you meant by:
 com.mysql.jdbc.Driver must be present in one of your webapps. I'd
 expect it to be in a JAR that has mysql in the name. If you don't
 need it remove it.  I meant that we don't have a mysql db.  in our
 original integration. You also mention that it *must* be present,
 yet if I don't need it to remove it.  Sorry a little confused on
 that statement, can you please clarify.

$ for jar in $CATALINA_HOME/lib/*.jar \
 $PATH_TO_WEBAPP/WEB-INF/lib/*.jar \
  ; do echo $jar ; unzip -v $jar | grep -i mysql ; done

That ought to find it.

I'm not sure why it would be auto-loaded... JDBC drivers don't
auto-load themselves just because they are available to a ClassLoader.
Some code somewhere must be loading the driver, whether explicitly
using Class.forName(...) or by referencing part of Connector/J
elsewhere in the code, causing a chain of class-loading and
static-initializers that ultimately end up loading the JDBC Driver
into the DriverManager.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJS58J+AAoJEBzwKT+lPKRY/p4P/j3F0MPaQGoOY4xu0ZNIgPom
dQKNthbNd1EcfN+aPcKaXrEwY8GkcjIctODPbDXs7Th4xQj3ldRBjzRqr28RG+xX
ujDFnMqIB6isvf2e03I+l4hogTb8dDgCFMepf1A642N6ThvD7hmRGDgi8TizyPJJ
e6HddQAYprZOheANC6aj6JI8NEiwIeHpyS96XWdMQHxHg/rF/1Uqg4Vv/EF+NdeL
e6CPxrhSQ7iEBNFU08tzEDgV1OCWs/CvgMPONZO+J6SxvyvW6OABEsmQQrAVWBSa
SFk2LXRH8qSqayilmcDv4VCBCMqSeytK8Bg1Fyg3frHE6Pmi2th14rp53ndUkSYt
OPfPtC6Pdqa8vXxShe3b9LeRxjgdUvpXgnXjnM1B+Lay4OEankmOd36ZIkYaaW+3
q7fgaRYr//2skFLbq154koCo493DrV5leaJPjFEcwFKE3SUElU6vnYCeeMsNuN4Q
rlTZdYKL54aWQg0HI45jxfg44lh1AX/d7UQ4U505IgilJJvxa9g/wRiRhEy051wJ
nFX25ZODviJmJc090sqkVqv+bgpO1UAWu7/sFbhkZ8+zcA73HS9J0+0ItB108JiF
MnaJQMIgdda9Li/NagD8otW+U6Hon3C3Pyl/AmCmO5+j4/USurxHd7HxlT4vugNI
5/MzyNBL8A+uDh+Kk4Iv
=nOU4
-END PGP SIGNATURE-

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



Re: JAVA_OPTS vs CATALINA_OPTS

2014-01-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Neven,

On 1/28/14, 8:16 AM, Neven Cvetkovic wrote:
 On Tue, Jan 28, 2014 at 4:00 AM, Арсений Зинченко
 setev...@gmail.comwrote:
 
 About point 4 - this is main goal: as we have few
 Java-applications running in this very system - they must use
 global memory options, thats why I suggested set System
 variable JAVA_OPTS. But namely Tomcat - must use another memory
 perametrs.
 
 
 Arsenije,
 
 That's one way of doing it, yes.  My personal preference is to
 keep system-wide settings empty, and then size each Java process
 separately (in their corresponding startup script). Having said
 that, it really depends on type of applications you are running on
 you system. Are they same type of applications, or are they
 significantly different? If different, I probably want to size them
 differently, and customize each one of them. Yes, it is easy to set
 default values in the JAVA_OPTS globally, but that's rarely what I
 want for my applications.

+1, in general

We have a couple of large-memory servers, and the default heap
ergonomics of JVMs have varied wildly. By default, you'll probably get
more memory than you actually need, especially for small Java
processes. By simply setting JAVA_OPTS to have a small initial and
maximum heap size (usually something like 32MiB), we were able to
restrict any process that hadn't explicitly set its memory
requirements just so things didn't get out of hand.

When you give Java a large heap, the JVM assumes that you intend to
use it and isn't stingy about allowing it to fill-up.

 Also, others pointed out - it is confusing to see both JAVA_OPTS
 and CATALINA_OPTS both setting up -Xmx and -Xms values. Ultimately,
 everything boils down to a single line:
 
 java.exe %JAVA_OPTS% %CATALINA_OPTS% ... java.exe -Xmx1G -Xms512M
 -Xmx4G -Xms2G ...
 
 Yes, the later will override former parameter, but I wouldn't count
 on it :)

I can't find any documentation specifying this behavior, but it's
probably reasonable to count on this behavior. Tomcat certainly does ;)

 Think if you need to add another Java process that requires 4G, how
 would you set the size of memory of that process?
 
 So, unless all Java applications on that box (you said you had only
 few) - are of similar type and require same sizing, I wouldn't use
 JAVA_OPTS system-wide setting.

+1

That's what bin/setenv.sh and bin\setenv.bat are for.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJS58TDAAoJEBzwKT+lPKRYQVIQAJNvfHEUEgv3jQFCGZ7R9Dao
NqoggAhVaZLmvMLN6GGXnQCzbPvNGCeaAESjo3HPQ+GcCtTeOOAVtgHVDykty7P/
SuKkGDyEfq0aJsMad/7IR7zNel2KYQrfpYx30t5jW+zaiCQ8qKcZ6dnELp1DQGH/
UaK6O28sN39uzMfZMqYwWi2IEJhhblA5qss/XbyC0RPdJPM9mfqvHm8bThykf/3d
1yBTTleZu4X+FEPlMuIFPUvSqOH9GYAmNmPJ2Rr/0/reC1e1WDDp6NknxhJQ/fha
3OWcqptF+oYd44HPKmmrzHpDl/tEmlAaiKtyihTzY7oJxnjatbFvMF7j86VHvZCQ
BxyUigAmnw/SWFNWUyDqANcBEpwwfSHecsbCB5vdQwwBj+9vMJLSxmsE71oCFBx7
ZYvo/kgUz6oXmfoNMXJzYFj3e8DFUQSpEZyh0ATe0idMKB1k49A/MyCdEvLisY2/
Qg8hjVYzHTLctkt/D91iBvM2mDDKIvAGz/37l2ryDSQ5yjeWm6t4n3ddsyzTpJRC
/Pjs4Od3VhADAGez4RufvPK0qFRAfeo8MrZiR0pnvDW0jf+cJ8fh2XSwtM83o9yG
1XRBRP+4cheUuw90hYvSW6Urux+PnnH3PqzfmQiE+5Zij9HO/IKk60T+Az99VpyS
9nL8JNKIgko8C3mxUPFj
=U+u2
-END PGP SIGNATURE-

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



Re: JAVA_OPTS vs CATALINA_OPTS

2014-01-28 Thread Арсений Зинченко
Thanks for your replay, Neven.
Eventually - I decided to heed advices and remove JAVA_OPTS at all. So -
now using only CATALINA_OPTS in /bin/setenv.bat.


2014/1/28 Neven Cvetkovic neven.cvetko...@gmail.com

 On Tue, Jan 28, 2014 at 4:00 AM, Арсений Зинченко setev...@gmail.com
 wrote:
 
   About point 4 - this is main goal: as we have few Java-applications
  running
  in this very system - they must use global memory options, thats why I
  suggested set System variable JAVA_OPTS. But namely Tomcat - must use
  another memory perametrs.
 

 Arsenije,

 That's one way of doing it, yes.  My personal preference is to keep
 system-wide settings empty, and then size each Java process separately (in
 their corresponding startup script). Having said that, it really depends on
 type of applications you are running on you system. Are they same type of
 applications, or are they significantly different? If different, I probably
 want to size them differently, and customize each one of them. Yes, it is
 easy to set default values in the JAVA_OPTS globally, but that's rarely
 what I want for my applications.

 Also, others pointed out - it is confusing to see both JAVA_OPTS and
 CATALINA_OPTS both setting up -Xmx and -Xms values. Ultimately, everything
 boils down to a single line:

 java.exe %JAVA_OPTS% %CATALINA_OPTS% ...
 java.exe -Xmx1G -Xms512M -Xmx4G -Xms2G ...

 Yes, the later will override former parameter, but I wouldn't count on it
 :)

 Think if you need to add another Java process that requires 4G, how would
 you set the size of memory of that process?

 So, unless all Java applications on that box (you said you had only few) -
 are of similar type and require same sizing, I wouldn't use JAVA_OPTS
 system-wide setting.


 
  So, if I correctly understood - for me better solution will be:
 
  1) set CATALINA_OPTS with Xmx4G etc - in /bin/setenv.bat;
  2) set JAVA_OPTS with Xmx1G etc - as system variable.
 
  Yep?
 

 It is TOMCAT_HOME/bin/setenv.bat (wherever you installed Tomcat).

 Yes, that is one possible solution, if all your Java apps need to be sized
 the same.

 I prefer sizing each Java application separately in a script that starts
 it.

 Hope that helps!
 n.



Clustering without Apache in the front

2014-01-28 Thread Raquib Hasan
Hello,

I am creating a tomcat cluster following helps I found online. My question
is, do I have to use the Apache(mod_jk) for session replication? Is it
possible to use F5 load balancer directly bypassing the Apache? Primary
purpose of the cluster is fail over. Load balancing is not needed. I think
session replication is needed for a successful fail over. I am thinking
like, there would be a LB VIP that the client requests would be
communicating with. The sticky session would be enabled in the LB and there
is no need of apache web server in between. Is this the right way of
thinking?

I could not find the answer any where. Every example I found online starts
with an apache web server.
I appreciate your response.


Thank you.
RH


Re: Tomcat 7.0.50 tldValidation

2014-01-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

On 1/24/14, 3:53 AM, Mark Thomas wrote:
 On 23/01/2014 15:25, Christopher Schultz wrote:
 On 1/23/14, 10:17 AM, Mark Thomas wrote:
 On 23/01/2014 15:11, Christopher Schultz wrote:
 
 If that's true, then the Digester should be using the public
  namespace id of the schema and ignoring the (incomplete) URL
  provided by the XML document in order to locate the Schema
 in the local catalog. (I inadvertently said system id in my
  previous message, but I meant public namespace id... that
 is, http://java.sun.com/xml/ns/j2ee;).
 
 There are a couple of difficulties with that.
 
 1. The namespace does not identify a single schema - it is
 associated with several.

*enormous eyeroll*

I didn't realize that. I just looked at
http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd and
http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd and they both have
this declaration:

xsd:schema xmlns=http://www.w3.org/2001/XMLSchema;
targetNamespace=http://java.sun.com/xml/ns/j2ee;
xmlns:j2ee=http://java.sun.com/xml/ns/j2ee;


There is no reason, however, that we couldn't merge the schemas
together into a single file (or, probably more appropriately, load
them all together from their separate files) and use the collection
for validation regardless of the actual document type.

 2. The namespace is not available to the EntityResolver.

I've gotten lost in the various resolver classes. Which one were you
looking at? EntityResolver has public and system ids... not sure what
those end up being when loading a Schema. I have sample code here
which deals with DTDs and the various entities (e.g. system ids like
-//W3C//ENTITIES Latin 1 for XHTML//EN) but I don't appear to have
anything set up for caching schemas.

All of this /should/ be available from xml.apache.org/commons. I
haven't looked at their code.

 Given the XML document in the original post, what is causing
  Tomcat /not/ to load that local XML Schema?
 
 The way the new custom resolver is written. As per my original
  response, we could look at better handling for this case. I'd 
 need to go back to the archives and research if there is a
 reason for the current behaviour.
 
 Okay. Having written a few custom resolvers for just this
 purpose, I recall them being a total PITA to get right.
 
 The resolver only has the incomplete location 
 web-jsptaglibrary_2_0.xsd to work with. Such a location is
 normally resolved as relative to the location of the document using
 it. Since the document containing this reference is a TLD in a web
 app, that isn't going to work unless the schemas are located
 alongside the TLDs.
 
 Given that later versions of the standard tag libraries use an 
 absolute location of 
 http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd; (which 
 Tomcat recognises and directs the parser to its local copy) I'm
 minded to view this as an implementation bug in that tag library
 that can be worked around by disabling TLD validation.
 
 We could take the view that if we see a location of 
 web-jsptaglibrary_2_0.xsd (or any other schema name in the j2ee 
 namespace) we can assume it is a j2ee schema and resolve it as
 such. As long as this is a fall-back position (i.e. the relative to
 current resource location is checked first) then I don't think
 there is any risk associated with it.

What about simply providing all the components of the .../j2ee
namespace and using them together?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJS58mVAAoJEBzwKT+lPKRYbU0P/AtoejSyh0PPx0Eb59b7+IM4
PRng+iHNvJxV42/zmOR0l+AxBQjJceIkhi03mZu34WLqgy6juUWlzbqxdwsFIbTh
MxdoesvYw1aTi3JtunKCvsbad/wMJisaKNzGeMoQ+qBCKRlJYKxt5D8aDIWJMB0/
XYosFZponO6bXWYJSwD0iX5YglFwjtDsQeOdGV7eCExRCnGoMaP43nQQNE5OsxZK
WwIVKdRLIQu5OV/6PcWCeaJU/J5FcXsjZetSaImOyuEZKzZZb5cJ3XgGvCtIx7/X
KiefJYjMI/yjbEr2FA0IMs6IV6d8vE00h39KQALejX0R9z+RJR3OvZxZU8VVWH0P
Y9jd8l2v3mf0WB2cMHHW5o7l4Mg99+J5IQtTXIAbl5j8iQfVbSWRnHlyeL/2ec71
tzrVhSlGAbVebaQVRFTE+sgwoPhc4OVim1Uf9xmS7T/DZ61AIPdCEYyWmXSvnAOM
BgWA/z05k3t5xq6S9fMZMchXocFZZKxwVXOK2wiqez6aF8rssMCITpicQy8Vl59v
46q8arJ8GLESyFAV9zrJ2JBH5RP1e3Ei8rSnBzemclrMzzrfqJBK1RFc3t/l6YUG
HQSmDWj/hUCDcFqz1lVu5l7XuwDAeKWhdqDY9BQE2aPEVazqkg7NKFxg2ZL4d2Cg
Ffo9Mggss3eQqCrcfw7t
=wdgb
-END PGP SIGNATURE-

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



Re: Clustering without Apache in the front

2014-01-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Raquib,

On 1/28/14, 10:03 AM, Raquib Hasan wrote:
 I am creating a tomcat cluster following helps I found online. My 
 question is, do I have to use the Apache(mod_jk) for session 
 replication?

No.

 Is it possible to use F5 load balancer directly bypassing the 
 Apache?

Yes. (Note this is not bypassing Apache [httpd]... it's simply not
using it at all. Use of httpd is common, but certainly not required by
any stretch.

The lb is not involved in session replication.

If you want to use sticky sessions, you'll need to properly configure
the lb to understand how to stick the sessions to a back-end server.

 Primary purpose of the cluster is fail over. Load balancing is not
 needed. I think session replication is needed for a successful fail
 over.

That depends upon the nature of your webapp. Note that
session-replication is time-consuming and puts certain constraints on
the objects you store in the session.

 I am thinking like, there would be a LB VIP that the client
 requests would be communicating with. The sticky session would be
 enabled in the LB and there is no need of apache web server in
 between. Is this the right way of thinking?

What do you mean VIP?

How many back-end servers were you considering using?

 I could not find the answer any where. Every example I found online
 starts with an apache web server.

Using mod_jk (or mod_proxy_ajp) just makes everything easier given the
configuration options, etc. All of the ASF documentation covers the
use of httpd because it's freely-available and supported by the same
organization. The ASF isn't going to maintain configuration
instructions for a produce sold and supported by a commercial entity.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJS58uZAAoJEBzwKT+lPKRYOrMP/AxfjLwYrr5k3ishLEjDWwlw
uvJnXLMS1uW06XVBRqkevwRerz+4uKF8GlFPsnAcZd3h3MfPd+nhvtrSo5gXCgk3
aF+H+UNvq1axY7gAbI1syNCT3lUb1dQ4T+tbsuKILE4/LfE2+BqaIyEEUk3dpUq0
hi9IdaPolZdtf1Zikt5stYljqrNwY16S2mGFliICrHcpKa8rPL6TaDxIgmmhm4XV
zpziYZBCKaUqA2qadmFzUlRJSvZXmHqjmAXd6+dsMjzyIloeRntfBiktVbEh+EZg
WlXvoIaU6m3AEpK9c+A0QeCi1i8J5uMvGFAHbBp7+9XttZZdAfKwEr4jGRSvfnk4
nBaPFkEZZimmvh+i68bcysIPjVQVYzG2UHFsgTkie0SYhV1P8u6R7ugYGav9Uu2R
WfMLJm9V+0r3mAgR/aD4B4VQ7JYEavQ4YAldBQeb2IRqygBB2DCTawyIiHm3RiJ5
e7I0P2EXBjYhOZaQSQ0oWnLyF8JzGTIPy2B5b+qIHWYNBdV94/yvvBUp4iZhLEc7
NYgfhBczcRBlsmhvqVUcRrnyHdmf/sfgaZsiEs6zuTVrbZUoPKxoJJ6BmkhcMRbh
EgT2iMFL56IIRGKS2Is92vxoLV1Y/Kl5DYDceWw1qgveqZr2rPWfsNEP43RssM36
pDdpqUCFLJ1PD24FHaL8
=OKXz
-END PGP SIGNATURE-

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



Re: Tomcat 7.0.50 tldValidation

2014-01-28 Thread Mark Thomas
On 28/01/2014 15:15, Christopher Schultz wrote:

 There is no reason, however, that we couldn't merge the schemas 
 together into a single file

Yes there is. Licensing.

 I've gotten lost in the various resolver classes. Which one were
 you looking at?

There is only one EntityResolver / EntityResolver2 implementation in
trunk.

 What about simply providing all the components of the .../j2ee 
 namespace and using them together?

Again, that is what Tomcat already does.

For more information about the current state of things you need to
follow the related discussions on dev@ about the various bugs in this
area and the associated commits for fixing them.

Mark

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



Re: [OT] Clustering without Apache in the front

2014-01-28 Thread André Warnier

Christopher Schultz wrote:
...

I am thinking like, there would be a LB VIP that the client
requests would be communicating with. The sticky session would be
enabled in the LB and there is no need of apache web server in
between. Is this the right way of thinking?


What do you mean VIP?



A very big, very expensive, gold-plated load balancer ?



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



Tomcat v6.0.20 - Cannot Remove Date From JULI Log File Names

2014-01-28 Thread Vye
Hi Tomcat users,

I have been unsuccessfully trying to remove the date from catalina’s
log file name. My ultimate goal is to logrotate the file, which is
best done when the file name is static. According to the FileHandler
javadoc ( 
http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/juli/FileHandler.html
) I should be able to configure
*.org.apache.juli.FileHandler.rotatable in
${catalina.base}/conf/logging.properties to toggle date based file
names, but that is not working.

It seems like I could fix this by using log4j but I'm not sure if the
application is logging directly to JULI or commons-logging.
Regardless, I do not have access to modify it. I would like to
continue to use the default JULI logger since it is already in use.
Judging by the docs what I'm trying to do should be possible.

I’m positive the logging.properties file is being read because when I
change the prefix and suffix they are applied upon restart. I’ve
pasted my logging.properties and sample output in this gist:
http://git.io/99qidw Anyone can wget the raw logging.properties and
download tomcat from the archives to reproduce.

I would appreciate it if someone could point me in the right
direction. I’ve been referencing
http://tomcat.apache.org/tomcat-6.0-doc/logging.html.

Tomcat version: http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.20/bin/

Thank you.

-- 
-Vye

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



Signing the Apache Tomcat windows binaries

2014-01-28 Thread Mark Thomas
All,

I am currently evaluating a code-signing service for the ASF using
Tomcat as a test case. It would help if folks who use Tomcat on Windows
could provide use cases where they currently receive a warning so I can
figure out what needs to be signed and test those use cases with signed
versions.

So far the only test case I have is:
- Windows 7 Pro. Install Tomcat 8.0.0-RC10 form the installer.
  Attempting to use tomcat8w.exe triggers a warning if it is not
  signed. When it is signed there is still a warning but one that
  is less severe and includes the information that it has been signed
  by the ASF.

More test cases welcome. Please provide OS version details and steps to
re-create from a clean Tomcat install. Details should be added to this bug:
https://issues.apache.org/bugzilla/show_bug.cgi?id=56079

Thanks,

Mark

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



Re: Clustering without Apache in the front

2014-01-28 Thread Raquib Hasan
Thanks Chris.
I am not sure whether the sticky session is needed or not. The session
replication also may not be needed. My requirement is very simple. There
are 2 back end servers. I want both gets same user communication at the
same time, so that, if one server fails the other can continue. I though
cluster is the solution. Does the session replication come with the
clustering feature?

VIP means Virtual IP address given to client. Back-end servers can be
communicated using the VIP no matter where the LB routes the requests to

RH


On Tue, Jan 28, 2014 at 10:24 AM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Raquib,

 On 1/28/14, 10:03 AM, Raquib Hasan wrote:
  I am creating a tomcat cluster following helps I found online. My
  question is, do I have to use the Apache(mod_jk) for session
  replication?

 No.

  Is it possible to use F5 load balancer directly bypassing the
  Apache?

 Yes. (Note this is not bypassing Apache [httpd]... it's simply not
 using it at all. Use of httpd is common, but certainly not required by
 any stretch.

 The lb is not involved in session replication.

 If you want to use sticky sessions, you'll need to properly configure
 the lb to understand how to stick the sessions to a back-end server.

  Primary purpose of the cluster is fail over. Load balancing is not
  needed. I think session replication is needed for a successful fail
  over.

 That depends upon the nature of your webapp. Note that
 session-replication is time-consuming and puts certain constraints on
 the objects you store in the session.

  I am thinking like, there would be a LB VIP that the client
  requests would be communicating with. The sticky session would be
  enabled in the LB and there is no need of apache web server in
  between. Is this the right way of thinking?

 What do you mean VIP?

 How many back-end servers were you considering using?

  I could not find the answer any where. Every example I found online
  starts with an apache web server.

 Using mod_jk (or mod_proxy_ajp) just makes everything easier given the
 configuration options, etc. All of the ASF documentation covers the
 use of httpd because it's freely-available and supported by the same
 organization. The ASF isn't going to maintain configuration
 instructions for a produce sold and supported by a commercial entity.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJS58uZAAoJEBzwKT+lPKRYOrMP/AxfjLwYrr5k3ishLEjDWwlw
 uvJnXLMS1uW06XVBRqkevwRerz+4uKF8GlFPsnAcZd3h3MfPd+nhvtrSo5gXCgk3
 aF+H+UNvq1axY7gAbI1syNCT3lUb1dQ4T+tbsuKILE4/LfE2+BqaIyEEUk3dpUq0
 hi9IdaPolZdtf1Zikt5stYljqrNwY16S2mGFliICrHcpKa8rPL6TaDxIgmmhm4XV
 zpziYZBCKaUqA2qadmFzUlRJSvZXmHqjmAXd6+dsMjzyIloeRntfBiktVbEh+EZg
 WlXvoIaU6m3AEpK9c+A0QeCi1i8J5uMvGFAHbBp7+9XttZZdAfKwEr4jGRSvfnk4
 nBaPFkEZZimmvh+i68bcysIPjVQVYzG2UHFsgTkie0SYhV1P8u6R7ugYGav9Uu2R
 WfMLJm9V+0r3mAgR/aD4B4VQ7JYEavQ4YAldBQeb2IRqygBB2DCTawyIiHm3RiJ5
 e7I0P2EXBjYhOZaQSQ0oWnLyF8JzGTIPy2B5b+qIHWYNBdV94/yvvBUp4iZhLEc7
 NYgfhBczcRBlsmhvqVUcRrnyHdmf/sfgaZsiEs6zuTVrbZUoPKxoJJ6BmkhcMRbh
 EgT2iMFL56IIRGKS2Is92vxoLV1Y/Kl5DYDceWw1qgveqZr2rPWfsNEP43RssM36
 pDdpqUCFLJ1PD24FHaL8
 =OKXz
 -END PGP SIGNATURE-

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




Re: [OT] Clustering without Apache in the front

2014-01-28 Thread Raquib Hasan
:)


On Tue, Jan 28, 2014 at 11:28 AM, André Warnier a...@ice-sa.com wrote:

 Christopher Schultz wrote:
 ...

  I am thinking like, there would be a LB VIP that the client
 requests would be communicating with. The sticky session would be
 enabled in the LB and there is no need of apache web server in
 between. Is this the right way of thinking?


 What do you mean VIP?


 A very big, very expensive, gold-plated load balancer ?




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




Re: Tomcat v6.0.20 - Cannot Remove Date From JULI Log File Names

2014-01-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Vye,

On 1/28/14, 12:05 PM, Vye wrote:
 I have been unsuccessfully trying to remove the date from
 catalina’s log file name. My ultimate goal is to logrotate the
 file, which is best done when the file name is static. According to
 the FileHandler javadoc (
 http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/juli/FileHandler.html

 
) I should be able to configure
 *.org.apache.juli.FileHandler.rotatable in 
 ${catalina.base}/conf/logging.properties to toggle date based file 
 names, but that is not working.

Which log file are you talking about? Note that catalina.out is not
handled by logging.properties at all. It's handled by the shell and/or
launcher, and is the destination for the JVM's stdout and stderr streams.

 It seems like I could fix this by using log4j but I'm not sure if
 the application is logging directly to JULI or commons-logging.

log4j will probably not help, depending on the real problem.

 Regardless, I do not have access to modify it. I would like to 
 continue to use the default JULI logger since it is already in
 use. Judging by the docs what I'm trying to do should be possible.
 
 I’m positive the logging.properties file is being read because when
 I change the prefix and suffix they are applied upon restart. I’ve 
 pasted my logging.properties and sample output in this gist: 
 http://git.io/99qidw Anyone can wget the raw logging.properties
 and download tomcat from the archives to reproduce.
 
 I would appreciate it if someone could point me in the right 
 direction. I’ve been referencing 
 http://tomcat.apache.org/tomcat-6.0-doc/logging.html.
 
 Tomcat version:
 http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.20/bin/

You seriously need to upgrade.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJS5+koAAoJEBzwKT+lPKRYaL0QAIr5HfKLPQlf0/A6aaTfL406
2d3p1ChPHJdh0wp5jZA8Qb3Kz0PlFKq24SMFVlzfGzh589ib2k8CueuKpl8177dk
tRnDQjSG2AjvqIaQp/I3Z/7NNLig/+S+9slJzzbNL/jTDjfpwknzla0KvlTyU+4u
QWNIYBcBoafcvuuxczTYokZzguTfSV+5HSqpKarBbCV8URbFy1RSl2ANiqtB3LKI
bRcK40UVkvN7P7L6PFob59BaSTYX+N75Cyl/WkOVzxD7TM7tzD6g8TsJ24KTLDa0
NSPABFZGpXdTri10HzFKq4UDnYXwFTZB3fCl2StwnFY7P4J+4Xdg9liZ7XfOn5Bo
7BEGgXxB11iM4nXnCN7MH6qtcDcp6AJzAEWjgpPClNYB8gBDpxyUj4lrcy0IOiP7
JPV+R4i16BZb/j9W2mLWZcAukEZcXx5HqCQ6bL6uIZQ1CEJ4mnnwu23TGjrUkdJr
BqBc1Iwh4pY4DskZbKNh4IBSwdzSa8Xm/Q3/l+5lTQO1TS1xG814zXNvsIQ41UGE
Glz4C6YGArdiDJtjAwixEEyu5jwA8+9URU4/WqBlXT6IsBTmP7CnCiPi5Pghj1Kp
MPM6khwhKDqU8Pc58Vl+Tm1P8t+Uk57iJO59tiL2q+S/ANM39ci4FV8x78eXbDzh
kmhOTiCr1SxrVNqaMph0
=xi0L
-END PGP SIGNATURE-

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



Re: Tomcat v6.0.20 - Cannot Remove Date From JULI Log File Names

2014-01-28 Thread Daniel Mikusa
On Jan 28, 2014, at 12:05 PM, Vye v...@vye.me wrote:

 Hi Tomcat users,

Tomcat 6.0.20 is very old and has known security issues.  See the notices here.

  https://tomcat.apache.org/security-6.html

You’ve been warned.  You should upgrade ASAP.

 
 I have been unsuccessfully trying to remove the date from catalina’s
 log file name. My ultimate goal is to logrotate the file, which is
 best done when the file name is static.

I’m curious, why are you trying to do this?  The log files are being rotated 
out-of-the-box.  They rotate by date, hence why the date is part of the name.  
Why do you need to rotate them with some other tool?  What doesn’t work about 
the out-of-the-box configuration?

Dan

 According to the FileHandler
 javadoc ( 
 http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/juli/FileHandler.html
 ) I should be able to configure
 *.org.apache.juli.FileHandler.rotatable in
 ${catalina.base}/conf/logging.properties to toggle date based file
 names, but that is not working.
 
 It seems like I could fix this by using log4j but I'm not sure if the
 application is logging directly to JULI or commons-logging.
 Regardless, I do not have access to modify it. I would like to
 continue to use the default JULI logger since it is already in use.
 Judging by the docs what I'm trying to do should be possible.
 
 I’m positive the logging.properties file is being read because when I
 change the prefix and suffix they are applied upon restart. I’ve
 pasted my logging.properties and sample output in this gist:
 http://git.io/99qidw Anyone can wget the raw logging.properties and
 download tomcat from the archives to reproduce.
 
 I would appreciate it if someone could point me in the right
 direction. I’ve been referencing
 http://tomcat.apache.org/tomcat-6.0-doc/logging.html.
 
 Tomcat version: http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.20/bin/
 
 Thank you.
 
 -- 
 -Vye
 
 -
 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: Clustering without Apache in the front

2014-01-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Raquib,

On 1/28/14, 12:29 PM, Raquib Hasan wrote:
 I am not sure whether the sticky session is needed or not. The
 session replication also may not be needed. My requirement is very
 simple.

If you don't need anything fancy, may I suggest that you start by
using sticky sessions and no session-replication? If you use sessions,
you'll need to use one of the two otherwise nothing will work properly.

Sticky-sessions are simple to configure and get you a lot of mileage
without much horsepower at all.

 There are 2 back end servers. I want both gets same user 
 communication at the same time, so that, if one server fails the 
 other can continue.

Assuming that you can suffer the loss of a single in-progress request,
you want to route the request to a /single/ back-end server and not do
something weird like broadcasting. If you use sticky sessions, the
same back-end server will get all of the requests for a particular
session.

If that node fails, subsequent requests will be routed to the other
server. If you don't have session-replication enabled, the user's
session will be lost and they will have to re-login, possibly
re-starting any work in-progress. That's up to your webapp's tolerance
for fail-over to handle.

 I though cluster is the solution. Does the session replication
 come with the clustering feature?

Clustering ≈ session replication. Tomcat's clustering does not provide
anything other than session replication.

 VIP means Virtual IP address given to client. Back-end servers can
 be communicated using the VIP no matter where the LB routes the
 requests to.

I don't think that's necessary at all. LBs are designed to handle sets
of back-end servers and choose one of them based on a number of
criteria. You don't need to create a virtual IP that wanders-around
through your beck-end servers: the Big IP itself is the IP address
everyone will hit.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJS5+rxAAoJEBzwKT+lPKRYMqIP/3ekCp19upctE7XhZCu5/eca
5DZkTqzVtBoX2twnnRAwd9CN8X2aTAo26Lg9H+KtVeykGyKx4tseycWzq/4mR1Dq
g4v8uw6SK/L7yReC84gUW55bvMxr93t4Zdy8dy6qp0L5yoEVlFEEbSaIcOyYHuIA
NbFef4Cv5v8JjOOqNSRiwuweXs2IVRRzDee26YrB5ASwP1wPIG6emlCCdlMLqjvo
eKmM1Gcm6AVoiJT+iG47Tms2MXrNhk58HD6xjh4+APdzs70/419UGVEj+YeKcMBv
0/vu27wnZd90AECKgSwv8f0aAgkX4pveEyBf1UvvoEywZ1nEj6LLv/+1xELX/1no
pS0/cBGcDE8ujPUpa/SsLFyVkvJPcLYTdQ5V0yMUHb7qQysduYLF5mSI30OGs+aW
DJm0bzLU6XZhVofmDBnG6vpYQKH3BxMjLlsUzQdM2W2EP/NwmNZuILfWJ6P/Wc3d
r6Fck7GbAD5Ycn666FpclMIZC6H7GhlsRs9TGwRh0s3RBpQm9nLIIUiUDlRNJz3c
hOMU6FRP1COx2dNjSPATtKnT2IPKofDpWSVTrlK9PrmFG7WztMboF0dfZZFamyZD
wTzppXEXgW+scDYbnp+Nn7O55YReQfBW4Gk3qvWIgIEG6vs7wl8LRsr1a2FODCJb
VmOeh6a6RNIemYG4nxCJ
=X+/W
-END PGP SIGNATURE-

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



request.getAttribute(javax.servlet.request.X509Certificate) returns NULL for AJP connector

2014-01-28 Thread John Palmer
 We have two similar production environments which use:
request.getAttribute(javax.servlet.request.X509Certificate)
for several purposes.

These use tomcat behind IIS using the Jakarta connector (aka reverse proxy)
and have been running since 2006 and 2011 respectively without significant
issues ... other than perhaps insufficient memory (and sometimes IIS can't
talk to Tomcat and everything has to be restarted, multiple times, to
resolve).

We're trying to upgrade/replace these servers with 64-bit Windows OS  due
to memory constraints caused by the use of  32-bit OS, and these attributes
(and related SSL attributes in Tomcat) are now returning NULL in our DEV
environment

Old environment:
IIS 5.0 on WIndows Server 2003 SP2, Jakarta Isapi Redirector 1.2.37, TomCat
7.0.47

(While researching how to set up Jakarta Isapi Redirector in IIS 7.5 with
a 64-bit Windows 2008 I saw multiple people reporting issues with poor
performance, lockups etc, and decided we would try Bon Code instead.)

New Environment
IIS 7.5 on Win Server 2008 R2, Bon Code 1.0.17, TomCat 7.0.47


IIS is configured with Client Cert Required; browser is being prompted for
cert, and cert info is being sent to IIS.

According to Bon Code logs, request headers are being populated with plenty
of information, including client cert and client issuer cert information.

It looks like Tomcat is receiving these request headers, but is not
populating the request attributes related to SSL and Cert information, but
I can't see why in the logs, even after turning the logs to ALL and wading
through the copious output.

After looking through the Tomcat source multiple times, I don't see how the
AJP connector can populate these request attributes at all - but it is in
our current (32-bit OS) environment.
-
I understand that Tomcat is NOT doing the SSL connection itself - IIS is,
just as Apache Web Server can be made to do, but my understanding is that
Tomcat should be able to populate these attributes from information sent
with the request throught the AJP connector (eg, in the Request Headers),
That seems to be working wonderfully in our current environment...

I suspect that I simply have something not configured properly - but is it
IIS 7.5, Bon Code, or Tomcat?

After multiple attempts to resolve this I'm at a loss..
your help appreciated...
-

Tomcat Server.xml (AJP connector):
Connector URIEncoding=*UTF-8* enableLookups= *false* port=*8029*
protocol=*AJP/1.3* redirectPort=*8443* /
(added  tomcatAuthentication= *false*, scheme=https secure=true
 without making any difference)

Bon Code config:
Settings
Serverlocalhost/Server
Port8029/Port
EnableRemoteAdminFalse/EnableRemoteAdmin
EnableHeaderDataSupportTrue/EnableHeaderDataSupport
ForceSecureSessionFalse/ForceSecureSession
AllowEmptyHeadersFalse/AllowEmptyHeaders
LogLevel4/LogLevel
LogDirc:\temp/LogDir
/Settings

(Added ForceSecureSessionTrue/ForceSecureSession
 -- this caused SSL session ID:
*getAttribute(javax.servlet.request.ssl_session)
 *to populate. No other difference).

---
code in jsp file to show these attributes:


/** prints the request headers being passed in */
out.println (brbrRequest Headers:  br);
   EnumerationString headerNames = request.getHeaderNames();
while (headerNames.hasMoreElements()) {
String headerName = headerNames.nextElement();
String headerValue = request.getHeader(headerName);
out.println(headerName +  =  + headerValue + br);
}

/** returns plenty of stuff for Bon Code, very little for Jakarta */

*/** *not** reported by request.getAttributeNames() ! */

out.println(brbrSSL Attributes:  br);

out.println(javax.servlet.request.cipher_suite:  +
request.getAttribute(javax.servlet.request.cipher_suite) + BR);
out.println(javax.servlet.request.key_size:  +
request.getAttribute(javax.servlet.request.key_size) + BR);
out.println(javax.servlet.request.X509Certificate:  +
request.getAttribute(javax.servlet.request.X509Certificate) + BR);
out.println(javax.servlet.request.ssl_session:  +
request.getAttribute(javax.servlet.request.ssl_session) + BR);
out.println(SSL_PROTOCOL:  + request.getAttribute(SSL_PROTOCOL) +
BR)
---
result:

SSL Attributes:
javax.servlet.request.cipher_suite: null
javax.servlet.request.key_size: 2048
javax.servlet.request.X509Certificate: null
javax.servlet.request.ssl_session: on
SSL_PROTOCOL: null


---


Re: Tomcat v6.0.20 - Cannot Remove Date From JULI Log File Names

2014-01-28 Thread Vye
On Tue, Jan 28, 2014 at 9:32 AM, Daniel Mikusa dmik...@gopivotal.com wrote:
 On Jan 28, 2014, at 12:05 PM, Vye v...@vye.me wrote:

 Hi Tomcat users,

 Tomcat 6.0.20 is very old and has known security issues.  See the notices 
 here.

   https://tomcat.apache.org/security-6.html

 You’ve been warned.  You should upgrade ASAP.


 I have been unsuccessfully trying to remove the date from catalina’s
 log file name. My ultimate goal is to logrotate the file, which is
 best done when the file name is static.

 I’m curious, why are you trying to do this?  The log files are being rotated 
 out-of-the-box.  They rotate by date, hence why the date is part of the name. 
  Why do you need to rotate them with some other tool?  What doesn’t work 
 about the out-of-the-box configuration?

 Dan

 According to the FileHandler
 javadoc ( 
 http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/juli/FileHandler.html
 ) I should be able to configure
 *.org.apache.juli.FileHandler.rotatable in
 ${catalina.base}/conf/logging.properties to toggle date based file
 names, but that is not working.

 It seems like I could fix this by using log4j but I'm not sure if the
 application is logging directly to JULI or commons-logging.
 Regardless, I do not have access to modify it. I would like to
 continue to use the default JULI logger since it is already in use.
 Judging by the docs what I'm trying to do should be possible.

 I’m positive the logging.properties file is being read because when I
 change the prefix and suffix they are applied upon restart. I’ve
 pasted my logging.properties and sample output in this gist:
 http://git.io/99qidw Anyone can wget the raw logging.properties and
 download tomcat from the archives to reproduce.

 I would appreciate it if someone could point me in the right
 direction. I’ve been referencing
 http://tomcat.apache.org/tomcat-6.0-doc/logging.html.

 Tomcat version: http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.20/bin/

 Thank you.

 --
 -Vye

 -
 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


Hi Dan,

I am aware of the concerns, it is a legacy system that is already
being phased out. The log files are rotated out of box but they cannot
be automatically compressed or deleted after a waiting period, which
is the functionality I want.

Does the JULI logger not work as documented? Sure there are other ways
to keep the logs cleaned up, but my question is specifically regarding
the rotatable option for JULI.

-- 
-Vye

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



Re: request.getAttribute(javax.servlet.request.X509Certificate) returns NULL for AJP connector (possible Bon Code issue?)

2014-01-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

John,

On 1/28/14, 12:41 PM, John Palmer wrote:
 We have two similar production environments which use: 
 request.getAttribute(javax.servlet.request.X509Certificate) for
 several purposes.
 
 These use tomcat behind IIS using the Jakarta connector (aka
 reverse proxy) and have been running since 2006 and 2011
 respectively without significant issues ... other than perhaps
 insufficient memory (and sometimes IIS can't talk to Tomcat and
 everything has to be restarted, multiple times, to resolve).
 
 We're trying to upgrade/replace these servers with 64-bit Windows
 OS  due to memory constraints caused by the use of  32-bit OS, and
 these attributes (and related SSL attributes in Tomcat) are now
 returning NULL in our DEV environment
 
 Old environment: IIS 5.0 on WIndows Server 2003 SP2, Jakarta Isapi
 Redirector 1.2.37, TomCat 7.0.47
 
 (While researching how to set up Jakarta Isapi Redirector in IIS
 7.5 with a 64-bit Windows 2008 I saw multiple people reporting
 issues with poor performance, lockups etc, and decided we would try
 Bon Code instead.)
 
 New Environment IIS 7.5 on Win Server 2008 R2, Bon Code 1.0.17,
 TomCat 7.0.47
 
 
 IIS is configured with Client Cert Required; browser is being
 prompted for cert, and cert info is being sent to IIS.

So, the old production setup uses mod_jk ISAPI redirector and it
works. The new production setup uses Bon Code and doesn't work. I
may have a suggestion as to the difference between setups, and a
possible reason why this isn't working.

 According to Bon Code logs, request headers are being populated
 with plenty of information, including client cert and client issuer
 cert information.
 
 It looks like Tomcat is receiving these request headers, but is
 not populating the request attributes related to SSL and Cert
 information, but I can't see why in the logs, even after turning
 the logs to ALL and wading through the copious output.
 
 After looking through the Tomcat source multiple times, I don't see
 how the AJP connector can populate these request attributes at all
 - but it is in our current (32-bit OS) environment.

It looks like it happens in AbstractAjpProcessor.action().

 - I understand that Tomcat is NOT doing
 the SSL connection itself - IIS is, just as Apache Web Server can
 be made to do, but my understanding is that Tomcat should be able
 to populate these attributes from information sent with the request
 throught the AJP connector (eg, in the Request Headers), That seems
 to be working wonderfully in our current environment.

mod_jk does not use HTTP headers to send SSL information. Those data
are sent using a different mechanism. Bon Code should be using the
same mechanism.

 I suspect that I simply have something not configured properly -
 but is it IIS 7.5, Bon Code, or Tomcat?

Why not try configuring mod_jk ISAPI redirector in your new
environment to see if Bon Code is the problem?

 
 After multiple attempts to resolve this I'm at a loss.. your help
 appreciated... 
 -

  Tomcat Server.xml (AJP connector): Connector
 URIEncoding=*UTF-8* enableLookups= *false* port=*8029* 
 protocol=*AJP/1.3* redirectPort=*8443* / (added
 tomcatAuthentication= *false*, scheme=https secure=true 
 without making any difference)
 
 Bon Code config: Settings Serverlocalhost/Server 
 Port8029/Port EnableRemoteAdminFalse/EnableRemoteAdmin 
 EnableHeaderDataSupportTrue/EnableHeaderDataSupport 
 ForceSecureSessionFalse/ForceSecureSession 
 AllowEmptyHeadersFalse/AllowEmptyHeaders 
 LogLevel4/LogLevel LogDirc:\temp/LogDir /Settings
 
 (Added ForceSecureSessionTrue/ForceSecureSession -- this caused
 SSL session ID: *getAttribute(javax.servlet.request.ssl_session) 
 *to populate. No other difference).
 
 --- code in jsp file to show these attributes:
 
 
 /** prints the request headers being passed in */ out.println
 (brbrRequest Headers:  br); EnumerationString headerNames
 = request.getHeaderNames(); while (headerNames.hasMoreElements())
 { String headerName = headerNames.nextElement(); String headerValue
 = request.getHeader(headerName); out.println(headerName +  =  +
 headerValue + br); }
 
 /** returns plenty of stuff for Bon Code, very little for Jakarta
 */

http://boncode.net/connector/webdocs/Tomcat_Connector.htm#_Toc349117783

 */** *not** reported by request.getAttributeNames() ! */
 
 out.println(brbrSSL Attributes:  br);
 
 out.println(javax.servlet.request.cipher_suite:  + 
 request.getAttribute(javax.servlet.request.cipher_suite) +
 BR); out.println(javax.servlet.request.key_size:  + 
 request.getAttribute(javax.servlet.request.key_size) + BR); 
 out.println(javax.servlet.request.X509Certificate:  + 
 request.getAttribute(javax.servlet.request.X509Certificate) +
 BR); out.println(javax.servlet.request.ssl_session:  + 
 request.getAttribute(javax.servlet.request.ssl_session) +
 

Re: request.getAttribute(javax.servlet.request.X509Certificate) returns NULL for AJP connector (possible Bon Code issue?)

2014-01-28 Thread Konstantin Kolinko
2014-01-28 John Palmer johnpalm...@gmail.com:
  We have two similar production environments which use:
 request.getAttribute(javax.servlet.request.X509Certificate)
 for several purposes.

 These use tomcat behind IIS using the Jakarta connector (aka reverse proxy)
 and have been running since 2006 and 2011 respectively without significant
 issues ... other than perhaps insufficient memory (and sometimes IIS can't
 talk to Tomcat and everything has to be restarted, multiple times, to
 resolve).

 We're trying to upgrade/replace these servers with 64-bit Windows OS  due
 to memory constraints caused by the use of  32-bit OS, and these attributes
 (and related SSL attributes in Tomcat) are now returning NULL in our DEV
 environment

 Old environment:
 IIS 5.0 on WIndows Server 2003 SP2, Jakarta Isapi Redirector 1.2.37, TomCat
 7.0.47

 (While researching how to set up Jakarta Isapi Redirector in IIS 7.5 with
 a 64-bit Windows 2008 I saw multiple people reporting issues with poor
 performance, lockups etc, and decided we would try Bon Code instead.)

 New Environment
 IIS 7.5 on Win Server 2008 R2, Bon Code 1.0.17, TomCat 7.0.47


 IIS is configured with Client Cert Required; browser is being prompted for
 cert, and cert info is being sent to IIS.

 According to Bon Code logs, request headers are being populated with plenty
 of information, including client cert and client issuer cert information.

 It looks like Tomcat is receiving these request headers, but is not
 populating the request attributes related to SSL and Cert information, but
 I can't see why in the logs, even after turning the logs to ALL and wading
 through the copious output.

 After looking through the Tomcat source multiple times, I don't see how the
 AJP connector can populate these request attributes at all - but it is in
 our current (32-bit OS) environment.
 -
 I understand that Tomcat is NOT doing the SSL connection itself - IIS is,
 just as Apache Web Server can be made to do, but my understanding is that
 Tomcat should be able to populate these attributes from information sent
 with the request throught the AJP connector (eg, in the Request Headers),
 That seems to be working wonderfully in our current environment...

 I suspect that I simply have something not configured properly - but is it
 IIS 7.5, Bon Code, or Tomcat?

 After multiple attempts to resolve this I'm at a loss..
 your help appreciated...
 -

 Tomcat Server.xml (AJP connector):
 Connector URIEncoding=*UTF-8* enableLookups= *false* port=*8029*
 protocol=*AJP/1.3* redirectPort=*8443* /
 (added  tomcatAuthentication= *false*, scheme=https secure=true
  without making any difference)

I do not have a real answer, but if you have come this far, maybe you
want to try
running Tomcat under debugger? See

http://wiki.apache.org/tomcat/FAQ/Developing#Debugging

The above configuration of a Connector selects either a BIO or an
APR connector (depending on presence of tcnative-1.dll). Which
connector implementation is actually used should be visible from
startup logs.

A place of interest for a breakpoint is
org.apache.coyote.ajp.AbstractAjpProcessor#prepareRequest().
Look for 'case Constants.SC_A_SSL_CERT' there.

Another place is AbstractAjpProcessor#action(...), see
ActionCode.REQ_SSL_ATTRIBUTE there.

Best regards,
Konstantin Kolinko

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



Re: Tomcat v6.0.20 - Cannot Remove Date From JULI Log File Names

2014-01-28 Thread Vye
On Tue, Jan 28, 2014 at 9:30 AM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Vye,

 On 1/28/14, 12:05 PM, Vye wrote:
 I have been unsuccessfully trying to remove the date from
 catalina’s log file name. My ultimate goal is to logrotate the
 file, which is best done when the file name is static. According to
 the FileHandler javadoc (
 http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/juli/FileHandler.html


 ) I should be able to configure
 *.org.apache.juli.FileHandler.rotatable in
 ${catalina.base}/conf/logging.properties to toggle date based file
 names, but that is not working.

 Which log file are you talking about? Note that catalina.out is not
 handled by logging.properties at all. It's handled by the shell and/or
 launcher, and is the destination for the JVM's stdout and stderr streams.

 It seems like I could fix this by using log4j but I'm not sure if
 the application is logging directly to JULI or commons-logging.

 log4j will probably not help, depending on the real problem.

 Regardless, I do not have access to modify it. I would like to
 continue to use the default JULI logger since it is already in
 use. Judging by the docs what I'm trying to do should be possible.

 I’m positive the logging.properties file is being read because when
 I change the prefix and suffix they are applied upon restart. I’ve
 pasted my logging.properties and sample output in this gist:
 http://git.io/99qidw Anyone can wget the raw logging.properties
 and download tomcat from the archives to reproduce.

 I would appreciate it if someone could point me in the right
 direction. I’ve been referencing
 http://tomcat.apache.org/tomcat-6.0-doc/logging.html.

 Tomcat version:
 http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.20/bin/

 You seriously need to upgrade.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJS5+koAAoJEBzwKT+lPKRYaL0QAIr5HfKLPQlf0/A6aaTfL406
 2d3p1ChPHJdh0wp5jZA8Qb3Kz0PlFKq24SMFVlzfGzh589ib2k8CueuKpl8177dk
 tRnDQjSG2AjvqIaQp/I3Z/7NNLig/+S+9slJzzbNL/jTDjfpwknzla0KvlTyU+4u
 QWNIYBcBoafcvuuxczTYokZzguTfSV+5HSqpKarBbCV8URbFy1RSl2ANiqtB3LKI
 bRcK40UVkvN7P7L6PFob59BaSTYX+N75Cyl/WkOVzxD7TM7tzD6g8TsJ24KTLDa0
 NSPABFZGpXdTri10HzFKq4UDnYXwFTZB3fCl2StwnFY7P4J+4Xdg9liZ7XfOn5Bo
 7BEGgXxB11iM4nXnCN7MH6qtcDcp6AJzAEWjgpPClNYB8gBDpxyUj4lrcy0IOiP7
 JPV+R4i16BZb/j9W2mLWZcAukEZcXx5HqCQ6bL6uIZQ1CEJ4mnnwu23TGjrUkdJr
 BqBc1Iwh4pY4DskZbKNh4IBSwdzSa8Xm/Q3/l+5lTQO1TS1xG814zXNvsIQ41UGE
 Glz4C6YGArdiDJtjAwixEEyu5jwA8+9URU4/WqBlXT6IsBTmP7CnCiPi5Pghj1Kp
 MPM6khwhKDqU8Pc58Vl+Tm1P8t+Uk57iJO59tiL2q+S/ANM39ci4FV8x78eXbDzh
 kmhOTiCr1SxrVNqaMph0
 =xi0L
 -END PGP SIGNATURE-

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


Hi Chris,

Take a look at my gist and it should make sense. The log handler is
1catalina.org.apache.juli.FileHandler and the problem is that it is
writing logs to test.2014-01-38log instead of test.log.

Again, I agree that I need to upgrade and that is in progress. But
that doesn't change where I am today and that I want to make (what
appears to be) a supported configuration change so that I can pass log
rotation responsibilities to my preferred application.

-- 
-Vye

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



Re: Tomcat v6.0.20 - Cannot Remove Date From JULI Log File Names

2014-01-28 Thread Konstantin Kolinko
2014-01-28 Vye v...@vye.me:
 On Tue, Jan 28, 2014 at 9:32 AM, Daniel Mikusa dmik...@gopivotal.com wrote:
 On Jan 28, 2014, at 12:05 PM, Vye v...@vye.me wrote:

 I have been unsuccessfully trying to remove the date from catalina's
 log file name. My ultimate goal is to logrotate the file, which is
 best done when the file name is static.

 According to the FileHandler
 javadoc ( 
 http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/juli/FileHandler.html
 ) I should be able to configure
 *.org.apache.juli.FileHandler.rotatable in
 ${catalina.base}/conf/logging.properties to toggle date based file
 names, but that is not working.

 It seems like I could fix this by using log4j but I'm not sure if the
 application is logging directly to JULI or commons-logging.
 Regardless, I do not have access to modify it. I would like to
 continue to use the default JULI logger since it is already in use.
 Judging by the docs what I'm trying to do should be possible.

 I'm positive the logging.properties file is being read because when I
 change the prefix and suffix they are applied upon restart. I've
 pasted my logging.properties and sample output in this gist:
 http://git.io/99qidw Anyone can wget the raw logging.properties and
 download tomcat from the archives to reproduce.

 I would appreciate it if someone could point me in the right
 direction. I've been referencing
 http://tomcat.apache.org/tomcat-6.0-doc/logging.html.

 Tomcat version: http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.20/bin/


 Hi Dan,

 I am aware of the concerns, it is a legacy system that is already
 being phased out. The log files are rotated out of box but they cannot
 be automatically compressed or deleted after a waiting period, which
 is the functionality I want.

 Does the JULI logger not work as documented? Sure there are other ways
 to keep the logs cleaned up, but my question is specifically regarding
 the rotatable option for JULI.


IIRC the rotatable option was added several years ago and does not
exist in such old version as 6.0.20.  Another reason for an upgrade?

You can use java.util.logging.FileHandler class.
Tomcat JULI can use any java.util.logging handlers. (E.g. the default
configuration already uses ConsoleHandler).

Best regards,
Konstantin Kolinko

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



Re: Tomcat v6.0.20 - Cannot Remove Date From JULI Log File Names

2014-01-28 Thread Vye
On Tue, Jan 28, 2014 at 10:17 AM, Konstantin Kolinko
knst.koli...@gmail.com wrote:
 2014-01-28 Vye v...@vye.me:
 On Tue, Jan 28, 2014 at 9:32 AM, Daniel Mikusa dmik...@gopivotal.com wrote:
 On Jan 28, 2014, at 12:05 PM, Vye v...@vye.me wrote:

 I have been unsuccessfully trying to remove the date from catalina's
 log file name. My ultimate goal is to logrotate the file, which is
 best done when the file name is static.

 According to the FileHandler
 javadoc ( 
 http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/juli/FileHandler.html
 ) I should be able to configure
 *.org.apache.juli.FileHandler.rotatable in
 ${catalina.base}/conf/logging.properties to toggle date based file
 names, but that is not working.

 It seems like I could fix this by using log4j but I'm not sure if the
 application is logging directly to JULI or commons-logging.
 Regardless, I do not have access to modify it. I would like to
 continue to use the default JULI logger since it is already in use.
 Judging by the docs what I'm trying to do should be possible.

 I'm positive the logging.properties file is being read because when I
 change the prefix and suffix they are applied upon restart. I've
 pasted my logging.properties and sample output in this gist:
 http://git.io/99qidw Anyone can wget the raw logging.properties and
 download tomcat from the archives to reproduce.

 I would appreciate it if someone could point me in the right
 direction. I've been referencing
 http://tomcat.apache.org/tomcat-6.0-doc/logging.html.

 Tomcat version: http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.20/bin/


 Hi Dan,

 I am aware of the concerns, it is a legacy system that is already
 being phased out. The log files are rotated out of box but they cannot
 be automatically compressed or deleted after a waiting period, which
 is the functionality I want.

 Does the JULI logger not work as documented? Sure there are other ways
 to keep the logs cleaned up, but my question is specifically regarding
 the rotatable option for JULI.


 IIRC the rotatable option was added several years ago and does not
 exist in such old version as 6.0.20.  Another reason for an upgrade?

 You can use java.util.logging.FileHandler class.
 Tomcat JULI can use any java.util.logging handlers. (E.g. the default
 configuration already uses ConsoleHandler).

 Best regards,
 Konstantin Kolinko

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


Konstantin,

That was helpful. With any luck we won't be using it much longer.

Thanks.

-- 
-Vye

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



Re: Tomcat v6.0.20 - Cannot Remove Date From JULI Log File Names

2014-01-28 Thread Daniel Mikusa
On Jan 28, 2014, at 1:02 PM, Vye v...@vye.me wrote:

 On Tue, Jan 28, 2014 at 9:32 AM, Daniel Mikusa dmik...@gopivotal.com wrote:
 On Jan 28, 2014, at 12:05 PM, Vye v...@vye.me wrote:
 
 Hi Tomcat users,
 
 Tomcat 6.0.20 is very old and has known security issues.  See the notices 
 here.
 
  https://tomcat.apache.org/security-6.html
 
 You’ve been warned.  You should upgrade ASAP.
 
 
 I have been unsuccessfully trying to remove the date from catalina’s
 log file name. My ultimate goal is to logrotate the file, which is
 best done when the file name is static.
 
 I’m curious, why are you trying to do this?  The log files are being rotated 
 out-of-the-box.  They rotate by date, hence why the date is part of the 
 name.  Why do you need to rotate them with some other tool?  What doesn’t 
 work about the out-of-the-box configuration?
 
 Dan
 
 According to the FileHandler
 javadoc ( 
 http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/juli/FileHandler.html
 ) I should be able to configure
 *.org.apache.juli.FileHandler.rotatable in
 ${catalina.base}/conf/logging.properties to toggle date based file
 names, but that is not working.
 
 It seems like I could fix this by using log4j but I'm not sure if the
 application is logging directly to JULI or commons-logging.
 Regardless, I do not have access to modify it. I would like to
 continue to use the default JULI logger since it is already in use.
 Judging by the docs what I'm trying to do should be possible.
 
 I’m positive the logging.properties file is being read because when I
 change the prefix and suffix they are applied upon restart. I’ve
 pasted my logging.properties and sample output in this gist:
 http://git.io/99qidw Anyone can wget the raw logging.properties and
 download tomcat from the archives to reproduce.
 
 I would appreciate it if someone could point me in the right
 direction. I’ve been referencing
 http://tomcat.apache.org/tomcat-6.0-doc/logging.html.
 
 Tomcat version: http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.20/bin/
 
 Thank you.
 
 --
 -Vye
 
 -
 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
 
 
 Hi Dan,
 
 I am aware of the concerns, it is a legacy system that is already
 being phased out. The log files are rotated out of box but they cannot
 be automatically compressed or deleted after a waiting period, which
 is the functionality I want.

You’re certainly free to do as you’d like here.  My suggestion would be to just 
create a cron script that zips old files and deletes even older ones.  Off the 
top of my head, you could use the find command to get files older than X days 
and perform some task on them, compress or delete.

 
 Does the JULI logger not work as documented? Sure there are other ways
 to keep the logs cleaned up, but my question is specifically regarding
 the rotatable option for JULI.

As Konstantin mentioned, this was added a later release, 6.0.33 to be specific.

  https://issues.apache.org/bugzilla/show_bug.cgi?id=49180

Dan

 
 -- 
 -Vye
 
 -
 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 v6.0.20 - Cannot Remove Date From JULI Log File Names

2014-01-28 Thread Vye
On Tue, Jan 28, 2014 at 10:42 AM, Daniel Mikusa dmik...@gopivotal.com wrote:
 On Jan 28, 2014, at 1:02 PM, Vye v...@vye.me wrote:

 On Tue, Jan 28, 2014 at 9:32 AM, Daniel Mikusa dmik...@gopivotal.com wrote:
 On Jan 28, 2014, at 12:05 PM, Vye v...@vye.me wrote:

 Hi Tomcat users,

 Tomcat 6.0.20 is very old and has known security issues.  See the notices 
 here.

  https://tomcat.apache.org/security-6.html

 You’ve been warned.  You should upgrade ASAP.


 I have been unsuccessfully trying to remove the date from catalina’s
 log file name. My ultimate goal is to logrotate the file, which is
 best done when the file name is static.

 I’m curious, why are you trying to do this?  The log files are being 
 rotated out-of-the-box.  They rotate by date, hence why the date is part of 
 the name.  Why do you need to rotate them with some other tool?  What 
 doesn’t work about the out-of-the-box configuration?

 Dan

 According to the FileHandler
 javadoc ( 
 http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/juli/FileHandler.html
 ) I should be able to configure
 *.org.apache.juli.FileHandler.rotatable in
 ${catalina.base}/conf/logging.properties to toggle date based file
 names, but that is not working.

 It seems like I could fix this by using log4j but I'm not sure if the
 application is logging directly to JULI or commons-logging.
 Regardless, I do not have access to modify it. I would like to
 continue to use the default JULI logger since it is already in use.
 Judging by the docs what I'm trying to do should be possible.

 I’m positive the logging.properties file is being read because when I
 change the prefix and suffix they are applied upon restart. I’ve
 pasted my logging.properties and sample output in this gist:
 http://git.io/99qidw Anyone can wget the raw logging.properties and
 download tomcat from the archives to reproduce.

 I would appreciate it if someone could point me in the right
 direction. I’ve been referencing
 http://tomcat.apache.org/tomcat-6.0-doc/logging.html.

 Tomcat version: http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.20/bin/

 Thank you.

 --
 -Vye

 -
 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


 Hi Dan,

 I am aware of the concerns, it is a legacy system that is already
 being phased out. The log files are rotated out of box but they cannot
 be automatically compressed or deleted after a waiting period, which
 is the functionality I want.

 You’re certainly free to do as you’d like here.  My suggestion would be to 
 just create a cron script that zips old files and deletes even older ones.  
 Off the top of my head, you could use the find command to get files older 
 than X days and perform some task on them, compress or delete.


 Does the JULI logger not work as documented? Sure there are other ways
 to keep the logs cleaned up, but my question is specifically regarding
 the rotatable option for JULI.

 As Konstantin mentioned, this was added a later release, 6.0.33 to be 
 specific.

   https://issues.apache.org/bugzilla/show_bug.cgi?id=49180

 Dan


 --
 -Vye

 -
 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


Dan,

My thoughts precisely. Thanks for the link.

-- 
-Vye

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



Re: Clustering without Apache in the front

2014-01-28 Thread Raquib Hasan
Chris,

Do you mean, if just the sticky session is used, tomcat clustering won't be
needed?


Thanks,
Raquib Hasan



On Tue, Jan 28, 2014 at 12:37 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Raquib,

 On 1/28/14, 12:29 PM, Raquib Hasan wrote:
  I am not sure whether the sticky session is needed or not. The
  session replication also may not be needed. My requirement is very
  simple.

 If you don't need anything fancy, may I suggest that you start by
 using sticky sessions and no session-replication? If you use sessions,
 you'll need to use one of the two otherwise nothing will work properly.

 Sticky-sessions are simple to configure and get you a lot of mileage
 without much horsepower at all.

  There are 2 back end servers. I want both gets same user
  communication at the same time, so that, if one server fails the
  other can continue.

 Assuming that you can suffer the loss of a single in-progress request,
 you want to route the request to a /single/ back-end server and not do
 something weird like broadcasting. If you use sticky sessions, the
 same back-end server will get all of the requests for a particular
 session.

 If that node fails, subsequent requests will be routed to the other
 server. If you don't have session-replication enabled, the user's
 session will be lost and they will have to re-login, possibly
 re-starting any work in-progress. That's up to your webapp's tolerance
 for fail-over to handle.

  I though cluster is the solution. Does the session replication
  come with the clustering feature?

 Clustering ≈ session replication. Tomcat's clustering does not provide
 anything other than session replication.

  VIP means Virtual IP address given to client. Back-end servers can
  be communicated using the VIP no matter where the LB routes the
  requests to.

 I don't think that's necessary at all. LBs are designed to handle sets
 of back-end servers and choose one of them based on a number of
 criteria. You don't need to create a virtual IP that wanders-around
 through your beck-end servers: the Big IP itself is the IP address
 everyone will hit.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJS5+rxAAoJEBzwKT+lPKRYMqIP/3ekCp19upctE7XhZCu5/eca
 5DZkTqzVtBoX2twnnRAwd9CN8X2aTAo26Lg9H+KtVeykGyKx4tseycWzq/4mR1Dq
 g4v8uw6SK/L7yReC84gUW55bvMxr93t4Zdy8dy6qp0L5yoEVlFEEbSaIcOyYHuIA
 NbFef4Cv5v8JjOOqNSRiwuweXs2IVRRzDee26YrB5ASwP1wPIG6emlCCdlMLqjvo
 eKmM1Gcm6AVoiJT+iG47Tms2MXrNhk58HD6xjh4+APdzs70/419UGVEj+YeKcMBv
 0/vu27wnZd90AECKgSwv8f0aAgkX4pveEyBf1UvvoEywZ1nEj6LLv/+1xELX/1no
 pS0/cBGcDE8ujPUpa/SsLFyVkvJPcLYTdQ5V0yMUHb7qQysduYLF5mSI30OGs+aW
 DJm0bzLU6XZhVofmDBnG6vpYQKH3BxMjLlsUzQdM2W2EP/NwmNZuILfWJ6P/Wc3d
 r6Fck7GbAD5Ycn666FpclMIZC6H7GhlsRs9TGwRh0s3RBpQm9nLIIUiUDlRNJz3c
 hOMU6FRP1COx2dNjSPATtKnT2IPKofDpWSVTrlK9PrmFG7WztMboF0dfZZFamyZD
 wTzppXEXgW+scDYbnp+Nn7O55YReQfBW4Gk3qvWIgIEG6vs7wl8LRsr1a2FODCJb
 VmOeh6a6RNIemYG4nxCJ
 =X+/W
 -END PGP SIGNATURE-

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




Re: Clustering without Apache in the front

2014-01-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Raquib,

On 1/28/14, 3:18 PM, Raquib Hasan wrote:
 Do you mean, if just the sticky session is used, tomcat clustering
 won't be needed?

In some ways, yes, it is that simple.

In other ways it is not.

If you use sticky-sessions without clustering, all will well until a
fail-over occurs. When a fail-over occurs, any users who were on the
failed node will experience an interruption. If that's acceptable to
you and your users, then there is no need (IMO) for clustering.

If you cannot afford to have sessions fail during fail-over and users
cannot be required to re-login, then you will have to implement
clustering.

I personally always try to construct my applications such that
fail-over results in a resumable-situation: the user will have to
re-login but otherwise the workflow is not interrupted.

Thus I will probably never have to use clustering.

- -chris

 On Tue, Jan 28, 2014 at 12:37 PM, Christopher Schultz  
 ch...@christopherschultz.net wrote:
 
 Raquib,
 
 On 1/28/14, 12:29 PM, Raquib Hasan wrote:
 I am not sure whether the sticky session is needed or not.
 The session replication also may not be needed. My
 requirement is very simple.
 
 If you don't need anything fancy, may I suggest that you start by 
 using sticky sessions and no session-replication? If you use
 sessions, you'll need to use one of the two otherwise nothing will
 work properly.
 
 Sticky-sessions are simple to configure and get you a lot of
 mileage without much horsepower at all.
 
 There are 2 back end servers. I want both gets same user 
 communication at the same time, so that, if one server fails
 the other can continue.
 
 Assuming that you can suffer the loss of a single in-progress
 request, you want to route the request to a /single/ back-end
 server and not do something weird like broadcasting. If you use
 sticky sessions, the same back-end server will get all of the
 requests for a particular session.
 
 If that node fails, subsequent requests will be routed to the
 other server. If you don't have session-replication enabled, the
 user's session will be lost and they will have to re-login,
 possibly re-starting any work in-progress. That's up to your
 webapp's tolerance for fail-over to handle.
 
 I though cluster is the solution. Does the session
 replication come with the clustering feature?
 
 Clustering ≈ session replication. Tomcat's clustering does not
 provide anything other than session replication.
 
 VIP means Virtual IP address given to client. Back-end
 servers can be communicated using the VIP no matter where the
 LB routes the requests to.
 
 I don't think that's necessary at all. LBs are designed to handle
 sets of back-end servers and choose one of them based on a number
 of criteria. You don't need to create a virtual IP that
 wanders-around through your beck-end servers: the Big IP itself is
 the IP address everyone will hit.
 
 -chris
 
 -

 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJS6BYxAAoJEBzwKT+lPKRYkm0P/igmCiHXK2lGLMlTRT/Mp1rZ
BwsH1Vzl1AR4y/twr5jnx4tLwtKjjoI/lkPwOfnWcm97POCpxCF2bOEk9pu/VLJw
Px1Joyqh3LhadZkytB+u5PGWctCKuUHU48GXOUV+d0KH1N77McOyv4wGzJ8lKBDK
oliQ1iGuLptL+jK3p2sjsD7s6xOKPDDG9+8mKVYb71TYuRPEdVbhvQU5DZdYhbXU
RGJZVy+9XtD5WD3swNSWkbxpLs01FBmutrEQYq/zJzPjBS2Vyh1KHQgWU2ZR1BCY
HZzCwt0zcx5bvM8bix6U7BqvJQ0gzMS513hS6eQ9fryuYFJQqxchYIj09+cXiEQ1
CPpb/4MT2vAIUM4uMD6/uoXi+QYemL1D4LZMXElAMObJoNob9sPKnSmicCGf2JJl
t9z5mfW2JvOTib6KOM24/gnBhYbCDbBy7CeUq6G0dERdOYcledoYghlm7f6kht8n
bOM3LHxat+yIEzpoyHozZb5sW9VDFCj1lSvf+6/YB12FRetunxRsRLpryVOxjLOY
tpgbcbsv3/ma/PxZ2Vcx9FKnjsF7rstkOD5oQGEQg0O0YPnz+TfWVmh5f0ycmWbo
+8+8aqZVsF+R12XE7Uv+FShzqZAEZrQIPO4DUvFTCSxjgh9/RpQ41InPmf+FlGen
9Z/0r0/TVoasIXSjfEu/
=oFmF
-END PGP SIGNATURE-

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



Re: Clustering without Apache in the front

2014-01-28 Thread Howard W. Smith, Jr.
On Tue, Jan 28, 2014 at 3:42 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 Thus I will probably never have to use clustering.


Loving your responses on this topic, Chris. I do not want to hijack this
thread, but i find this topic interesting, and your responses make it more
interesting!

Honestly, I don't need clustering (yet) in my app, but I feel as though
endusers of my app will be fine in a failover situation (as you described
in this thread). Endusers of my app have to login a lot since I set session
expired = 15 minutes. no complaints from the endusers, because they are in
and out of the app...all day, (almost) every day.

the only time I really need failover is when I 'might' want to update the
app's software. the app is quite stable now and not many software changes
right now, so again, there's not much of a need for failover. :)

still listening in on this topic. :)


Re: Tomcat JDBC Error

2014-01-28 Thread Leo Medina
Hi Chris,

What type of script is this?  I'm on a linux box and keep getting and error:

[javadev@corpjbdev01 apache-tomcat-6.0.26]$ for
/apps/tomcat/apache-tomcat-6.0.26/lib/*.jar \
? /apps/tomcat/apache-tomcat-6.0.26/webapps/rbacx/WEB-INF/lib/*.jar \
?  ; do echo$jar ; unzip -v $jar |grep -i mysql ; done
for: Command not found.
jar: Undefined variable.

Thanks,

Leo
On Tue, Jan 28, 2014 at 6:45 AM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Leo,

 On 1/27/14, 12:17 PM, Leo Medina wrote:
  Good morning Mark,
 
  Can you please elaborate more as to what you meant by:
  com.mysql.jdbc.Driver must be present in one of your webapps. I'd
  expect it to be in a JAR that has mysql in the name. If you don't
  need it remove it.  I meant that we don't have a mysql db.  in our
  original integration. You also mention that it *must* be present,
  yet if I don't need it to remove it.  Sorry a little confused on
  that statement, can you please clarify.

 $ for jar in $CATALINA_HOME/lib/*.jar \
  $PATH_TO_WEBAPP/WEB-INF/lib/*.jar \
   ; do echo $jar ; unzip -v $jar | grep -i mysql ; done

 That ought to find it.

 I'm not sure why it would be auto-loaded... JDBC drivers don't
 auto-load themselves just because they are available to a ClassLoader.
 Some code somewhere must be loading the driver, whether explicitly
 using Class.forName(...) or by referencing part of Connector/J
 elsewhere in the code, causing a chain of class-loading and
 static-initializers that ultimately end up loading the JDBC Driver
 into the DriverManager.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJS58J+AAoJEBzwKT+lPKRY/p4P/j3F0MPaQGoOY4xu0ZNIgPom
 dQKNthbNd1EcfN+aPcKaXrEwY8GkcjIctODPbDXs7Th4xQj3ldRBjzRqr28RG+xX
 ujDFnMqIB6isvf2e03I+l4hogTb8dDgCFMepf1A642N6ThvD7hmRGDgi8TizyPJJ
 e6HddQAYprZOheANC6aj6JI8NEiwIeHpyS96XWdMQHxHg/rF/1Uqg4Vv/EF+NdeL
 e6CPxrhSQ7iEBNFU08tzEDgV1OCWs/CvgMPONZO+J6SxvyvW6OABEsmQQrAVWBSa
 SFk2LXRH8qSqayilmcDv4VCBCMqSeytK8Bg1Fyg3frHE6Pmi2th14rp53ndUkSYt
 OPfPtC6Pdqa8vXxShe3b9LeRxjgdUvpXgnXjnM1B+Lay4OEankmOd36ZIkYaaW+3
 q7fgaRYr//2skFLbq154koCo493DrV5leaJPjFEcwFKE3SUElU6vnYCeeMsNuN4Q
 rlTZdYKL54aWQg0HI45jxfg44lh1AX/d7UQ4U505IgilJJvxa9g/wRiRhEy051wJ
 nFX25ZODviJmJc090sqkVqv+bgpO1UAWu7/sFbhkZ8+zcA73HS9J0+0ItB108JiF
 MnaJQMIgdda9Li/NagD8otW+U6Hon3C3Pyl/AmCmO5+j4/USurxHd7HxlT4vugNI
 5/MzyNBL8A+uDh+Kk4Iv
 =nOU4
 -END PGP SIGNATURE-

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




class from jar in tomcat/lib not found

2014-01-28 Thread Ja kub
Hallo

I try to define database resource in tomcat/conf/context.xml

  Resource name=jdbc/petclinic auth=Container
type=javax.sql.DataSource
   username=root password=xxx
driverClassName=net.sf.hajdbc.sql.Driver
   url=jdbc:ha-jdbc:cluster-petclinic/

when I put ha-jdbc-3.0.jar into lib directory class
net.sf.hajdbc.sql.Driver is found,
but when I put ha-jdbc-2.0.16.jar into lib directory I get

Caused by: java.lang.NoClassDefFoundError: Could not initialize class
net.sf.hajdbc.sql.Driver
at java.lang.Class.forName0(Native Method) ~[na:1.6.0_37]
at java.lang.Class.forName(Class.java:169) ~[na:1.6.0_37]
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1415)
~[tomcat-dbcp.jar:7.0.50]
... 34 common frames omitted


although this class for shure is in this jar, and works if jar is in my
petclinic/WEB-INF/lib

any idea what can be the cause ?

my suspision is:

ha-jdbc-3.0.jar has META-INF/services , and there is java.sql.Driver file
which contains net.sf.hajdbc.sql.Driver

ha-jdbc-2.0.16.jar has no META-INF/services

Is it the cause ? If so, what mechanism is it?
But other jars in tomcat/lib also don't have META-INF/services.


BR
Jakub


Re: class from jar in tomcat/lib not found

2014-01-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jakub,

On 1/28/14, 4:52 PM, Ja kub wrote:
 Hallo
 
 I try to define database resource in tomcat/conf/context.xml
 
 Resource name=jdbc/petclinic auth=Container 
 type=javax.sql.DataSource username=root password=xxx 
 driverClassName=net.sf.hajdbc.sql.Driver 
 url=jdbc:ha-jdbc:cluster-petclinic/
 
 when I put ha-jdbc-3.0.jar into lib directory class 
 net.sf.hajdbc.sql.Driver is found, but when I put
 ha-jdbc-2.0.16.jar into lib directory I get
 
 Caused by: java.lang.NoClassDefFoundError: Could not initialize
 class net.sf.hajdbc.sql.Driver at java.lang.Class.forName0(Native
 Method) ~[na:1.6.0_37] at java.lang.Class.forName(Class.java:169)
 ~[na:1.6.0_37] at 
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1415)

 
~[tomcat-dbcp.jar:7.0.50]
 ... 34 common frames omitted
 
 
 although this class for shure is in this jar, and works if jar is
 in my petclinic/WEB-INF/lib
 
 any idea what can be the cause ?
 
 my suspision is:
 
 ha-jdbc-3.0.jar has META-INF/services , and there is
 java.sql.Driver file which contains net.sf.hajdbc.sql.Driver
 
 ha-jdbc-2.0.16.jar has no META-INF/services
 
 Is it the cause ? If so, what mechanism is it? But other jars in
 tomcat/lib also don't have META-INF/services.

I can't make head or tail out of all this information you gave.

What do these commands print:

$ unzip -v ha-jdbc-3.0.jar  | grep net.sf.hajdbc.sql.Driver

and

$ unzip -v ha-jdbc-2.0.16.jar  | grep net.sf.hajdbc.sql.Driver

Have you put both JAR files in lib/ at once?

What is a jar directory class?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJS6C8AAAoJEBzwKT+lPKRYHJcP/2I23wvcqIjNwsfF2L9xPJdL
FFQDkMPM5bXw+E491wVMAWCCH0tG9expiyOR2fMAJ9ROc+jY/PHsbNOAdh9HE6Ws
VGb6WczOCo+pic+qfppNoJ/UsH6tmOehBWPeCIuPjyXiuHF//Mg+hf5fikC20dsP
+GykNwb2nc7QgdQojsQ2lAPGIb5P6pFlX+bNh4bBrzzQbGCjGSrmE5v7NpypLDSa
dMeHB8PYTnqY6J4sAbER+NAqz1iSHXfileyhISoikjzrZkqcrEZhgfcepuf+1H9K
sZ6tlH80to/w7hiY1R6KhT8h1uEAjBr3bTHjzgXsOrR5h5ttha6VowWKmfprpXve
b1JQBw+Vhs4DUtGdk48NlJv4FsMdeDNVQM5lIvgyXmndpVoH8MAh8DBKz20ibNqe
PJS+p8QOzsfR3ye0ltUWn7/UskLdZb0WjyZa4TItDVmQajUdB9OIANTnMtvaZ1QW
rdVWM+savu3oBGKp9EQp3KPjCPG/Q06iQzKRRGivrkKunzl7oCDwZ3nrQBj3fA+j
Lh0u4cJKYmn76pLB3NCbQtDX6CCLoR9gVIKdmiZhCtZH+nq7JVx+xGMejpMd5LR7
t0Kagw2S255cQRjIvGJD8mvWWMwd+S+pNNobR7cARFxZJWISXgJ4UdMXzBkwWzVE
MzLNDtBCDrnNxbMAN45q
=TWY8
-END PGP SIGNATURE-

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



Re: [OT] Tomcat JDBC Error

2014-01-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Leo,

On 1/28/14, 4:10 PM, Leo Medina wrote:
 What type of script is this?

Bash. It should work on any sh-compatible shell.

 I'm on a linux box and keep getting and error:
 
 [javadev@corpjbdev01 apache-tomcat-6.0.26]$ for 
 /apps/tomcat/apache-tomcat-6.0.26/lib/*.jar \ ?
 /apps/tomcat/apache-tomcat-6.0.26/webapps/rbacx/WEB-INF/lib/*.jar
 \ ?  ; do echo$jar ; unzip -v $jar |grep -i mysql ; done for:
 Command not found. jar: Undefined variable.

Something above got really broken: it should be for jar in
[filelist] and you are missing the (literal) jar part of it.

- -chris

 On Tue, Jan 28, 2014 at 6:45 AM, Christopher Schultz  
 ch...@christopherschultz.net wrote:
 
 Leo,
 
 On 1/27/14, 12:17 PM, Leo Medina wrote:
 Good morning Mark,
 
 Can you please elaborate more as to what you meant by: 
 com.mysql.jdbc.Driver must be present in one of your
 webapps. I'd expect it to be in a JAR that has mysql in the
 name. If you don't need it remove it.  I meant that we don't
 have a mysql db.  in our original integration. You also
 mention that it *must* be present, yet if I don't need it to
 remove it.  Sorry a little confused on that statement, can
 you please clarify.
 
 $ for jar in $CATALINA_HOME/lib/*.jar \ 
 $PATH_TO_WEBAPP/WEB-INF/lib/*.jar \ ; do echo $jar ; unzip -v $jar
 | grep -i mysql ; done
 
 That ought to find it.
 
 I'm not sure why it would be auto-loaded... JDBC drivers don't 
 auto-load themselves just because they are available to a
 ClassLoader. Some code somewhere must be loading the driver,
 whether explicitly using Class.forName(...) or by referencing part
 of Connector/J elsewhere in the code, causing a chain of
 class-loading and static-initializers that ultimately end up
 loading the JDBC Driver into the DriverManager.
 
 -chris
 
 -

 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJS6C9hAAoJEBzwKT+lPKRYHkUQAIfIvwxFA/cW0ACFsC2/JnTt
5Gb4439A0HZkZHyGAKCZQJlNVcNlRKblvaVGNrg1fwzrTIxs9b1F8asSahQmp1HU
vqrSsZkA4jVYxENRk6D1q6xJYN7BZeufx8efrw6ulJl+3jTCmIUCyYbs6hPVJXjT
QVoa8+peQw0fGr2Ax62rgkjjV3FDJbPS8jJTRUqVuF7ioRDn+giaLFMeYeCAbcGN
YIw+ZxUxY8aIxF/0ZdChCBkSPDguRTN5Epl4khsoOEC919m33c0OyytI8RMhMR4q
dJzXtaSBetPG5jXD5hx4M4TFdVWHzXaVtZZELdQB/5S5urrzPdUgMfBTQBIkZfgv
V0sz7JXm67KDISgKng4QK6dV5ngMxBY7nfnvyacc1qkYkNbP55pwqzPY5o/NXBcz
Sx2NsOVlx865rOryU1hN8pv2cby9DyFEPiSpKqv7Ww2OMj4K9uGM1VgZ85PZJ+ck
CaAl/NLgscxuX+NM2urFNUgfWvd4E+JHfPzBQ2EByZs2kKAbri1u6a12veUr/xb4
Zt3towRQnwfXqGGPxyA1YD3o7RggJnqVdF5Tn4hrWyqbzlOh7hXHqy4KvCiLXKNe
enKNzbbOzfbN3wXe4lbtjpyVxbnwVeE5lVVxzX3QaBPjr58hoXf4Rv9A78LD+7N0
U0jyXhHbtIka12Fe/vHV
=ooBC
-END PGP SIGNATURE-

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



RE: class from jar in tomcat/lib not found

2014-01-28 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Subject: Re: class from jar in tomcat/lib not found

  Caused by: java.lang.NoClassDefFoundError

 Have you put both JAR files in lib/ at once?

Or one in Tomcat's lib directory and another in the app's WEB-INF/lib.  Having 
the same class visible to nested classloaders can cause the exception above.

 - 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: Clustering without Apache in the front

2014-01-28 Thread Raquib Hasan
Thanks Chris .. now I got a clear picture.
First off I will try without cluster. If that does not work, I will go for
clustering.

Regards.


On Tue, Jan 28, 2014 at 3:42 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Raquib,

 On 1/28/14, 3:18 PM, Raquib Hasan wrote:
  Do you mean, if just the sticky session is used, tomcat clustering
  won't be needed?

 In some ways, yes, it is that simple.

 In other ways it is not.

 If you use sticky-sessions without clustering, all will well until a
 fail-over occurs. When a fail-over occurs, any users who were on the
 failed node will experience an interruption. If that's acceptable to
 you and your users, then there is no need (IMO) for clustering.

 If you cannot afford to have sessions fail during fail-over and users
 cannot be required to re-login, then you will have to implement
 clustering.

 I personally always try to construct my applications such that
 fail-over results in a resumable-situation: the user will have to
 re-login but otherwise the workflow is not interrupted.

 Thus I will probably never have to use clustering.

 - -chris

  On Tue, Jan 28, 2014 at 12:37 PM, Christopher Schultz 
  ch...@christopherschultz.net wrote:
 
  Raquib,
 
  On 1/28/14, 12:29 PM, Raquib Hasan wrote:
  I am not sure whether the sticky session is needed or not.
  The session replication also may not be needed. My
  requirement is very simple.
 
  If you don't need anything fancy, may I suggest that you start by
  using sticky sessions and no session-replication? If you use
  sessions, you'll need to use one of the two otherwise nothing will
  work properly.
 
  Sticky-sessions are simple to configure and get you a lot of
  mileage without much horsepower at all.
 
  There are 2 back end servers. I want both gets same user
  communication at the same time, so that, if one server fails
  the other can continue.
 
  Assuming that you can suffer the loss of a single in-progress
  request, you want to route the request to a /single/ back-end
  server and not do something weird like broadcasting. If you use
  sticky sessions, the same back-end server will get all of the
  requests for a particular session.
 
  If that node fails, subsequent requests will be routed to the
  other server. If you don't have session-replication enabled, the
  user's session will be lost and they will have to re-login,
  possibly re-starting any work in-progress. That's up to your
  webapp's tolerance for fail-over to handle.
 
  I though cluster is the solution. Does the session
  replication come with the clustering feature?
 
  Clustering ≈ session replication. Tomcat's clustering does not
  provide anything other than session replication.
 
  VIP means Virtual IP address given to client. Back-end
  servers can be communicated using the VIP no matter where the
  LB routes the requests to.
 
  I don't think that's necessary at all. LBs are designed to handle
  sets of back-end servers and choose one of them based on a number
  of criteria. You don't need to create a virtual IP that
  wanders-around through your beck-end servers: the Big IP itself is
  the IP address everyone will hit.
 
  -chris
 
  -
 
 
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJS6BYxAAoJEBzwKT+lPKRYkm0P/igmCiHXK2lGLMlTRT/Mp1rZ
 BwsH1Vzl1AR4y/twr5jnx4tLwtKjjoI/lkPwOfnWcm97POCpxCF2bOEk9pu/VLJw
 Px1Joyqh3LhadZkytB+u5PGWctCKuUHU48GXOUV+d0KH1N77McOyv4wGzJ8lKBDK
 oliQ1iGuLptL+jK3p2sjsD7s6xOKPDDG9+8mKVYb71TYuRPEdVbhvQU5DZdYhbXU
 RGJZVy+9XtD5WD3swNSWkbxpLs01FBmutrEQYq/zJzPjBS2Vyh1KHQgWU2ZR1BCY
 HZzCwt0zcx5bvM8bix6U7BqvJQ0gzMS513hS6eQ9fryuYFJQqxchYIj09+cXiEQ1
 CPpb/4MT2vAIUM4uMD6/uoXi+QYemL1D4LZMXElAMObJoNob9sPKnSmicCGf2JJl
 t9z5mfW2JvOTib6KOM24/gnBhYbCDbBy7CeUq6G0dERdOYcledoYghlm7f6kht8n
 bOM3LHxat+yIEzpoyHozZb5sW9VDFCj1lSvf+6/YB12FRetunxRsRLpryVOxjLOY
 tpgbcbsv3/ma/PxZ2Vcx9FKnjsF7rstkOD5oQGEQg0O0YPnz+TfWVmh5f0ycmWbo
 +8+8aqZVsF+R12XE7Uv+FShzqZAEZrQIPO4DUvFTCSxjgh9/RpQ41InPmf+FlGen
 9Z/0r0/TVoasIXSjfEu/
 =oFmF
 -END PGP SIGNATURE-

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




Re: class from jar in tomcat/lib not found

2014-01-28 Thread Ja kub
Problem dissapeared when I added ha-jdbc-2.0.16 dependencies into
tomcat/lib !

j@j-Dell-System-XPS-L702X:/szkolenie/tomcat/lib_hajdbc$ unzip -v
../hajdbc3.0_lib/ha-jdbc-3.0.0.jar  | grep net.sf.hajdbc.sql.Driver
3429  Defl:N 1646  52% 2013-12-31 10:17 55394556
net/sf/hajdbc/sql/DriverDatabase.class
1232  Defl:N  524  58% 2013-12-31 10:17 fbbe1ce9
net/sf/hajdbc/sql/DriverProxyFactory.class
2630  Defl:N 1004  62% 2013-12-31 10:17 35b4d591
net/sf/hajdbc/sql/Driver$1.class
1487  Defl:N  669  55% 2013-12-31 10:17 c17fd96a
net/sf/hajdbc/sql/Driver$2.class
1522  Defl:N  672  56% 2013-12-31 10:17 ee4dde44
net/sf/hajdbc/sql/Driver$3.class
 435  Defl:N  236  46% 2013-12-31 10:17 4834ccfd
net/sf/hajdbc/sql/Driver$DriverInvoker.class
8018  Defl:N 2794  65% 2013-12-31 10:17 21b57c25
net/sf/hajdbc/sql/Driver.class
 719  Defl:N  340  53% 2013-12-31 10:17 ec305738
net/sf/hajdbc/sql/DriverInvocationHandler.class
2384  Defl:N 1034  57% 2013-12-31 10:17 fffd8294
net/sf/hajdbc/sql/DriverDatabaseClusterConfiguration$DriverNestedConfiguration.class
1574  Defl:N  605  62% 2013-12-31 10:17 72344bd7
net/sf/hajdbc/sql/DriverDatabaseClusterConfiguration.class
j@j-Dell-System-XPS-L702X:/szkolenie/tomcat/lib_hajdbc$ unzip -v
ha-jdbc-2.0.16-rc-1-jdk1.6.jar | grep net.sf.hajdbc.sql.Driver
1640  Defl:N  718  56% 2009-06-21 22:46 76b28996
net/sf/hajdbc/sql/Driver$1.class
1684  Defl:N  726  57% 2009-06-21 22:46 912651b8
net/sf/hajdbc/sql/Driver$2.class
5843  Defl:N 2392  59% 2009-06-21 22:46 317b828f
net/sf/hajdbc/sql/Driver.class
7381  Defl:N 2819  62% 2009-06-21 22:46 34e95098
net/sf/hajdbc/sql/DriverDatabase.class
5270  Defl:N 1902  64% 2009-06-21 22:46 906454c7
net/sf/hajdbc/sql/DriverDatabaseCluster.class
 431  Defl:N  212  51% 2009-06-21 22:46 c33f88df
net/sf/hajdbc/sql/DriverDatabaseClusterMBean.class
 788  Defl:N  356  55% 2009-06-21 22:46 769c6e43
net/sf/hajdbc/sql/DriverInvocationHandler.class
1635  Defl:N  661  60% 2009-06-21 22:46 783a57aa
net/sf/hajdbc/sql/DriverReadInvocationStrategy.class
2755  Defl:N 1088  61% 2009-06-21 22:46 1ad7452d
net/sf/hajdbc/sql/DriverWriteInvocationStrategy.class

I put only one jar into tomcat/lib, and no into petclinic/WEB-INF/lib (when
it was put into petclinic/WEB-INF/lib there where also all dependencies
added by maven, and no ha-jdbc in tomcat/lib)

Problem dissapeared when I added ha-jdbc-2.0.16 dependencies into
tomcat/lib !
I added jibx-run-1.2.1.jar slf4j-api-1.5.7.jar slf4j-simple-1.5.7.jar and
it helped !!
there is no more

Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC
driver class 'net.sf.hajdbc.sql.Driver'
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429)
~[tomcat-dbcp.jar:7.0.50]
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
~[tomcat-dbcp.jar:7.0.50]
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
~[tomcat-dbcp.jar:7.0.50]
at
org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
~[spring-jdbc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
at
org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
~[spring-jdbc-4.0.0.RELEASE.jar:4.0.0.RELEASE]
... 30 common frames omitted
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
net.sf.hajdbc.sql.Driver
at java.lang.Class.forName0(Native Method) ~[na:1.6.0_37]
at java.lang.Class.forName(Class.java:169) ~[na:1.6.0_37]
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1415)
~[tomcat-dbcp.jar:7.0.50]
... 34 common frames omitted
Jan 29, 2014 12:10:06 AM org.apache.catalina.core.StandardContext
startInternal
SEVERE: Error listenerStart

Strange,

Thx for help.
BR
Jakub






On Tue, Jan 28, 2014 at 11:37 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Christopher Schultz [mailto:ch...@christopherschultz.net]
  Subject: Re: class from jar in tomcat/lib not found

   Caused by: java.lang.NoClassDefFoundError

  Have you put both JAR files in lib/ at once?

 Or one in Tomcat's lib directory and another in the app's WEB-INF/lib.
  Having the same class visible to nested classloaders can cause the
 exception above.

  - 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 Summit at ApacheCon NA 2014

2014-01-28 Thread Mark Thomas
On 23/01/2014 13:29, Mark Thomas wrote:
 ApacheCon NA will be in Denver 7th to 11th April.
 
 The schedule for ApacheCon NA 2014 has been firmed up. There is an
 opportunity for a project summit on either the Thursday or the Friday.
 Since the BarCamp has been scheduled for the Thursday the Friday seems
 like the better option.
 
 We have complete flexibility as to the organisation of the Summit. One
 possible topic is with the Java EE 7 work pretty much complete, what new
 features is the community interested in between now and when the Java EE
 8 work starts? Other suggestions for topics welcome.
 
 To get this up and running we need an idea of how many folks might want
 to attend so please reply to this thread on the users list if:
 - you are interested in attending
 - you have a topic / some topics to suggest

I've put in a formal request for this. I'll update the list as and when
I get a reply.

Mark

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



Re: Apache Tomcat Summit at ApacheCon NA 2014

2014-01-28 Thread Nick Williams
I didn't know for sure whether I was coming until now, so I couldn't reply 
earlier. I'll be at ApacheCon (speaking on Log4j) and I will DEFINITELY attend 
a Tomcat summit!

I look forward to meeting you, Mark!

Nick

On Jan 28, 2014, at 6:47 PM, Mark Thomas wrote:

 On 23/01/2014 13:29, Mark Thomas wrote:
 ApacheCon NA will be in Denver 7th to 11th April.
 
 The schedule for ApacheCon NA 2014 has been firmed up. There is an
 opportunity for a project summit on either the Thursday or the Friday.
 Since the BarCamp has been scheduled for the Thursday the Friday seems
 like the better option.
 
 We have complete flexibility as to the organisation of the Summit. One
 possible topic is with the Java EE 7 work pretty much complete, what new
 features is the community interested in between now and when the Java EE
 8 work starts? Other suggestions for topics welcome.
 
 To get this up and running we need an idea of how many folks might want
 to attend so please reply to this thread on the users list if:
 - you are interested in attending
 - you have a topic / some topics to suggest
 
 I've put in a formal request for this. I'll update the list as and when
 I get a reply.
 
 Mark
 
 -
 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: using log4j in a webapp using embedded tomcat

2014-01-28 Thread John Cartwright - NOAA Federal
Thanks for your reply Chris.

On Mon, Jan 27, 2014 at 12:40 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 Are you running one and only one webapp in your Tomcat instance? If
 not, then the system property will override it for all webapps, which
 will probably cause confusion (especially if log4j.jar is in the
 webapp's WEB-INF/lib directory, since log4j will be initialized more
 than once).


For this use case, I'm only running one webapp per tomcat instance.  Good
reminder though about confusion in the case of multiple webapps.


 Where exactly in the class path?


I've tried both specifying it as an -cp argument when executing the
webapp-runner and including it in the WAR file WEB-INF/lib


 How are you initializing log4j itself? In a ServletContextListener or
 something similar? Do you manually call new PropertyConfiguration()
 or something like that? If so, why not simply put log4j.properties
 into WEB-INF/classes and remove the system property? I think that will
 simplify things and likely work better.


I'm simply initializing the logger inside the servlet, e.g.

static Logger log = Logger.getLogger(HelloWorldExample.class);

You're right though, I can put the log4j.properties file in WEB-INF/classes
and that works.  It's just that in this case being able to override the
logging properties when executing the webapp-runner would have been
convenient.


--john


Re: Clustering without Apache in the front

2014-01-28 Thread Neven Cvetkovic
On Tue, Jan 28, 2014 at 3:54 PM, Howard W. Smith, Jr. 
smithh032...@gmail.com wrote:

  Thus I will probably never have to use clustering.

 Loving your responses on this topic, Chris. I do not want to hijack this
 thread, but i find this topic interesting, and your responses make it more
 interesting!


+1. Great discussion, as always :)


 Honestly, I don't need clustering (yet) in my app, but I feel as though
 endusers of my app will be fine in a failover situation (as you described
 in this thread). Endusers of my app have to login a lot since I set session
 expired = 15 minutes. no complaints from the endusers, because they are in
 and out of the app...all day, (almost) every day.


Ultimately, session stickiness works great to handle load balancing
(workload management), but it is not enough for session failover. In the
unlikely event that the serving tomcat instance dies, the user will be sent
over to the other tomcat instance (that doesn't know anything about you,
i.e. doesn't have your session data), and will probably need to login
again. Now, as Chris pointed out - it would be great to design your app
that it saves the intermediate work to a database or some secondary store
that can be retrieved upon login again. Think shopping cart, you are
shopping around, the instance goes down, you need to login again, and a
nice application would persist shopping cart for you, not so nice
application would not, so when logged in again - the shopping cart would be
available or not :)

Now, if your end users can live with that scenario - that's great - no need
for session replication, clustering your instances, network chatter, etc...
It definitely simplifies the configuration and setup.

However, if your end users (i.e. your Service-Level-Agreement / SLA) do
require a proper session failover, you will need some sort of session
replication to successfully implement that feature. That's not trivial and
depends on the appserver (e.g. Tomcat, JBoss, WebSphere, Weblogic). Session
replication is not part of the official JEE/Servlet spec, but most modern
and serious appservers would provide some way of replicating sessions and
clustering appserver instances.

Now, if you could make you application stateless - you could possibly turn
off the sticky sessions.  Makes things very easy to scale!

:))

the only time I really need failover is when I 'might' want to update the
 app's software. the app is quite stable now and not many software changes
 right now, so again, there's not much of a need for failover. :)


Excellent! Keep it simple!

Good luck!
Neven


Re: request.getAttribute(javax.servlet.request.X509Certificate) returns NULL for AJP connector (possible Bon Code issue?)

2014-01-28 Thread John Palmer
Konstantin:
Thanks for the suggestion - I'll hang on to that link.
I was ready to try running Tomcat with a debugger... the instructions I
found were for using Eclipse (which I already had set up, but not with the
TomCat source)... but I was reluctant to deal with another steep learning
curve.

Logging EVERYTHING didn't show me anything useful - except perhaps to tell
me ( by its absence) that the problem is not in Tomcat.

However, (see the other response I'll have here shortly) - I think that
Christopher Schultz has hit the nail on the head.. as you''ll see in my
response to him


On Tue, Jan 28, 2014 at 12:11 PM, Konstantin Kolinko knst.koli...@gmail.com
 wrote:

 2014-01-28 John Palmer johnpalm...@gmail.com:
   We have two similar production environments which use:
  request.getAttribute(javax.servlet.request.X509Certificate)
  for several purposes.
 
  These use tomcat behind IIS using the Jakarta connector (aka reverse
 proxy)
  and have been running since 2006 and 2011 respectively without
 significant
  issues ... other than perhaps insufficient memory (and sometimes IIS
 can't
  talk to Tomcat and everything has to be restarted, multiple times, to
  resolve).
 
  We're trying to upgrade/replace these servers with 64-bit Windows OS  due
  to memory constraints caused by the use of  32-bit OS, and these
 attributes
  (and related SSL attributes in Tomcat) are now returning NULL in our DEV
  environment
 
  Old environment:
  IIS 5.0 on WIndows Server 2003 SP2, Jakarta Isapi Redirector 1.2.37,
 TomCat
  7.0.47
 
  (While researching how to set up Jakarta Isapi Redirector in IIS 7.5
 with
  a 64-bit Windows 2008 I saw multiple people reporting issues with poor
  performance, lockups etc, and decided we would try Bon Code instead.)
 
  New Environment
  IIS 7.5 on Win Server 2008 R2, Bon Code 1.0.17, TomCat 7.0.47
 
 
  IIS is configured with Client Cert Required; browser is being prompted
 for
  cert, and cert info is being sent to IIS.
 
  According to Bon Code logs, request headers are being populated with
 plenty
  of information, including client cert and client issuer cert information.
 
  It looks like Tomcat is receiving these request headers, but is not
  populating the request attributes related to SSL and Cert information,
 but
  I can't see why in the logs, even after turning the logs to ALL and
 wading
  through the copious output.
 
  After looking through the Tomcat source multiple times, I don't see how
 the
  AJP connector can populate these request attributes at all - but it is in
  our current (32-bit OS) environment.
  -
  I understand that Tomcat is NOT doing the SSL connection itself - IIS is,
  just as Apache Web Server can be made to do, but my understanding is that
  Tomcat should be able to populate these attributes from information sent
  with the request throught the AJP connector (eg, in the Request Headers),
  That seems to be working wonderfully in our current environment...
 
  I suspect that I simply have something not configured properly - but is
 it
  IIS 7.5, Bon Code, or Tomcat?
 
  After multiple attempts to resolve this I'm at a loss..
  your help appreciated...
  -
 
  Tomcat Server.xml (AJP connector):
  Connector URIEncoding=*UTF-8* enableLookups= *false* port=*8029*
  protocol=*AJP/1.3* redirectPort=*8443* /
  (added  tomcatAuthentication= *false*, scheme=https secure=true
   without making any difference)

 I do not have a real answer, but if you have come this far, maybe you
 want to try
 running Tomcat under debugger? See

 http://wiki.apache.org/tomcat/FAQ/Developing#Debugging

 The above configuration of a Connector selects either a BIO or an
 APR connector (depending on presence of tcnative-1.dll). Which
 connector implementation is actually used should be visible from
 startup logs.

 A place of interest for a breakpoint is
 org.apache.coyote.ajp.AbstractAjpProcessor#prepareRequest().
 Look for 'case Constants.SC_A_SSL_CERT' there.

 Another place is AbstractAjpProcessor#action(...), see
 ActionCode.REQ_SSL_ATTRIBUTE there.

 Best regards,
 Konstantin Kolinko

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




Re: request.getAttribute(javax.servlet.request.X509Certificate) returns NULL for AJP connector (possible Bon Code issue?)

2014-01-28 Thread John Palmer
Chris:
Thanks for the response.
I think we can end this discussion - you have pretty much nailed it, I
think.

The great thing about having to pull together all the information I've
gathered over that last month to make this post, is that it lets me see
what I've been too close to see, in this case, that the differences are IIS
5 vs 7.5 and Jakarta vs Bon Code.

I took another look at the request headers returned by Jakarta (no certs,
no SSL info, only about 5 request headers) as opposed to that returned by
Bon Code (about 2 dozen request headers, most ignored by Tomcat), to
realize that the request headers probably weren't the information source
from Jakarta.

Re-reading the Tomcat Connector docs and pages for the 1,000th or so time,
the phrase
SSL attributes of the client connection are passed via the AJP protocol
jumped out at me, finally, as meaning that this wasn't sent by request
headers, but as ATTRIBUTES.

Sure enough, reading through the source (NOT my strong point) of the
Jakarta Isapi Redirector 1.2.37 reveals that it IS putting the SSL info
into the request forwarded to the AJP connector (TomCat) as Attributes,
and by contrast, the Bon Code source is NOT.

I'll recommend/ask  that Bilal look into this (I'm not prepared to attempt
this myself, yet)... I may be all wrong still...
and try to use the Jakarta for now, instead.

 If it turns out that Bon Code is the problem, I believe that Bilal
 lurks on the list. I've added Bon Code to the subject to get his
 attention.

Thanks - I meant to do that, and forgot...


 Why not try configuring mod_jk ISAPI redirector in your new
 environment to see if Bon Code is the problem?

I will...

Thanks for the encouragement, and making me feel that I'm not alone in this.


On Tue, Jan 28, 2014 at 12:02 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 John,

 On 1/28/14, 12:41 PM, John Palmer wrote:
  We have two similar production environments which use:
  request.getAttribute(javax.servlet.request.X509Certificate) for
  several purposes.
 
  These use tomcat behind IIS using the Jakarta connector (aka
  reverse proxy) and have been running since 2006 and 2011
  respectively without significant issues ... other than perhaps
  insufficient memory (and sometimes IIS can't talk to Tomcat and
  everything has to be restarted, multiple times, to resolve).
 
  We're trying to upgrade/replace these servers with 64-bit Windows
  OS  due to memory constraints caused by the use of  32-bit OS, and
  these attributes (and related SSL attributes in Tomcat) are now
  returning NULL in our DEV environment
 
  Old environment: IIS 5.0 on WIndows Server 2003 SP2, Jakarta Isapi
  Redirector 1.2.37, TomCat 7.0.47
 
  (While researching how to set up Jakarta Isapi Redirector in IIS
  7.5 with a 64-bit Windows 2008 I saw multiple people reporting
  issues with poor performance, lockups etc, and decided we would try
  Bon Code instead.)
 
  New Environment IIS 7.5 on Win Server 2008 R2, Bon Code 1.0.17,
  TomCat 7.0.47
 
 
  IIS is configured with Client Cert Required; browser is being
  prompted for cert, and cert info is being sent to IIS.

 So, the old production setup uses mod_jk ISAPI redirector and it
 works. The new production setup uses Bon Code and doesn't work. I
 may have a suggestion as to the difference between setups, and a
 possible reason why this isn't working.

  According to Bon Code logs, request headers are being populated
  with plenty of information, including client cert and client issuer
  cert information.
 
  It looks like Tomcat is receiving these request headers, but is
  not populating the request attributes related to SSL and Cert
  information, but I can't see why in the logs, even after turning
  the logs to ALL and wading through the copious output.
 
  After looking through the Tomcat source multiple times, I don't see
  how the AJP connector can populate these request attributes at all
  - but it is in our current (32-bit OS) environment.

 It looks like it happens in AbstractAjpProcessor.action().

  - I understand that Tomcat is NOT doing
  the SSL connection itself - IIS is, just as Apache Web Server can
  be made to do, but my understanding is that Tomcat should be able
  to populate these attributes from information sent with the request
  throught the AJP connector (eg, in the Request Headers), That seems
  to be working wonderfully in our current environment.

 mod_jk does not use HTTP headers to send SSL information. Those data
 are sent using a different mechanism. Bon Code should be using the
 same mechanism.

  I suspect that I simply have something not configured properly -
  but is it IIS 7.5, Bon Code, or Tomcat?

 Why not try configuring mod_jk ISAPI redirector in your new
 environment to see if Bon Code is the problem?

 
  After multiple attempts to resolve this I'm at a loss.. your help
  appreciated...
  

Re: Clustering without Apache in the front

2014-01-28 Thread Howard W. Smith, Jr.
On Tue, Jan 28, 2014 at 8:59 PM, Neven Cvetkovic
neven.cvetko...@gmail.comwrote:

 On Tue, Jan 28, 2014 at 3:54 PM, Howard W. Smith, Jr. 
 smithh032...@gmail.com wrote:

   Thus I will probably never have to use clustering.
 
  Loving your responses on this topic, Chris. I do not want to hijack this
  thread, but i find this topic interesting, and your responses make it
 more
  interesting!
 
 
 +1. Great discussion, as always :)


  Honestly, I don't need clustering (yet) in my app, but I feel as though
  endusers of my app will be fine in a failover situation (as you described
  in this thread). Endusers of my app have to login a lot since I set
 session
  expired = 15 minutes. no complaints from the endusers, because they are
 in
  and out of the app...all day, (almost) every day.
 

 Ultimately, session stickiness works great to handle load balancing
 (workload management), but it is not enough for session failover. In the
 unlikely event that the serving tomcat instance dies, the user will be sent
 over to the other tomcat instance (that doesn't know anything about you,
 i.e. doesn't have your session data), and will probably need to login
 again. Now, as Chris pointed out - it would be great to design your app
 that it saves the intermediate work to a database or some secondary store
 that can be retrieved upon login again. Think shopping cart, you are
 shopping around, the instance goes down, you need to login again, and a
 nice application would persist shopping cart for you, not so nice
 application would not, so when logged in again - the shopping cart would be
 available or not :)


+1 (000,000,000,...)

wow, thanks Neven. That was a great thought/analogy right there. As someone
that uses amazon.com quite often, I do like the shopping cart feature, even
though I have not recognized if my shopping cart was saved across
sessions... oh, but you just jogged my memory, and a product that I looked
at recently, amazon.com sent that product (and similar products) to my
email... so evidently, 'interests' are persisted per user/session.

'not so nice application would not'... wow, i definitely accept that as
constructive criticism. thanks.


 Now, if your end users can live with that scenario - that's great - no need
 for session replication, clustering your instances, network chatter, etc...
 It definitely simplifies the configuration and setup.

 However, if your end users (i.e. your Service-Level-Agreement / SLA) do
 require a proper session failover, you will need some sort of session
 replication to successfully implement that feature. That's not trivial and
 depends on the appserver (e.g. Tomcat, JBoss, WebSphere, Weblogic). Session
 replication is not part of the official JEE/Servlet spec, but most modern
 and serious appservers would provide some way of replicating sessions and
 clustering appserver instances.


+1 definitely here for tomcat (a serious appserver). :)



 Now, if you could make you application stateless - you could possibly turn
 off the sticky sessions.  Makes things very easy to scale!


+1 thanks. even though my app is Java Server Faces app, I would say it is
quite stateless in nature/design, since users accomplish majority of their
daily tasks via one-page requests. of course,

1. one page is required to login
2. another/one page is required to search/filter/navigate-to target data
that already exists in the database
3. another/one page is required to add/update data, or to take some action
against that data (print data/form, email data/form to customer, etc...)

and this is normal user activity; some users let their session expire after
completing steps 1 and 2 above, or steps 1, 2, and 3 above.

In reference to the shopping cart suggestion, I would assume that you would
suggest that steps 2 and 3, above, are persisted, so users can resume
previous session.


 :))

 the only time I really need failover is when I 'might' want to update the
  app's software. the app is quite stable now and not many software changes
  right now, so again, there's not much of a need for failover. :)
 

 Excellent! Keep it simple!


+1 thanks; that's my goal...keep it simple (for the endusers). :)


 Good luck!
 Neven



Fwd: Tomcat 5 Repository

2014-01-28 Thread Pavneet singh Kochhar
Hello,

I searched the source code of Tomcat5 (git or svn repository) but could not
find it in the archives. Kindly let me know where I can get it. I need the
git or svn repository since I require the commit messages as well.

Thank you!

Regards,
Pavneet


RE: Tomcat 5 Repository

2014-01-28 Thread Caldarale, Charles R
 From: Pavneet singh Kochhar [mailto:kochha...@gmail.com] 
 Subject: Fwd: Tomcat 5 Repository

 I searched the source code of Tomcat5 (git or svn repository) but could not
 find it in the archives.

At least you've got the right mailing list this time.  No idea where you were 
looking, but the 5.0 and 5.5 are pretty obvious when you look in the places 
linked to from the Tomcat home page:
http://archive.apache.org/dist/tomcat/
http://svn.apache.org/repos/asf/tomcat/archive/

BTW, no one should be using Tomcat 5.0 or 5.5 anymore.

 - 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