Re: where to put jars used by several apps

2017-11-26 Thread Ray Holme
I see by your paths that you are an MS person. Your solution is clever but has 
the distribution problem that a war file may not be enough.
For Unix based folks (MAC, Linux), there is a much easier solution. Put your 
common jars in some directory that you like (for me /opt/web_jars/acquired). 
Then HARD link the jars to where you want them e.g.   ln 
/opt/web_jars/acquired/commons-logging-1.2.jar 
/opt/apache/webapps/application/WEB-INF/libThis does not solve the problem for 
a target machine running multiple applications, but it sure does solve the 
problem for a development machine with multiple applications and target 
machines running any one of them. War files work fine.
Your solution does have one major advantage - war fles are smaller.But if you 
change any of those jars, you need to distribute those changes and the war file 
does NOT do it.!
 

On Saturday, November 25, 2017 9:35 AM, "rich...@xentu.com" 
 wrote:
 

 I've written a few jersey webapps, and each has about 20 jar files 
included as Maven dependencies.

The inclusion of those jars increases the size of the resulting wars by 
a factor of over 100. Uploading a war via 'Tomcat Web Application 
Manager' takes several minutes, presumably due in part to the war size.

Given that these webapps require the same set of jars in their 
WEB-INF/lib/, I thought I could place them in say

C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\jersey

where all webapps could find them.

In catalina.properties, I appended this new directory to the 
common.loader list of paths:

common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,
 
${catalina.base}/lib/jersey/*.jar

Then, in each jersey webapp, I'd modify pom.xml to exclude those files 
from the war.


  maven-war-plugin
  3.2.0
  
    WEB-INF/lib/*.jar
  


This approach seems to work.

So, the question I'm seeking advise on is this:

If I have a collection of jars that I want to keep on Tomcat, for some 
but not all webapps, and those jars are not to be included in the wars, 
is this an acceptable technique? Or is it going to land me in trouble? 
Does the order of locations in common.loader matter?


Thanks for any advice
Richard

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



   

Re: Skip resource path in TLD scanner?

2017-11-17 Thread Ray Holme
I use JSP and there are taglibs used.But you can cut the scan time way down by 
not scanning any libraries that don't have TLDs (nested files with name => 
.tld)You can find this by using "jar t" or "unzip -l" on each library (thanks 
Chris).
If you are a Unix (Linux or MAC) user you may cheat a little by using the 
script attached.You may put any all .jar files in .../apache/lib or 
.../apache/webapps/*/WEB-INF/lib into the 
  .../apache/conf/catalina.properties file if they do not have taglibs.So 90% 
of what I need does not have taglibs (just jstl-impl-...jar DOES and must be 
left out of the DO NO SCAN line.This took my startup time from a couple minutes 
to under a second.
Best of luck.
 

On Friday, November 17, 2017 1:26 PM, Christopher Schultz 
 wrote:
 

 -BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Matt,

On 11/16/17 12:11 PM, Matt Cosentino wrote:
> This keeps getting worse, my site was down for over a minute while 
> the TLD scanner ran. There must be something I can do.
If you need taglibs, you'll need to do TLS scanning. There really is
no way to avoid that that I know of. One of many reasons I don't like
JSP as a technology.

If you are having a problem with downtime, you have other options that
might help in other areas. For example, you could set up a second
server and load-balance between the two of them. This protects you
from a number of downtime-causing issues such as power failures, JVM
crashes, and -- as in your example here -- planned maintenance.

Running a single instance of your application in a production
environment where uptime matters is really not an appropriate
solution. If you had two servers, your application's restart time
would not have been an issue.

- -chris

> -Original Message- From: Mark Thomas
> [mailto:ma...@apache.org] Sent: Saturday, April 29, 2017 5:02 AM 
> To: Tomcat Users List  Subject: Re: Skip
> resource path in TLD scanner?
> 
> On 28/04/17 17:00, Matt Cosentino wrote:
>> Yes, it's other folders within WEB-INF. I turned on the
>> TldScanner logging and it is definitely what is causing the
>> delay. My situation probably isn't very typical. The delay varies
>> in my various web applications, the worst being about 20 seconds.
>> It all adds up though, and every second counts when our sites are
>> down.
> 
> There is a solution available but it is intended more for the
> embedded use case rather than a standard Tomcat install. Using it
> in a standard install would require (effectively) patching Tomcat.
> 
> The general idea would be to use the TldPreScanned class. That does
> require all the TLDs to be listed in advance. On the plus side, no
> scanning delay. On the down side, adding TLDs requires code
> changes. Doing this with a standard Tomcat install requires changes
> to the JasperInitializer (hence the patch). I don't think there is
> a pure config way around that but I'll look into it.
> 
> A better solution would probably be to make it easier to plugin in
> a custom TLDScanner - i.e. purely with config. If you'd like us to
> explore this option we should re-open 61052 and adjust accordingly.
> I don't think there is enough demand for filtering resource paths
> to make that worth implementing.
> 
> One final thought. Are you running the web application from a WAR
> or an expanded directory? (The latter would be faster).
> 
> Mark
> 
> 
> 
>> 
>> - Matt
>> 
>> 
>> -Original Message- From: Mark Thomas
>> [mailto:ma...@apache.org] Sent: Friday, April 28, 2017 7:28 AM
>> To: Tomcat Users List  Subject: Re: Skip
>> resource path in TLD scanner?
>> 
>> On 27/04/17 23:39, Matt Cosentino wrote:
>>> https://tomcat.apache.org/tomcat-8.0-doc/config/systemprops.html
>>>
>>>
>>> 
There is one for skipping jar files:
>>> 
>>> tomcat.util.scan.StandardJarScanFilter.jarsToSkip
>> 
>> 
>> 
>>> It skips /WEB-INF/classes/ and /WEB-INF/lib/, but it does not
>>> check any property to skip user defined paths.
>> 
>> Is it other paths within WEB-INF you need to skip?
>> 
>> When I read "skipping resource paths" I was thinking of skipping
>> the various places where Tomcat treat directories as JARs that
>> then get scanned for TLDs (which can be configured via the
>> JarScanner). But it sounds like skipping those won't help you.
>> 
>> How sure are you that it is checking the directories below
>> WEB-INF that is the cause of the delay? That isn't a typical
>> source of start-up delay although it is certainly possible.
>> 
>> Finally, what sort of delay are we talking out here? Seconds? 
>> Minutes?
>> 
>> Mark
>> 
>> 
>>> -Original Message- From: Mark Thomas 
>>> [mailto:ma...@apache.org] Sent: Thursday, April 27, 2017 5:05
>>> PM To: Tomcat Users List  Subject: Re:
>>> Skip resource path in TLD scanner?
>>> 
>>> On 27/04/17 21:17, Matt Cosentino wrote:
 I need to skip some of the resource paths within WEB-INF. I
 know there's a 

Re: stopping scanning of TLDs

2017-11-10 Thread Ray Holme
Thanks for your help Chris. Here is my final script to do this right.
-/local/bin/tld_scan:#!/bin/bash -
#    find tldS -    Ray Holme 2017
#      embedded spaces in filenames wreak havoc

if [ $# -eq 0 ]; then
  echo " usage $0 list-of-jar-files"
  exit 1
fi

VERBOSE=0
LIST=
WORK=/tmp/$$.wrk

for i in $*
  do
    if [ "$i" = "-v" -o "$i" = "V" ]; then VERBOSE=1
    elif [ ! -f "$i" ]; then echo " $i not found"
    else
  echo $i | grep -i "\.jar$" > $WORK
  if [ -s $WORK ]; then LIST="$LIST $i"
  else echo " $i not a jar"
  fi  
    fi
  done

if [ "$LIST" = "" ]; then
  echo nothing to do
  exit 0
fi

for i in $LIST
 do
   unzip -l "$i" | grep -i "\.tld" > $WORK
   if [ -s $WORK ]; then echo " $i contains tlds"
   elif [ $VERBOSE -gt 0 ]; then echo " $i has no tlds"
   fi
 done

exit 0
 

On Thursday, November 9, 2017 11:19 AM, Christopher Schultz 
<ch...@christopherschultz.net> wrote:
 

 -BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Ray,

On 11/8/17 3:51 PM, Ray Holme wrote:
> this makes it easy in linux or mac land for i in *.jar; do echo
> scanning $i; jar tf $i | grep "\.tld"; sleep 1; done

I'd change that to:

$ for i in *.jar; do echo scanning $i; unzip -l "$i" | grep -i "\.tld"
; done

Changes:

1. Use unzip instead of jar. It's much faster.
2. Quote "$i", in case the filename contain (*shudder*) spaces
3. Use -i switch with grep, in case the filename happens to be TAGLIB.TL
D

- -chris

> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256
> 
> Ray,
> 
> On 11/8/17 11:24 AM, Ray Holme wrote:
>> In a prior post, I asked if there was a way to see if a jar uses
>> a tag library. Chris responded - look for ".tld" in the files.
> 
> To clarify, I was responding to a question as to whether a JAR
> file *contained* a tag library, not that it used one. Big
> difference.
> 
>> So I looked (turns out ecj.. has no ".tld": $ grep "tld" 
>> *.jarBinary file catalina-storeconfig.jar matches Binary file 
>> ecj-4.6.1.jar matches Binary file tomcat-util-scan.jar matches
> 
> I agree with Chris Cheshire: check the ZIP contents list and not a 
> binary check. Though the ZIP filenames are stored (mostly) in the 
> clear, it's possible that you might get unlucky. Also make sure
> you use a case-insensitive check.
> 
>> I am just trying to find a reliable way to see if there is TAG 
>> library.
> 
> Searching for .tld files ought to do it.
> 
> Have you found a case where this *didn't* work?
> 
> - -chris -BEGIN PGP SIGNATURE- Comment: GPGTools -
> http://gpgtools.org Comment: Using GnuPG with Thunderbird -
> http://www.enigmail.net/
> 
> iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAloDaJ0dHGNocmlzQGNo 
> cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFgcMQ/8Dv1fKlSVTjyznXD5 
> cYi2HPYt+enG2bMSzJICEhpQEHn6S0S1Veaf4pGfM1m27KPqvdghDgqGB/yoGt4P 
> 2YU6LF8xa7AHVIvx+TwFtwcyL58NcqpO6uFM1MsUiAa3VYGUTY63R1B4EkTeWHuB 
> HoEDDIi17hOBGivctsFjkBaNgCKpnN4SUpMg3b9f4SZHgI4DjFIm0AQGUsI5pstQ 
> NKHzc/QFYu4+qqtb+A41cawf0jpvBtk2mY6SGqPu930SNWGpy8C5iQnyEguBS9ts 
> ZJVx3uYHBUFDByv+Cjudu7oJ1ceFrGQWWT6IumzMRQwL4RqueKLSjW2nXGR2gYmb 
> tF23FlKIQ2jljn5YgKkMmfgkQ2MeAbTJcubJBdJBT2LrzAKxK+0Ms2HCjfGBo777 
> GeRJ5JPHku0h3sn5clnYwsGMP1lcut+353VuNJsHg9NyhltBm7ubHB2240vaEGFF 
> CxpNBa/VZuMRbu1Jp8OmCTO232sjHWY0b8ySESy0CQXYHx5S3/pCB8IoLfGV8VVh 
> VQChjyJcsUePa0qmioi6kmKPeluy9J63POXgiPk+UCKUgr3R0Ogc2Fu+sqE3CkqK 
> 0zf4Op/FALSfSqq67LTksy2oz4Ep1QC7CjKR2C/KG0nf6zaAPMVccmpqwccOuGWU 
> acEI1f6+9qXg6ZZQNneKsqr9Sfw= =kaCd -END PGP SIGNATURE-
> 
> -
>
> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 
> 
> 
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAloEgBQdHGNocmlzQGNo
cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFgsuw/+IE2s4l93jQcAMKcL
0bbQ3lqski6L6zgaq38odjPgyMvx1tWugGKRY8vDsBpGl2b/hFmm4R5V+D6i4lX+
kq6el8pqrvimx/o/R+81eZxQ/PgMFj8I1Gp900gnnEarO9QsrnbWZnV85+HN75OG
cAwvjpdL8KcCabiw8r3jxXTmfS3xCKW9F/RBj+nftwV1tT8V/tBqWl3WsryZBlER
xG+cpijACb51z0e3Lo6N2+S/kFHKPk7xBhh+IWp2lPdrBY2I6YbR53kwP9ZG76+g
qYB/LPawQjSFVBUoMgpg/HSitay9sgwOeUcHnNcZRsQqNvMuf+WOCRope/tnGV48
xqbHE4xRJV7m13glAgtDugWjNNqVw4zEpzoZHFnnXyy4zrZ5iYO38NiMf8Ni8rwU
6BS4gVAnEAHTF29j1iFsRTOxsqrxBdMXhlNyk+NThpY3GyZr1OHc2D3XXb5av0zM
3GOq8rmrNy7ck7T0BuoHQmkEfJWsv0R0INVYuysJd01dFl3aQ+JQ9BNhyhcnGR9f
EyN0R+yKjNnUUiCUDhGE7zBxcqK7mda/T1Qzb4o40efY6zYno7Er6W4Rf0e4Y4Tl
juPT/z+asZrGva4LvVYnFHH21OgyNF47S80CnL0RafqPJuN0/EFxOUjknU24afL2
cUY3WrObveDJ1n9lsfSCKlNE4Qg=
=mNz6
-END PGP SIGNATURE-

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



   

Re: stopping scanning of TLDs

2017-11-08 Thread Ray Holme
this makes it easy in linux or mac land
for i in *.jar; do echo scanning $i; jar tf $i | grep "\.tld"; sleep 1; done
 

On Wednesday, November 8, 2017 3:27 PM, Christopher Schultz 
<ch...@christopherschultz.net> wrote:
 

 -BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Ray,

On 11/8/17 11:24 AM, Ray Holme wrote:
> In a prior post, I asked if there was a way to see if a jar uses  a
> tag library. Chris responded - look for ".tld" in the files.

To clarify, I was responding to a question as to whether a JAR file
*contained* a tag library, not that it used one. Big difference.

> So I looked (turns out ecj.. has no ".tld": $ grep "tld"
> *.jarBinary file catalina-storeconfig.jar matches Binary file
> ecj-4.6.1.jar matches Binary file tomcat-util-scan.jar matches

I agree with Chris Cheshire: check the ZIP contents list and not a
binary check. Though the ZIP filenames are stored (mostly) in the
clear, it's possible that you might get unlucky. Also make sure you
use a case-insensitive check.

> I am just trying to find a reliable way to see if there is TAG
> library.

Searching for .tld files ought to do it.

Have you found a case where this *didn't* work?

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

iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAloDaJ0dHGNocmlzQGNo
cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFgcMQ/8Dv1fKlSVTjyznXD5
cYi2HPYt+enG2bMSzJICEhpQEHn6S0S1Veaf4pGfM1m27KPqvdghDgqGB/yoGt4P
2YU6LF8xa7AHVIvx+TwFtwcyL58NcqpO6uFM1MsUiAa3VYGUTY63R1B4EkTeWHuB
HoEDDIi17hOBGivctsFjkBaNgCKpnN4SUpMg3b9f4SZHgI4DjFIm0AQGUsI5pstQ
NKHzc/QFYu4+qqtb+A41cawf0jpvBtk2mY6SGqPu930SNWGpy8C5iQnyEguBS9ts
ZJVx3uYHBUFDByv+Cjudu7oJ1ceFrGQWWT6IumzMRQwL4RqueKLSjW2nXGR2gYmb
tF23FlKIQ2jljn5YgKkMmfgkQ2MeAbTJcubJBdJBT2LrzAKxK+0Ms2HCjfGBo777
GeRJ5JPHku0h3sn5clnYwsGMP1lcut+353VuNJsHg9NyhltBm7ubHB2240vaEGFF
CxpNBa/VZuMRbu1Jp8OmCTO232sjHWY0b8ySESy0CQXYHx5S3/pCB8IoLfGV8VVh
VQChjyJcsUePa0qmioi6kmKPeluy9J63POXgiPk+UCKUgr3R0Ogc2Fu+sqE3CkqK
0zf4Op/FALSfSqq67LTksy2oz4Ep1QC7CjKR2C/KG0nf6zaAPMVccmpqwccOuGWU
acEI1f6+9qXg6ZZQNneKsqr9Sfw=
=kaCd
-END PGP SIGNATURE-

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



   

Re: stopping scanning of TLDs

2017-11-08 Thread Ray Holme
In a prior post, I asked if there was a way to see if a jar uses  a tag library.
  Chris responded - look for ".tld" in the files.
So I looked (turns out ecj.. has no ".tld":
$ grep "tld" *.jarBinary file catalina-storeconfig.jar matches
Binary file ecj-4.6.1.jar matches
Binary file tomcat-util-scan.jar matches 
I am just trying to find a reliable way to see if there is TAG library.

On Wednesday, November 8, 2017 10:29 AM, Mark Thomas <ma...@apache.org> 
wrote:
 

 On 08/11/2017 12:59, Ray Holme wrote:



> The following three are interesting as they are in the tomcat distributed 
> list of NOT-TO_SCAN and have .tlds:  catalina-storeconfig.jar; ecj-4.6.1.jar; 
> tomcat-util-scan.jar

No, they don't. What led you to conclude that they did?

Mark


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



   

stopping scanning of TLDs

2017-11-08 Thread Ray Holme
Using Chris's algorithm, I searched for ".tld" in all jars used by both tomcat 
and my application extending it.
The following two were in my .../WEB-INF/lib directory and needed to NOT be in 
the list of NOT-TO_SCAN   i.e. ...  they need to be scanned:  
jasperreports-5.1.0.jar matches;  jstl-impl-1.2.jar matches
The following three are interesting as they are in the tomcat distributed list 
of NOT-TO_SCAN and have .tlds:  catalina-storeconfig.jar; ecj-4.6.1.jar; 
tomcat-util-scan.jar
The latter 3 are more interesting as I am surprised they are there (except for 
the last one :=]]] )


Re: taglibs

2017-11-07 Thread Ray Holme
OK, so I tried that and found one library needs to be excluded (from the 
exclusion list) - i.e. scanned
# ls jstl*; grep ".tld" jstl-*
jstl-api-1.2.jar  jstl-impl-1.2.jar
Binary file jstl-impl-1.2.jar matches

So if your rule works, I need jstl-impl to be scanned, but jstl-api could be 
excluded.
Nice! Thanks.
Ray
 

On Monday, November 6, 2017 10:54 AM, Mark H. Wood <mw...@iupui.edu> wrote:
 

 On Mon, Nov 06, 2017 at 10:13:42AM -0500, Christopher Schultz wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
> 
> Ray,
> 
> On 11/6/17 9:48 AM, Ray Holme wrote:
> > I am not the primary developer. I do Java and DB development. I
> > leave the JSP for someone else (I am mostly retired but I have
> > been doing this a LONG time).> But I deal with distributions and
> > builds so I was the one who modified the "not to SCAN"
> > libraries.2.5 minutes down to less than 1 second.
> Fast and broken is worse than slow and working. :)
> 
> > But I blew it with the jstl jars so I just wanted to know if there
> > is any way to find out if the jar is a taglib.
> So... generally speaking I would say "you should know your own
> libraries" but it shouldn't be hard to determine which libraries are
> taglibs. Simply look in each JAR file to see if there are any ".tld"
> files.

That's what I thought, too.  I looked, and the jstl-api JAR doesn't
contain any TLDs.  The corresponding jstl-impl JAR does, though.

-- 
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu

   

Re: taglibs

2017-11-06 Thread Ray Holme
Chris,
I am not the primary developer. I do Java and DB development.
I leave the JSP for someone else (I am mostly retired but I have been doing 
this a LONG time).
But I deal with distributions and builds so I was the one who modified the "not 
to SCAN" libraries.2.5 minutes down to less than 1 second.But I blew it with 
the jstl jars so I just wanted to know if there is any way to find out if the 
jar is a taglib.
I don't think we use Maven.


 

On Monday, November 6, 2017 9:05 AM, Christopher Schultz 
<ch...@christopherschultz.net> wrote:
 

 -BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Ray,

On 11/6/17 8:49 AM, Ray Holme wrote:
> So according to Mark, taglibs must NOT be listed in the
> catalina.properties file under
> tomcat.util.scan.StandardJarScanFilter.jarsToSkip Mark informed us
> that the below jstl... jars are both taglibs:  (jstl-api-1.2.jar &
> jstl-impl-1.2.jar)
> 
> Sooo - how do we determine if a jar we want to add is a taglib?

Umm... if you use a library, don't you know what it does?

Oh, maybe you are in Maven hell where you download the whole internet
in order to build/deploy your application. #sorrynotsorry

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

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAloAbC0ACgkQHPApP6U8
pFgSqBAAyz9yTAKGE2RSyZRUwW7wUcinYV7NwqQ+7E1kC7hy2E9tCyC9E+AGiTr7
GuJHUb+yJ4UP1vKjQ2SO+Cffmxbyz1PsfMOMhO6abDJQVOj3aHbIjUw70GlS5w+7
10l8Pe39fl+5GQQHLAye/XZgGv7dNVmITFmGAfonN+1gHi5L3Kio1VaYfn/7W+vx
KvYK7DbnmcdiANDBPS9g2/pdKlxYj4frA13QOEKnwStjWrSquEuXji4RsC2iYedl
+IyGq5IVVXZ1vGEBItfQverdZrqtbkDYu3UKiJ6rFkJiI6tf56ERE+lLQYbIsDbU
Mg2gV72PlQU/CUdqb5rqDjZLVk6FfKg18DysE0ywvRY0r7dsZugiED7y2438a9kJ
EHzbZdGyNmJbT1hW4p52wyrwR/AHgKriSRsupgw4xaVQfLAFOYEv0revg9fmPr1R
BoZWu2xoqVViUgnTV4TmV/zJsezogOstK6AEL03zTc1No+Jha+yzMTl0TE7efAf9
7ACHZ02XwtidSH33QwxpyoRafxjYMF5/D/3c0GJWlwTL8dc9zlnIFFyZclWv14Vw
DeNavGVyulP5aytl30VIS+wb2N1pUdMbeGCiD1jipomtITnKI9YjUsesj0Lu7c43
C/GRx5OLBCgM5bpTjFn2KR8Yd8D5TgUoE4KYDeONaopu2Tf1rPs=
=I6Qf
-END PGP SIGNATURE-

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



   

Re: second INVALID email

2017-11-06 Thread Ray Holme
Thanks Chris.
 

On Monday, November 6, 2017 9:27 AM, Mark Thomas <ma...@apache.org> wrote:
 

 On 06/11/17 13:55, Ray Holme wrote:
> Whenever I submit an email to this group, I get a second email back 
> immediately from the group (or maybe myself) with my full email address AND a 
> tacked on .INVALID
> i.e. the source is rayho...@yahoo.com.invalid
> Is this standard for everyone, or did something happen when the daemon 
> configured my email  or  ???

It is standard that when you post to a mailing list you received a copy
of your post since you are a subscriber.

The .INVALID is added by the ASF to avoid problems caused by your mail
provider's configuration that is incompatible with using mailing lists.
It is only done for subscribers sending from problematic domains.

Mark

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



   

second INVALID email

2017-11-06 Thread Ray Holme
Whenever I submit an email to this group, I get a second email back immediately 
from the group (or maybe myself) with my full email address AND a tacked on 
.INVALID
i.e. the source is rayho...@yahoo.com.invalid
Is this standard for everyone, or did something happen when the daemon 
configured my email  or  ???
Not a problem, just confusing.


taglibs

2017-11-06 Thread Ray Holme
So according to Mark, taglibs must NOT be listed in the catalina.properties 
file under  tomcat.util.scan.StandardJarScanFilter.jarsToSkip
Mark informed us that the below jstl... jars are both taglibs:   
(jstl-api-1.2.jar & jstl-impl-1.2.jar)

Sooo - how do we determine if a jar we want to add is a taglib?


Re: Peculiar problem (and solution) but WHY?

2017-11-06 Thread Ray Holme
Thanks for the clarification Mark. I feel better knowing why.
It also could have been that Linux worked as it was being re-brought up.i.e. 
when I do an application.war release, I clean out the Tomcat work directory.
The problem seems to be the "first" time.
 

On Monday, November 6, 2017 7:53 AM, Mark Thomas <ma...@apache.org> wrote:
 

 On 04/11/17 22:26, Ray Holme wrote:
> We have a working application running under tomcat 8.5.13
> I have been trying to reduce start up time and reduce TLD scanning which was 
> taking too long.
> By adding the jars in my .../WEB-INF/ lib to the NO scan line in the 
> catalina.properties file I got this under control ( a couple minutes went 
> down to 1 second or less).
> However two libraries I use and added NEEDED to be removed from the exclusion 
> list as they caused (on MAC not on Linux where the application worked fine - 
> 2nd weirdness) this problem:
> org.apache.jasper.JasperException: The absolute uri: 
> http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the 
> jar files deployed with this application
> The above problem caused a page to show as a white screen (it would not work).
> 
> i.e. THE JARS NEED TO BE SCANNED (at least by the MAC Tomcat)
> 
> These jars were: jstl-api-1.2.jar and jstl-impl-1.2.jar
> 
> Can anyone explain this? It makes no sense to me and I would feel better if 
> there was a reason.

Those are tag libraries. The tag libraries need to be registered in
order to work. That is what the TLD (tag library descriptor) scan does.
If that scan is disabled, the TLDs aren't registered and the tag library
won't work.

As for the Mac vs Linux behaviour, I suspect different configurations.

Mark

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



   

Peculiar problem (and solution) but WHY?

2017-11-04 Thread Ray Holme
We have a working application running under tomcat 8.5.13
I have been trying to reduce start up time and reduce TLD scanning which was 
taking too long.
By adding the jars in my .../WEB-INF/ lib to the NO scan line in the 
catalina.properties file I got this under control ( a couple minutes went down 
to 1 second or less).
However two libraries I use and added NEEDED to be removed from the exclusion 
list as they caused (on MAC not on Linux where the application worked fine - 
2nd weirdness) this problem:
org.apache.jasper.JasperException: The absolute uri: 
http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the 
jar files deployed with this application
The above problem caused a page to show as a white screen (it would not work).

i.e. THE JARS NEED TO BE SCANNED (at least by the MAC Tomcat)

These jars were: jstl-api-1.2.jar and jstl-impl-1.2.jar

Can anyone explain this? It makes no sense to me and I would feel better if 
there was a reason.


Re: configuring jarscanner in 8.5 to ignore entire directory

2017-11-01 Thread Ray Holme
Andre: cute!
As for jar scanning, I have been playing with that. I don't think you need full 
pathnames in the pattern (perhaps in the context file, but not in the 
properties file), but not sure.
I did two things and am very pleased with the result.
 a) in conf/context.xml:

   
b) in catalina.properties
   1) sorted the nasty list for TLD scans  that comes with the distribution (8) 
so I could read it and search
   and found one pattern that was off (cannot remember which one but it had 
and extra "_" before the "*", I think)   - it was a jar in the standard 
distribution .../lib/... dist.
   2) and then added all the jars I use at the end (no full path needed for 
sure)
The TLD startup time went from half a minute to under a second.
Good luck!
 

On Tuesday, October 31, 2017 4:44 PM, André Warnier (tomcat) 
 wrote:
 

 On 31.10.2017 20:16, Chris Cheshire wrote:
> PS JarScannerFilter above is a copypasta error, I do have the correct
> tag in my config with the same result
>
As, I presume, is the new Italian delicacy above ?



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



   

Re: TLD scanning performance question

2017-10-25 Thread Ray Holme
And haveged works GREAT! Thanks Markus.
 

On Wednesday, October 25, 2017 10:53 AM, "i...@flyingfischer.ch" 
 wrote:
 

 
>
> Yes, it's the SecureRandom initialization that is killing you. Being a
> virtual server, it likely has no direct source of true randomness so
> it needs to pull from whatever the hypervisor is willing to provide.
>
> You'll need to ask your virtualization vendor for how to get access to
> more entropy, or switch to a less-secure random source (e.g.
> /dev/urandom on *NIX-like systems).
>
Install haveged and your boot up problems will be gone.

Markus


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


   

TLD scanning performance question

2017-10-25 Thread Ray Holme
I asked this question before (differently) and got some answers but now I think 
I understand what is really happening.
I just want to confirm that I have finally understood what is happening.
Given two Linux boxes running the same application, one is much slower starting 
(think that  "slower" machine is actually a much faster box)
Here are some excerpts from the catalina.out log and my guesses as to what is 
happening.If someone knows why this is happening for sure, I would really 
appreciate knowing.
-
Both Linux machines run 8.5.13 Tomcat

log here - fedora 26 running real (not virtual)
Oct 25, 2017 8:38:20 AM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. 
application @ 10/25/2017 8:38:20 Thread:15 SecurityFilter.init : 

log server - Ubuntu running virtual (suspect machine much faster)
25-Oct-2017 08:43:34.283 INFO [localhost-startStop-1] 
org.apache.jasper.servlet.TldScanner.scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. ..
25-Oct-2017 08:45:00.151 INFO [localhost-startStop-1] 
org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of 
SecureRandom instance for session ID generation using [SHA1PRNG] took [85,739] 
milliseconds.
application @ 10/25/2017 8:45:00 Thread:15 SecurityFilter.init :


Both boxes have same list for jar scan skipping - includes all application jars 
used
  (had all tomcat jars already).Note that my machine use NO time to get on with 
it, but 1.5 minutes is used for the server.

I had an error in the scan skip lines and the time above was 10.5 minutes till 
I fixed it so I know CATALINA_HOME is right.
  (left off a comma in middle of list, so it scanned a lot of jars - :=[ ).

I suspect the performance problem has nothing to do with jar scanning but has 
to do with the real (and virtual)
server running with https not http for secure login (my development machine 
behind firewall with no external access)
- perhaps the SecureRandom is the thing that is making this slow.


Re: TLD startup issues

2017-10-24 Thread Ray Holme
Andre: Thanks and noted. Good article but does not help this problem.

Konstantin: Thanks for your notes. What is truly baffling is that I made 
changes to catalina.properties for "jarsToSkip"
  Before my recent changes, it took 10.5 minutes to get past the TLD scan   (I 
had a typo from before)  Then I corrected things and get 2.5 minutes on the 
Ubuntu server   (the same changes made me go down to 1 second on Fedora)
  So I know I am getting the right CATALINA_HOME (see no references to 
CATALINA_BASE or CATALINE_BASE).
  The only other difference is that the server is on a Virtual machine (Digital 
Ocean) and my development server is real.

  I will try what I can to see the variables you listed , but nothing makes 
sense.
Baffled (for quite a while) but still trying to find it.
 

On Monday, October 23, 2017 5:21 PM, Konstantin Kolinko 
<knst.koli...@gmail.com> wrote:
 

 2017-10-23 23:17 GMT+03:00 André Warnier (tomcat) <a...@ice-sa.com>:
> On 23.10.2017 21:30, Ray Holme wrote:
>>
>> I have two systems running Tomcat 8.5.13 on Linux
>>
>>    my development machine runs fully patched Fedora 26
>>
>>    the server I use is using Ubuntu 16.4.3
>>
>> Both have identical catalina.properties files as well as context.xml files
>>
>>    The context file has a one line addition towards the end before the end
>> of context with this line
>>
>>    
>>
>>    The properties file has ALL the jar files to be found in my application
>> added to the
>>
>>    list of StandardJars
>>
>> My development machine spends 1 second or less on the TLD warning before
>> the next line in the log comes up.
>>
>> The server spends 150 seconds (good day, yesterday it was 10.5 minutes).
>>
>> What can I do to speed up the startup?
>>
> Did you read this ?
> https://wiki.apache.org/tomcat/HowTo/FasterStartUp

+1

Also, take several (3) thread dumps to see what code is actually being executed.
https://wiki.apache.org/tomcat/FAQ/Troubleshooting_and_Diagnostics#Common_Troubleshooting_Scenario

Is Ubuntu installed manually from official Tomcat binaries provided by ASF?
https://wiki.apache.org/tomcat/FAQ/Linux_Unix#Q5

It may be that the configuration that you edited is not the one that
is actually being used.

Tomcat can be run with CATALINE_BASE != CATALINA_HOME,  and some OS
vendors place Tomcat configuration files into a different place.

Print the values of system properties
catalina.home
catalina.base
tomcat.util.scan.StandardJarScanFilter.jarsToSkip
tomcat.util.scan.StandardJarScanFilter.jarsToScan
(e.g. by writing a simple JSP file that displays the values)

Best regards,
Konstantin Kolinko

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


   

TLD startup issues

2017-10-23 Thread Ray Holme
I have two systems running Tomcat 8.5.13 on Linux

   my development machine runs fully patched Fedora 26

   the server I use is using Ubuntu 16.4.3

Both have identical catalina.properties files as well as context.xml files

  The context file has a one line addition towards the end before the end of 
context with this line

  

  The properties file has ALL the jar files to be found in my application added 
to the

  list of StandardJars

My development machine spends 1 second or less on the TLD warning before the 
next line in the log comes up.

The server spends 150 seconds (good day, yesterday it was 10.5 minutes).

What can I do to speed up the startup?


Re: systemd tomcat script for Linux EL7

2015-06-05 Thread Ray Holme
That looks OK, but I would suggest the following.
Put all the real stuff in a standard bash script with 3 parameters   start, 
stop, restart- pretty much like the OLD system 5 way fo doing things.This has 
the advantage of allowing you to add other things you might want to add AND 
executing the script as root is pretty obvious. (I needed to add starting an 
LibreOffice server and a few other daemons to get that going). Embed the 
catalina start stop in that script.The just make the systemd script VERY SIMPLY 
call your standard above start/stop script.
e.g. my script name is S95tomcat and the systemd entry is trivial.
here is tomcat.service:

[Unit]
Description=The Jakarta Apache/Tomcat Server
After=network.target

[Service]
Type=forking
ExecStart=/local/bin/S95tomcat start
ExecReload=/local/bin/S95tomcat restart
ExecStop=/local/bin/S95tomcat stop

[Install]
WantedBy=multi-user.target
 


 On Thursday, June 4, 2015 9:31 PM, Dale Ogilvie dale_ogil...@trimble.com 
wrote:
   

 Hi all,

I am trying to put together a systemd script for an install of the current 
binary release tomcat7. Follows my current best effort, cobbled together from 
the (RH)EL7 packaged version and some googling... I am trying to use the 
unadulterated tomcat up/down scripts from the binary release.

Any suggestions as to how this might be improved? I'm not sure if I am using 
the right service type here, based on what catalina.sh is doing under the hood. 
That said, it seems to work.

Thanks

Dale

 follows apache-tomcat.service

# Systemd unit file for apache-tomcat
#

[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target

[Service]
Type=forking
PIDFile=/var/run/apache-tomcat/apache-tomcat.pid
ExecStart=/opt/apache-tomcat/bin/startup.sh
ExecStop=/opt/apache-tomcat/bin/shutdown.sh
SuccessExitStatus=0
User=apache-tomcat
Group=apache-tomcat


[Install]
WantedBy=multi-user.target

* follows setenv.sh commented out sections removed

# Where your java installation lives
JAVA_HOME=/usr/java/latest

# Where your tomcat installation lives
CATALINA_BASE=/opt/apache-tomcat
CATALINA_HOME=/opt/apache-tomcat
CATALINA_OUT=/var/log/apache-tomcat/catalina.out
JASPER_HOME=/opt/apache-tomcat
CATALINA_TMPDIR=/opt/apache-tomcat/temp

CATALINA_OPTS=-Xms1G -Xmx2G

# What user should run tomcat
TOMCAT_USER=apache-tomcat

# Run tomcat under the Java Security Manager
SECURITY_MANAGER=false

# Time to wait in seconds, before killing process
SHUTDOWN_WAIT=90

# Whether to annoy the user with attempting to shut down messages or not
SHUTDOWN_VERBOSE=false

# Set the TOMCAT_PID location
CATALINA_PID=/var/run/apache-tomcat/apache-tomcat.pid

# Connector port is 8080 for this tomcat instance
CONNECTOR_PORT=8080


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



  

Re: [OT] jar files - where - please explain

2015-06-04 Thread Ray Holme
 For instance, most UNIX filesystems have symlinks and
 case-sensitive filesystems, and these checks would not be
 necessary. Plus, users in those environments are quite used to
 using symlinks in place of real files.
 

Using Unix and Linux for a LONG time, love symlinks as they work across file 
systems and oh so much more. Windows users rarely use symbolic links, and 
have a
 case-sensitive filesystem, and these checks are certainly
 necessary. Prohibiting symbolic linking (by default) in this
 environment is probably okay.
I may be off base here, but IMHO Windoze does not support symbolic links, or 
fork or ...It is more like a partial Unix (was built on the idea, but not fully 
formed).
 
 Mac OS X is a bit odd in that it's got all of the great things
 about a traditional UNIX filesystem except that it's got a better
 chance of being case-insensitive because HFS+ allows both
 semantics, but the default is unfortunately case-insensitive. In
 this environment, it's probably okay to prevent symbolic links
 unless he user forces them back on.
 
Not a big user of OSX - not aware it supported case-insensitive. When I used it 
I treated it like Unix with case sensitive files and had NO problems.
 The obvious way to check for case-sensitivity would be to create
 a file in the work directory with a certain name in mixed-case
 like TestFile.txt and then try to open it with an all-lowercase
 name (textfile.txt) and see if it exists. Then, we could enable
 or disable this kind of checking.
Sounds like the right approach.
 



 On Thursday, June 4, 2015 12:32 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:
   

 -BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

On 6/4/15 3:15 AM, Mark Thomas wrote:
 On 03/06/2015 21:57, Christopher Schultz wrote:
 Mark,
 
 On 6/3/15 3:53 PM, Mark Thomas wrote:
 On 03/06/2015 20:48, Christopher Schultz wrote:
 
 snip/
 
 I don't understand the underlying reasons why Tomcat treats 
 symlinks specially...
 
 snip/
 
 It is to do with case sensitivity on non case sensitive file 
 systems. The check we have to add on Windows to stop things
 like JSP source disclosure by requesting /index.Jsp also
 blocks symlinks.
 
 Removing that check (and hence enabling symlinks) is safe on a 
 case sensitive file system and unsafe on a non-case sensitive
 file system.
 
 Is that protection require something that can be detected by
 software, and then only applied when necessary?
 
 In theory, yes.
 
 In practise, given the security sensitivity of this I'd be very,
 very cautious about changing it.

Agreed. There is probably some edge-case I'm not considering.

...but it *would* be nice to let symlinks work :)

 For instance, most UNIX filesystems have symlinks and
 case-sensitive filesystems, and these checks would not be
 necessary. Plus, users in those environments are quite used to
 using symlinks in place of real files.
 
 Windows users rarely use symbolic links, and have a
 case-sensitive filesystem, and these checks are certainly
 necessary. Prohibiting symbolic linking (by default) in this
 environment is probably okay.
 
 Mac OS X is a bit odd in that it's got all of the great things
 about a traditional UNIX filesystem except that it's got a better
 chance of being case-insensitive because HFS+ allows both
 semantics, but the default is unfortunately case-insensitive. In
 this environment, it's probably okay to prevent symbolic links
 unless he user forces them back on.
 
 The obvious way to check for case-sensitivity would be to create
 a file in the work directory with a certain name in mixed-case
 like TestFile.txt and then try to open it with an all-lowercase
 name (textfile.txt) and see if it exists. Then, we could enable
 or disable this kind of checking.
 
 Does anyone have any comments about something like that?
 
 We probably have a lot of places where we resolve filenames but
 I'm guessing we don't have a single utility method to do the
 work;
 
 Wrong :)
 
 probably just new File(new File(file).getCanonicalPath()) or
 something like that wherever it's needed. If we unified all those
 accesses in a single place, it would be easy to change these
 semantics for different environments.
 
 http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/web
resources/AbstractFileResourceSet.java?view=annotate#l54

Nice
 
work.

So the code in there uses canonical paths, and when you canonicalize a
symlink, you end up with the location of the real file, not the
symlink, and everything goes boom at that point. Is my understanding
correct?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVcH1nAAoJEBzwKT+lPKRYML8QAJJUxzgzTdrkvXHAF2W/OqKs
yuca0UF0tGU72iPptVAF7Rsja1X+Bfi8V0SU7LWLtIP9VKaDTj1Vt2DNrCbArDPB
lRMZlWNYBA/L/1HHh1wzk4CE1O5BcFQMUyKuzlvHFOhoN7LqSsiJoAPQLqrtM0rc
0VVtX51PBaB6QWzwwjTOUyJHto3CinPShekOhEUanSoSU5TO7wcpaqEwYK0YCZQx
ATy0g7bg07RAfBzhZpgGmFzKDhIesNfD7RcCYYnktSr0LXIr8Onio+IQeyFjInGH

Re: [OT] jar files - where - please explain

2015-06-04 Thread Ray Holme
Inside the WAR or having the WAR as a symlnk?
OK, I did a test and YES inside a WAR file  
${CATALINA_HOME}/webapps/Application/WEB-INF/lib/*.jarfiles ARE expanded if 
they are symbolic links to real files. (My bad for not testing before).Now I am 
really in trouble. I have an application which has a  
${CATALINA_HOME}/webapps/Application/photosdirectory which is a symbolic link 
with the following line in the 
${CATALINA_HOME}/conf/Catalina/localhost/Application.xmlfile: 
aliases=/photos=/opt/web_bigDirs/Applicationi_photos - I NEVER wanted this 
link expanded!!!The idea is to have multiple deployment places (hoping someday 
when testing done), each having their own photos on file and never deploy my 
own test photos. I was assuming this would work. I tested and double DARN, jar 
cf expands the link pulling in all the sub files - this totally frustrates my 
intention. I wanted a symbolic link there for Unix based machines and just an 
empty directory for Microsoft OS(s). Perhaps if I remove my symbolic link the 
aliases parameter will work anyway. I will have to try that when I get a 
chance.  I certainly don't want to distribute the contents of this directory 
in a war file (it could be HUGE).
 


 On Thursday, June 4, 2015 3:15 AM, Mark Thomas ma...@apache.org wrote:
   

 On 03/06/2015 21:57, Christopher Schultz wrote:
 Mark,
 
 On 6/3/15 3:53 PM, Mark Thomas wrote:
 On 03/06/2015 20:48, Christopher Schultz wrote:
 
 snip/
 
 I don't understand the underlying reasons why Tomcat treats
 symlinks specially...
 
 snip/
 
 It is to do with case sensitivity on non case sensitive file
 systems. The check we have to add on Windows to stop things like
 JSP source disclosure by requesting /index.Jsp also blocks
 symlinks.
 
 Removing that check (and hence enabling symlinks) is safe on a
 case sensitive file system and unsafe on a non-case sensitive file
 system.
 
 Is that protection require something that can be detected by software,
 and then only applied when necessary?

In theory, yes.

In practise, given the security sensitivity of this I'd be very, very
cautious about changing it.

 For instance, most UNIX filesystems have symlinks and case-sensitive
 filesystems, and these checks would not be necessary. Plus, users in
 those environments are quite used to using symlinks in place of real
 files.
 
 Windows users rarely use symbolic links, and have a case-sensitive
 filesystem, and these checks are certainly necessary. Prohibiting
 symbolic linking (by default) in this environment is probably okay.
 
 Mac OS X is a bit odd in that it's got all of the great things about a
 traditional UNIX filesystem except that it's got a better chance of
 being case-insensitive because HFS+ allows both semantics, but the
 default is unfortunately case-insensitive. In this environment, it's
 probably okay to prevent symbolic links unless he user forces them
 back on.
 
 The obvious way to check for case-sensitivity would be to create a
 file in the work directory with a certain name in mixed-case like
 TestFile.txt and then try to open it with an all-lowercase name
 (textfile.txt) and see if it exists. Then, we could enable or
 disable this kind of checking.
 
 Does anyone have any comments about something like that?
 
 We probably have a lot of places where we resolve filenames but I'm
 guessing we don't have a single utility method to do the work;

Wrong :)

 probably just new File(new File(file).getCanonicalPath()) or something
 like that wherever it's needed. If we unified all those accesses in a
 single place, it would be easy to change these semantics for different
 environments.

http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/AbstractFileResourceSet.java?view=annotate#l54

Mark

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



  

Re: jar files - where - please explain

2015-06-03 Thread Ray Holme
Really? Tomcat 6.0 replaced the server/lib/, shared/lib/, and
common/lib/ directories in favor of a single, unified lib/ directory.
That doesn't strike you as an important change?
Again, you are right. Single is much better, but I still only needed one link 
for the SQL jar and moving that to lib from shared made little difference to me 
conceptually.

I'm curious as to why you are using hard links instead of symlinks. If
you copy a new file over a hard link, you un-couple it from the rest
of the series of hard links. If you do the same with symlinks, the
result is probably more what you were expecting. There are other
disadvantages with hard links including not really knowing that it's a
link (symlinks are obvious) and they can't span across filesystems.
Again correct, but for a while tomcat did not allow me to have symbolic links 
(or I did not know about the way to overcome that in the xml file). In any 
case, I solved the problem with a shell script that makes sure the hard links 
are correct AFTER a complete compilation set is done. The other problem (which 
may or may not be a problem - I have not tried in a while) is making a WAR 
file. I cannot have symbolic links then. The target machine running the 
application just gets the WAR file and NOT the directory containing the 
assorted jars. But perhaps I should re-explore that one.
And by the way, you can edit the hard link file AND all versions change. You 
can also cat file and all hard links remain. It is ONLY when you move a file 
over one of the links that the hard links are unlinked. Curious!
  


 On Wednesday, June 3, 2015 8:47 AM, Christopher Schultz 
ch...@christopherschultz.net wrote:
   

 -BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Ray,

On 6/2/15 6:42 PM, Ray Holme wrote:
 I have not seen changes to the lib structures for any of the tomcat
  releases I have used and that spans back 5 years or more (well OK,
 at one point symbolic links worked, now they don't unless I change
 the xml file).

Really? Tomcat 6.0 replaced the server/lib/, shared/lib/, and
common/lib/ directories in favor of a single, unified lib/ directory.
That doesn't strike you as an important change?

 Thanks for the answer. I would have moved the jaybird thing only
 so WAR files included it, but it sounds like a bad idea if
 clobbers connection pools - thought there was ONE pool per
 application.

There is a chicken-and-egg problem with the context ClassLoader which
makes it difficult for the container to set up the context using Java
classes that are hosted from within that application. Anything the
driver depends upon also needs to be available to the container's
ClassLoader.

 Agreed to leave all else as is, the hard link solution solves the 
 problem of multiple copies nicely. Just cannot do that in
 Microsoft land, but that is OK as all Microsoft versions I support
 only have one application running.

I'm curious as to why you are using hard links instead of symlinks. If
you copy a new file over a hard link, you un-couple it from the rest
of the series of hard links. If you do the same with symlinks, the
result is probably more what you were expecting. There are other
disadvantages with hard links including not really knowing that it's a
link (symlinks are obvious) and they can't span across filesystems.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVbvd8AAoJEBzwKT+lPKRYgLEQAKST0dzmy9f7esRk8SvAxtjY
2nqc+SIRe32hdO9C0iIUY+pOTgDHKvi+PEXV7FCC6CXRRKhjZrB19iHMJaz3jZPY
RElw58YAuI1pLMVXV6qMnJ4PmIHbwu5Uy1fDs0XBlNA8nZe7rxbnS6snYu3MqjPt
WP5udl9DCB5SBkl99nHbH5At1qkOfOmhBycfvCIqDZlkA9QxA+HFh/Rq+enJryMK
lH0lO1JbmdY6fRrOA4cppkyp79qpUpBA5hEMsyrrvDF34wENFLjPeZKD8Rz+X6v6
C+MRB04z8GapYpasl+KemnPaW2oLosaCjulMjHVIWCP4KxTKGveAC+cEyCwnuTRW
MXZyVhp/uycHf/WgPMITyBtkj+vIt/U5kalX87hDzxaEq3yHAaa7Yqkdwqi9W1AZ
3XttVcz33vmTnRKykSNPK4IEPuhGtjNup6qOdIP9P0onJOk6gZ3KY7SL0T7Y8jJA
lIU4Exmjv8ZC5tgDenVexehtCGVjqZJiOFNGEkW3W1Jzn7QhTZhKbYB7POxB9WFq
Z0n5nxGppvzhGXf54nFqpSHEn4XxCmeVCLBIheRw0AseUW0X7qVZ+F4NVl+6Llwo
wHnd1NlRO4X9AA/GylVDb5N017SFHtJ/53M2roUK8itV8aECU4xVKguTndykUnYR
8ucTDAUSB+LeOEbDUmaJ
=Hq/T
-END PGP SIGNATURE-

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



  

Re: jar files - where - please explain

2015-06-02 Thread Ray Holme
Humble apologies, I have not seen changes to the lib structures for any of the 
tomcat releases I have used and that spans back 5 years or more     (well OK, 
at one point symbolic links worked, now they don't unless I change the xml 
file).
Thanks for the answer. I would have moved the jaybird thing only so WAR files 
included it, but it sounds like a bad idea if clobbers connection pools - 
thought there was ONE pool per application.
Agreed to leave all else as is, the hard link solution solves the problem of 
multiple copies nicely. Just cannot do that in Microsoft land, but that is OK 
as all Microsoft versions I support only have one application running.
Many thanks - I understand better why things are as they are.
:=] 


 On Tuesday, June 2, 2015 10:10 AM, Mark Thomas ma...@apache.org wrote:
   

 On 02/06/2015 14:52, David kerber wrote:
 On 6/2/2015 9:11 AM, Ray Holme wrote:
 Currently using apache-tomcat-7.0.35. Not sure that matters as no
 behavior has changed in prior releases.

That kind of response when asked for further information - especially
when the information is as basic as which Tomcat version is being used
(you failed to give any indication of the Tomcat version you are using
and we see questions from folks using Tomcat 3 all the way up to the
unreleased Tomcat 9) - is very frustrating for those of us trying to
help and does nothing to encourage us to continue to help.

 It does matter, because the directory layouts have changed in the
 various major versions.

It also matters since later versions of Tomcat are more relaxed about
where they will load JDBC drivers from.


      On Tuesday, June 2, 2015 8:56 AM, Mark Thomas ma...@apache.org
 wrote:


  On 02/06/2015 12:42, Ray Holme wrote:
 I have been using tomcat for a while and have several applications.
 Some jar files are specific to an application and make sense to be in
 .../webapps/APPLICATION/WEB-INF/lib and some are used in multiple
 applications so they need to appear in each applications lib. One
 shared jar file is my own common code, but then there are many things
 that are pulled from the net (e.g. mail.jar). In addition I put one
 jar file in the top tomcate ../lib directory as it is used by
 everything for DB access (jaybird...jar in my case.
 Since I use Linux, ALL of these extra jar files are maintained
 somewhere else (same linux file system required) and I hard link them
 to the above named places so I don't need multiple copies and one
 update serves all (with a web restart, natch).
 So, here are my questions: 1) Is there any reason why the SQL library
 (jaybird above) needs to be in the .../lib (top tomcat directory) or
 could it be in the WEB-INF/lib directory too?

Yes. It needs to be in $CATALINA_BASE/lib so it is visible to the
connection pool implementation.

Putting another copy in WEB-INF/lib is theoretically safe (it should be
a NO-OP) but can often trigger class loading issues (if the app refers
to any of the classes in the JAR directly).

See the Tomcat 8 migration guide for how this changes in 8.0.x.

 If the latter is OK,
 then it becomes part of the WAR file when I distribute and thus saves
 an extra step when this jar updates. Also, by putting it (logically)
 there in the application lib(s), it evokes more security if I
 understand the purpose of doing this (see next question).
 2) Could I also put my own common jar file in the top tomcat .../lib
 directory? I am confident that it does NOT have insecure code so
 logic says it could be there, but having it in the WAR file might be
 a better option anyway as I do add things to it. In other words, if I
 were confident in the source for say mail.jar and knew it was secure,
 it too could be in the top directory (with the caveat that it no
 longer is in the WAR file).

Yes you can put your own JARs in $CATALINA_BASE/lib but beware of issues
with singletons, caches etc. The downside is that it makes it impossible
to use different versions of your JAR with different web applications
(unless you put the classes in different packages) which typically
forces you to upgrade all your applications at the same time.

 Question 1 would be useful as it makes distributions more easy and
 totally effective if all can be in the WAR file. Question 2 is just
 for me to understand better how tomcat works - I don't think I want
 to move the application jars to the tomcat lib.
 Many thanks for improving my understanding.

Personally, I'd would:
- aim to keep my web applications dependencies to a minimum
- package all the dependencies in WEB-INF/lib

Mark


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



  

jar files - where - please explain

2015-06-02 Thread Ray Holme
I have been using tomcat for a while and have several applications. Some jar 
files are specific to an application and make sense to be in 
.../webapps/APPLICATION/WEB-INF/lib and some are used in multiple applications 
so they need to appear in each applications lib. One shared jar file is my own 
common code, but then there are many things that are pulled from the net (e.g. 
mail.jar). In addition I put one jar file in the top tomcate ../lib directory 
as it is used by everything for DB access (jaybird...jar in my case.
Since I use Linux, ALL of these extra jar files are maintained somewhere else 
(same linux file system required) and I hard link them to the above named 
places so I don't need multiple copies and one update serves all (with a web 
restart, natch).
So, here are my questions: 1) Is there any reason why the SQL library (jaybird 
above) needs to be in the .../lib (top tomcat directory) or could it be in the 
WEB-INF/lib directory too? If the latter is OK, then it becomes part of the WAR 
file when I distribute and thus saves an extra step when this jar updates. 
Also, by putting it (logically) there in the application lib(s), it evokes more 
security if I understand the purpose of doing this (see next question).
2) Could I also put my own common jar file in the top tomcat .../lib directory? 
I am confident that it does NOT have insecure code so logic says it could be 
there, but having it in the WAR file might be a better option anyway as I do 
add things to it. In other words, if I were confident in the source for say 
mail.jar and knew it was secure, it too could be in the top directory (with the 
caveat that it no longer is in the WAR file).
Question 1 would be useful as it makes distributions more easy and totally 
effective if all can be in the WAR file. Question 2 is just for me to 
understand better how tomcat works - I don't think I want to move the 
application jars to the tomcat lib.
Many thanks for improving my understanding.


Re: jar files - where - please explain

2015-06-02 Thread Ray Holme
Currently using apache-tomcat-7.0.35. Not sure that matters as no behavior has 
changed in prior releases.
 


 On Tuesday, June 2, 2015 8:56 AM, Mark Thomas ma...@apache.org wrote:
   

 On 02/06/2015 12:42, Ray Holme wrote:
 I have been using tomcat for a while and have several applications. Some jar 
 files are specific to an application and make sense to be in 
 .../webapps/APPLICATION/WEB-INF/lib and some are used in multiple 
 applications so they need to appear in each applications lib. One shared jar 
 file is my own common code, but then there are many things that are pulled 
 from the net (e.g. mail.jar). In addition I put one jar file in the top 
 tomcate ../lib directory as it is used by everything for DB access 
 (jaybird...jar in my case.
 Since I use Linux, ALL of these extra jar files are maintained somewhere else 
 (same linux file system required) and I hard link them to the above named 
 places so I don't need multiple copies and one update serves all (with a web 
 restart, natch).
 So, here are my questions: 1) Is there any reason why the SQL library 
 (jaybird above) needs to be in the .../lib (top tomcat directory) or could it 
 be in the WEB-INF/lib directory too? If the latter is OK, then it becomes 
 part of the WAR file when I distribute and thus saves an extra step when this 
 jar updates. Also, by putting it (logically) there in the application lib(s), 
 it evokes more security if I understand the purpose of doing this (see next 
 question).
 2) Could I also put my own common jar file in the top tomcat .../lib 
 directory? I am confident that it does NOT have insecure code so logic says 
 it could be there, but having it in the WAR file might be a better option 
 anyway as I do add things to it. In other words, if I were confident in the 
 source for say mail.jar and knew it was secure, it too could be in the top 
 directory (with the caveat that it no longer is in the WAR file).
 Question 1 would be useful as it makes distributions more easy and totally 
 effective if all can be in the WAR file. Question 2 is just for me to 
 understand better how tomcat works - I don't think I want to move the 
 application jars to the tomcat lib.
 Many thanks for improving my understanding.
 

Tomcat version?

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



   

information: fedora/firefox/tomcat brain melt

2014-01-24 Thread Ray Holme
I run fedora and use firefox. I also update my system weekly using yum.

Recently I was testing something (directory linking) on my own local web using 
tomcat and one application.

I kept getting a total white screen with a particular test popup (using any of 
the 3 linking style and then even normal directories with NO linking).

I tried the same application on another server using my local browser and got 
the same result. So I tried another machine with another browser and found NO 
problems - both my server or the other one did things right. Checking my 
version of firefox against that box, I discovered I was running v-25 versus it 
had v-26. I actually was fully up to date but had not brought up the new 
version of firefox after a system update (no warning was given to do so and no 
OS update so no reboot requirement was obvious). I killed firefox and tried to 
restart, but a reboot was required (firefox said it was still running - ??? - 
and yea a kill -9 probably would have fixed that, but reboot is what I did). 
Anyway, after rebooting, ALL WORKED again - the blank white screens are gone.

Apparently firefox was keeping something somewhere that made it fail with 
apache tomcat requests under certain conditions. The version running was 
confused as the next version was actually installed. This took me a couple days 
to find as I was not looking in the right places. I am just posting this in 
case anyone else has a similar problem.


Re: [OT] Out of memory exception - top posting

2014-01-24 Thread Ray Holme





On Friday, January 24, 2014 9:46 AM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:
 
 From: cjder...@gmail.com [mailto:cjder...@gmail.com]
 On Behalf Of chris derham
 Subject: Re: [OT] Out of memory exception - top posting

 As long as you can visually distinguish the reply from the original,
 does it really matter if that reply is above or below the original?

Always bottom-posting is pretty much as useless and lazy as always top-posting. 
 Many, possibly most, of the messages on this list contain multiple points 
which need to be answered individually.  Neither top- nor bottom-posting works 
for these; inline responses are required to make sense of the answers.

 MY REPLY: In this case, the reply seemed to make sense there, BUT if it makes 
you happier I will just slap myself again.
I get it.

 When people reply to a thread, as long as their email client indents,
 you have that clear visual indication.

Except for the few people who like to indent their responses, turning 
everything into gibberish.

 MY REPLY:  Agreed. And by the way - it appears that yahoo is not properly 
indenting this or my above reply as it ought to. It seems like kind of overkill 
for me to go and do it for the mailer - but I did it so you can see. So not 
sure what I will do in the future.

- Ray



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

Re: Out of memory exception

2014-01-23 Thread Ray Holme
Doing anything as root conceals the errors. Tomcat is no exception and changing 
it to a real user makes your testing complete.





On Thursday, January 23, 2014 12:36 PM, Daniel Mikusa dmik...@gopivotal.com 
wrote:
 
On Jan 23, 2014, at 11:38 AM, Randeep randeep...@gmail.com wrote:

 Hi all,
 Thanks a lot for valuable points. Here the information you guys asked and
 the changes I made.
 
 OS : CentOS release 5.4 (Final)
 httpd-2.2.3-65.el5.centos(front_end) +(mod_jk)+ apache-tomcat-6.0.37
 
 I installed httpd using yum.
 Downloaded tomcat from Apache as compressed archive(tar.gz)
 
 I'm using following startup script.
 [root@server ~]# cat /etc/init.d/tomcat6
 #!/bin/bash
 # description: Tomcat Start Stop Restart
 # processname: tomcat
 # chkconfig: 234 20 80
 JAVA_HOME=/usr/java/default
 export JAVA_HOME
 PATH=$JAVA_HOME/bin:$PATH
 export PATH
 CATALINA_HOME=/usr/share/apache-tomcat-6.0.37
 case $1 in
 start)
 sh $CATALINA_HOME/bin/startup.sh
 ;;
 stop)
 sh $CATALINA_HOME/bin/shutdown.sh
 ;;
 restart)
 sh $CATALINA_HOME/bin/shutdown.sh
 sh $CATALINA_HOME/bin/startup.sh
 ;;
 esac
 exit 0
 
 As you said, I removed the JAVA_OPTS declaration from .bash_profile and I
 have created setenv.sh and set JAVA_OPTS in it.
 [root@server bin]# pwd
 /usr/share/apache-tomcat-6.0.37/bin
 
 [root@server bin]# cat setenv.sh
 export JAVA_OPTS='-Xms256m -Xmx512m -Xss512k

 -verbose:gc -Xloggc:heap.log’

Based on the name of the file you’re listing, it makes me think you’re 
confusing what this option does.  It’s a garbage collection log.  While that 
shows some info about the heap, it’s mainly targeted towards knowing what’s 
happening with GC in your process. 

I can’t help but think you might be looking for 
-XX:+HeapDumpOnOutOfMemoryError, which generates a heap dump when you get an 
OOME.

 
 Now it shows in grep.
 [root@server bin]# ps aux | grep Bootstrap
 root      1100 33.7  5.4 707052 95240 pts/0    Sl   11:29   0:06
 /usr/java/default/bin/java
 -Djava.util.logging.config.file=/usr/share/apache-tomcat-6.0.37/conf/logging.properties
 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms256m
 -Xmx512m -Xss512k -verbose:gc -Xloggc:heap.log
 -Djava.endorsed.dirs=/usr/share/apache-tomcat-6.0.37/endorsed -classpath
 /usr/share/apache-tomcat-6.0.37/bin/bootstrap.jar
 -Dcatalina.base=/usr/share/apache-tomcat-6.0.37
 -Dcatalina.home=/usr/share/apache-tomcat-6.0.37
 -Djava.io.tmpdir=/usr/share/apache-tomcat-6.0.37/temp
 org.apache.catalina.startup.Bootstrap start
 root      1158  0.0  0.0   3932   692 pts/0    R+   11:29   0:00 grep
 Bootstrap
 [root@server bin]#
 
 But nothing came in heap.log.

Try using this option instead:  -Xloggc:$CATALINA_BASE/logs/heap.log”

That should put the file in your “logs” directory.

Dan

 So I better monitor this and if I get the OOM
 again I have to increase Max limit!
 
 
 On Thu, Jan 23, 2014 at 8:50 PM, Christopher Schultz 
 ch...@christopherschultz.net wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256
 
 Randeep,
 
 On 1/23/14, 7:43 AM, Randeep wrote:
 I'm getting out of memory exception errors.
 
 :(
 
 Exception in thread Timer-1 java.lang.OutOfMemoryError: Java heap
 space at java.util.Arrays.copyOf(Arrays.java:2882) at
 
 java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
 
 
 at
 java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:572)
 
 
 at java.lang.StringBuffer.append(StringBuffer.java:320)
 at org.json.JSONArray.toString(JSONArray.java:834) at
 org.json.JSONObject.valueToString(JSONObject.java:1359) at
 org.json.JSONObject.toString(JSONObject.java:1233) at
 com.xxx.xxx.servlet.WServlet.writeProgramJson(WServlet.java:503) at
 com.xxx.xxx.servlet.WServlet$1.run(WServlet.java:414) at
 java.util.TimerThread.mainLoop(Timer.java:512) at
 java.util.TimerThread.run(Timer.java:462)
 
 If you are trying to serialize huge JSON objects, this is going to
 happen. I'm not sure if JSON is as smart as the Java Serialization
 engine, but if you have a circular-reference in your object graph, I'd
 be willing to bet that the JSON serializer will run forever and
 exhaust your heap.
 
 It's also possible that you simply have a tiny heap and need more,
 especially if you aren't currently setting any heap parameters.
 
 Is there anyway to see currently set jvm heap size details? Any
 linux commands.
 
 You can attach any profiler to your app. Good luck catching this in
 the act, though, in production.
 
 You can also use jmap -heap which comes with the JDK. Just point it
 at a process and you'll get a heap summary from a running JVM. Make
 sure your JVM and jmap version match.
 
 I have tried creating setenv.sh and putting the new parameters in
 it. but echo $JAVA_OPTS was not giving any value.
 
 setenv.sh is run during Tomcat startup. Running echo $JAVA_OPTS from
 the command-line isn't going to reveal anything. What you want to do
 is modify setenv.sh, re-launch Tomcat, and then look at the process
 command line... something 

Re: [OT] Out of memory exception - top posting

2014-01-23 Thread Ray Holme
Unfortunately that will mean that all folks who use yahoo need to copy and 
paste all messages.

I have tried reply and reply to conversation but with the new yahoo 
paradigm (a couple months ago, they changed things) - it no longer allows me to 
post inside of an email as it did in the past.

I understand your frustration and will try to always fully copy a message to an 
editor in order to allow me to edit and NOT top post.

Apologies and my 1/2 cent.

rah




On Thursday, January 23, 2014 2:44 PM, Mark Eggers its_toas...@yahoo.com 
wrote:
 
On 1/23/2014 11:21 AM, Leo Donahue wrote:
 On Thu, Jan 23, 2014 at 12:08 PM, André Warnier a...@ice-sa.com wrote:

 it seems that we're spending more time lately asking people to not
 top-post, than actually providing answers to their questions.

 So I have a few suggestions of my own :
 - have the list software add a message in *bold* to all messages, indicating
 that top posts will be *ignored* ?
 - just ignore top-posts ?
 - drop the rule ?


 Does this topic go back to the usenet days of the early 80s?  Top
 posting vs bottom posting?

 It is so customary to simply reply to people in the MS Outlook world
 that all of those people get used to top posting, because they know
 nothing different, until they come here.

 I'm getting used to bottom posting, but it drives my co-workers crazy
 and is not proper form where I work.  I think this we might be chasing
 the wind here.

 Leo

There are probably lots of reasons for top-posting, and I don't think we 
can lay the blame on the MS Outlook world. The people I work with use a 
mixture of Thunderbird, web-based interfaces, and Outlook.

Every one of them top-posts :-(.

I think top-posting says a lot about the thought process of the poster. 
To me it says, my issue, problem, answer, concern is of paramount 
importance. You should remember everything about my issue. After all, I 
remember everything about my issue.

The attitude is probably not malicious, but more along the lines of a 
lack of perspective.

Two things to consider when posting to a public mailing list:

1. There are lots of topics - people don't keep up with all of them
2. Many people have more pressing concerns - your issue isn't one of
    them

In a work environment, top-posting may be rational since hopefully 
you're getting mail on issues of primary importance.

In an open mailing list, bottom-posting or in-line posting makes sense 
because contributors are doing this on a voluntary basis (beats 
rewriting a build process in Maven for example :-p). Also, your concern 
is most likely not their concern. In short, the contributors aren't 
spending as many cycles on the issue as the original poster is.

This goes along with providing a complete description of your 
environment and how you arrived at the problem. Within a work 
environment, there's shared knowledge. In a public mailing list, no one 
knows but the original poster.

Oh, and brevity is probably a good model (shoot me now).

. . . . just my two cents
/mde/




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

Re: [OT] Out of memory exception - top posting

2014-01-23 Thread Ray Holme





On Thursday, January 23, 2014 3:41 PM, Mark Eggers its_toas...@yahoo.com 
wrote:
 
Reply at the bottom . . . and one in-line for fun.


 On Thursday, January 23, 2014 12:22 PM, Ray Holme rayho...@yahoo.com wrote:
  Unfortunately that will mean that all folks who use yahoo need to copy and 
  paste 
 all messages.
 
 I have tried reply and reply to conversation but with 
 the new yahoo paradigm (a couple months ago, they changed things) - it no 
 longer 
 allows me to post inside of an email as it did in the past.
 

This is an in-line reply with Yahoo's web mail interface.

 I understand your frustration and will try to always fully copy a message to 
 an 
 editor in order to allow me to edit and NOT top post.
 
 Apologies and my 1/2 cent.
 
 rah
 
 
 
 
 
 On Thursday, January 23, 2014 2:44 PM, Mark Eggers its_toas...@yahoo.com 
 wrote:
 
 On 1/23/2014 11:21 AM, Leo Donahue wrote:
  On Thu, Jan 23, 2014 at 12:08 PM, André Warnier a...@ice-sa.com 
 wrote:
 
  it seems that we're spending more time lately asking people to not
  top-post, than actually providing answers to their questions.
 
  So I have a few suggestions of my own :
  - have the list software add a message in *bold* to all messages, 
 indicating
  that top posts will be *ignored* ?
  - just ignore top-posts ?
  - drop the rule ?
 
 
  Does this topic go back to the usenet days of the early 80s?  Top
  posting vs bottom posting?
 
  It is so customary to simply reply to people in the MS Outlook world
  that all of those people get used to top posting, because they know
  nothing different, until they come here.
 
  I'm getting used to bottom posting, but it drives my co-workers crazy
  and is not proper form where I work.  I think this we might be chasing
  the wind here.
 
  Leo
 
 There are probably lots of reasons for top-posting, and I don't think we 
 can lay the blame on the MS Outlook world. The people I work with use a 
 mixture of Thunderbird, web-based interfaces, and Outlook.
 
 Every one of them top-posts :-(.
 
 I think top-posting says a lot about the thought process of the poster. 
 To me it says, my issue, problem, answer, concern is of paramount 
 importance. You should remember everything about my issue. After all, I 
 remember everything about my issue.
 
 The attitude is probably not malicious, but more along the lines of a 
 lack of perspective.
 
 Two things to consider when posting to a public mailing list:
 
 1. There are lots of topics - people don't keep up with all of them
 2. Many people have more pressing concerns - your issue isn't one of
     them
 
 In a work environment, top-posting may be rational since hopefully 
 you're getting mail on issues of primary importance.
 
 In an open mailing list, bottom-posting or in-line posting makes sense 
 because contributors are doing this on a voluntary basis (beats 
 rewriting a build process in Maven for example :-p). Also, your concern 
 is most likely not their concern. In short, the contributors aren't 
 spending as many cycles on the issue as the original poster is.
 
 This goes along with providing a complete description of your 
 environment and how you arrived at the problem. Within a work 
 environment, there's shared knowledge. In a public mailing list, no one 
 knows but the original poster.
 
 Oh, and brevity is probably a good model (shoot me now).
 
 . . . . just my two cents
 /mde/


Hmm,

I normally don't use the web interface. I access my Yahoo account via IMAP and 
Thunderbird.

Just for kicks, I thought I would access it via the web interface and reply to 
your message.

On a Windows box, Ctrl-End gets me to the end of the message. I then trim off 
the mailing list footer, and finally type in my reply.

Voila - no top-posting.

I don't know about the tablet version or phone version of Yahoo! mail.


/mde/

My bad - I did NOT see the button to include message history. Sorry to all. And 
I am not using a table, just the web interface with Linux.  I dug a while and 
there it was.


Re: serialization and newest tomcat

2014-01-18 Thread Ray Holme
To make the long and short of it. Nothing in my application(s) should LIVE over 
a restart.

So serialization does NOT make sense for me at all. Users timeout after 
inactivity too which otherwise might be a good reason for using it (maybe it 
would be fine there as the timeout is pretty long).


However I very much appreciate your explanation. I was employing ONE totally 
static bean for constants, Utilities, (many could change during run time - e.g. 
debugLevel) and general purpose methods that are useful to lots of beans (e.g 
cleanNquote makes a string ready for SQL insertion). I HAD BEEN using another, 
Application,  to keep track of application dependent Vectors for quick look up. 
Using your example, these two could be combined and I would NOT need to pass 
around a handle to the bean called Application in my own version of UserInfo 
(as an object without class for compilation purposes - I use javac not a tool 
to build so cyclic compile problems must be handled carefully). I could just 
use the one independent static bean - Utilities and simple Java imports - MUCH 
easier.




On Thursday, January 16, 2014 5:45 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Ray,

On 1/12/14, 8:45 AM, Ray Holme wrote:
 [S]erialization causes some problems in apache-tomcat-7.0.35
 
 I have several applications and run on fedora linux. I have used
 many releases of fedora and tomcat.
 
 My applications are characterized by a) all use a DB (firebird) b)
 all use both jsp and java servlets c) all use transient java beans
 for a round of interaction (user request - user response) d) all
 have 1 or more session java beans for each user (login - logout) e)
 all have 1 or more application beans (initialized at startup, can
 refresh, passed around) f) all have an application specific jar and
 share a common code jar
 
 Long ago I added serialization to almost all of the java beans to
 stop tomcat whining in the catalina.out file. This worked just fine
 until the most recent tomcat release.
 
 On my development machine, java changes build new jars and
 apache/tomcat must be restarted to work right. Starting with the
 new release, problems with connections happened.
 
 After research, I discovered that the applications were going nuts
 with connection requests and xinetd was shutting down the
 connection factory service. It took a 30 minute wait (or reboot) to
 fix this problem. My guess is that the application wide beans were
 not only being made fresh as always happens (they use one
 connection each to initialize), but that the serialized versions
 were coming back up and trying to refresh causing lots of strange
 connections to be created (if one is not passed, one is made and
 there are many routines each needing a connection).
 
 To solve this problem, I stopped serialization. This solved the
 problem.
 
 From the notes I got from others (thanks Mark and ...):
 
 serialization can be stopped by putting this in many places - here
 is one: appname/META-INF/context.xml
 
 Manager pathname= /

Can I venture a guess as to one other important detail you have left
out? It sounds like some of the objects you are putting into the
user's session (HttpSession: the stuff getting serialized to disk
across web application reload or Tomcat stop/start) may have
references to those application-scoped objects. Here's an example of
what I mean:

public class GlobalBean
  implements Serializable
{
}

public class UserBean
  implements Serializable
{
  private GlobalBean _global;
  public UserBean(GlobalBean gb)
  {
    _global = gb;
  }
}

... in your webapp's ServletContextListener:


init() {
  ...
  ServletContext application = getServletContext();
  application.setAttribute(globalBean new GlobalBean());
  ...
}

... in your servlet:

doGet() {
  ...
  ServletContext application = getServletContext();
  GlobalBean gb = (GlobalBean)application.getAttribute(globalBean);
  HttpSession session = request.getSession();
  session.setAttribute(userBean, new UserBean(gb));
  ...
}

If the above are all happening, then when you de-serialize the
UserBeans, they will de-serialize the GlobalBean instance along with
themselves. If your GlobalBean has to do a bunch of db access or
whatever to initialize itself, it will either have to do that on
deserialization to make itself sane, or it will be in a non-sane
state. In either case, you won't get the newly-created GlobalBean from
your ServletContextListener (or similar) and things may get ... weird.

If this is the case, and you don't really care about the user's
session info, then by all means: disable session serialization and be
done with it. If you need this to work -- or if you need your web
application's sessions to be distributable -- then you are necessarily
going to have to change something with your architecture in order to
get this kind of thing to work in a sane way. My recommendation would
be to pass a GlobalBean into any

Re: serialization and newest tomcat

2014-01-13 Thread Ray Holme
OK, that makes perfect sense. We are NOT talking about SESSION objects (where I 
am defining session as login to logout of a USER as I mentioned before, perhaps 
you are defining this as while tomcat is up - I can see either def.). These 
type beans are all fine, but I would actually never want them serialized if 
Tomcat restarts as I would want the user to log back in for a lot of reasons 
(but no damage would be caused if they were serialized).

I am talking about java beans that are part of the application and shared 
information available to all users. These MUST be initialized at startup (they 
are) and OLD serial copies are defunct (dangerous as they cause crazy 
connections to happen) when tomcat is restarted.

S - here is the question:

I would like to allow serialization, but tell Tomcat that certain beans should 
NOT be resurrected without me getting warnings in the log file when I don't 
mark them as serialisable.

IS THERE A WAY TO STOP WARNINGS AND TELL TOMCAT NOT TO SERIALIZE A BEAN?

Right now, I have stopped warnings but caused other problems.





On Monday, January 13, 2014 8:08 AM, Daniel Mikusa dmik...@gopivotal.com 
wrote:
 
On Jan 12, 2014, at 8:45 AM, Ray Holme rayho...@yahoo.com wrote:

I haven't been following this thread, but I wanted to clarify a couple comments 
here just to make sure someone reading this in the future doesn't get the wrong 
ideas.

 serialization causes some problems in apache-tomcat-7.0.35

No.  What causes problems is when application objects are placed in the session 
and they are not serializable.  This happens because, by default, Tomcat will 
try to save your session data when it restarts.  It does this by serializing 
the data to disk.  Then when it restarts, it deserializes the data and restores 
the sessions.

  
http://tomcat.apache.org/tomcat-7.0-doc/config/manager.html#Persistence_Across_Restarts

The only other reason why your sessions would need to be serializable is if 
you're using clustering (i.e. you add the distributable tag to web.xml).

 I have several applications and run on fedora linux. I have used many 
 releases of fedora and tomcat.
 
 My applications are characterized by
    a) all use a DB (firebird)
    b) all use both jsp and java servlets
    c) all use transient java beans for a round of interaction (user request 
- user response)
    d) all have 1 or more session java beans for each user (login - logout)
    e) all have 1 or more application beans (initialized at startup, can 
refresh, passed around)
    f) all have an application specific jar and share a common code jar
 
 Long ago I added serialization to almost all of the java beans to stop tomcat 
 whining in the catalina.out file. This worked just fine until the most recent 
 tomcat release.
 
 On my development machine, java changes build new jars and apache/tomcat must 
 be restarted to work right. Starting with the new release, problems with 
 connections happened.
 
 After research, I discovered that the applications were going nuts with 
 connection requests and xinetd was shutting down the connection factory 
 service. It took a 30 minute wait (or reboot) to fix this problem. My guess 
 is that the application wide beans were not only being made fresh as always 
 happens (they use one connection each to initialize), but that the serialized 
 versions were coming back up and trying to refresh causing lots of strange 
 connections to be created (if one is not passed, one is made and there are 
 many routines each needing a connection).

I'm not going to pretend to fully understand how your application works, but 
from what I took of this explanation it sounds like your application is 
stuffing a lot of unnecessary things into the session.  Limiting that or taking 
a closer look at how those objects are being serialized is probably something 
you should consider.

 
 To solve this problem, I stopped serialization. This solved the problem.

This certainly works, however it's worth nothing that you'll lose any session 
data when you restart Tomcat.  For development that's fine, but in production 
you might not want to do that.  I guess it depends on your app and what's in 
the sessions though.

 
 From the notes I got from others (thanks Mark and ...):
 
 serialization can be stopped by putting this in many places

The many places are context files.  There are several locations where you can 
configure your application's context.


 - here is one:
    appname/META-INF/context.xml
 
    Manager pathname= /

Again, just watch out as this will prohibit Tomcat from saving session data on 
restart.  In other words, all session data is going to be lost on restart.

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

Re: serialization and newest tomcat

2014-01-13 Thread Ray Holme
Oh, I missed one comment from Daniel before (embedded and I did not see on the 
first pass, sorry).

No, you don't know the application so I would like to explain that some 
information kept in the shared application beans is very static, needs to be 
loaded from the DB and is used everywhere by every user. The number of hits to 
the DB would quadruple (at minimum) without these small tables being in memory. 
I waste maybe 5k of memory to reduce DB use in an active system and speed up 
user response time. This would be silly for a system that it NOT active.




On Monday, January 13, 2014 8:38 AM, Ray Holme rayho...@yahoo.com wrote:
 
OK, that makes perfect sense. We are NOT talking about SESSION objects (where I 
am defining session as login to logout of a USER as I mentioned before, perhaps 
you are defining this as while tomcat is up - I can see either def.). These 
type beans are all fine, but I would actually never want them serialized if 
Tomcat restarts as I would want the user to log back in for a lot of reasons 
(but no damage would be caused if they were serialized).

I am talking about java beans that are part of the application and shared 
information available to all users. These MUST be initialized at startup (they 
are) and OLD serial copies are defunct (dangerous as they cause crazy 
connections to happen) when tomcat is restarted.

S - here is the question:

I would like to allow serialization, but tell Tomcat that certain beans should 
NOT be resurrected without me getting warnings in the log file when I don't 
mark them as serialisable.

IS THERE A WAY TO STOP WARNINGS AND TELL TOMCAT NOT TO SERIALIZE A BEAN?

Right now, I have stopped warnings but caused other problems.






On Monday, January 13, 2014 8:08 AM, Daniel Mikusa dmik...@gopivotal.com 
wrote:

On Jan 12, 2014, at 8:45 AM, Ray Holme rayho...@yahoo.com wrote:

I haven't been following this thread, but I wanted to clarify a couple comments 
here just to make sure someone reading this in the future doesn't get the wrong 
ideas.

 serialization causes some problems in apache-tomcat-7.0.35

No.  What causes problems is when application objects are placed in the session 
and they are not serializable.  This happens because, by default, Tomcat will 
try to save your session data when it restarts.  It does this by serializing 
the data to disk.  Then when it restarts, it deserializes the data and restores 
the sessions.

  
http://tomcat.apache.org/tomcat-7.0-doc/config/manager.html#Persistence_Across_Restarts

The only other reason why your sessions would need to be serializable is if 
you're using clustering (i.e. you add the distributable tag to web.xml).

 I have several applications and run on fedora linux. I have used many 
 releases of fedora and tomcat.
 
 My applications are characterized by
    a) all use a DB (firebird)
    b) all use both jsp and java servlets
    c) all use transient java beans for a round of interaction (user request 
- user response)
    d) all have 1 or more session java beans for each user (login - logout)
    e) all have 1 or more application beans (initialized at startup, can 
refresh, passed around)
    f) all have an application specific jar and share a common code jar
 
 Long ago I added serialization to almost all of the java beans to stop tomcat 
 whining in the catalina.out file. This worked just fine until the most recent 
 tomcat release.
 
 On my development machine, java changes build new jars and apache/tomcat must 
 be restarted to work right. Starting with the new release, problems with 
 connections happened.
 
 After research, I discovered that the applications were going nuts with 
 connection requests and xinetd was shutting down the connection factory 
 service. It took a 30 minute wait (or reboot) to fix this problem. My guess 
 is that the application wide beans were not only being made fresh as always 
 happens (they use one connection each to initialize), but that the serialized 
 versions were coming back up and trying to refresh causing lots of strange 
 connections to be created (if one is not passed, one is made and there are 
 many routines each needing a connection).

I'm not going to pretend to fully understand how your application works, but 
from what I took of this explanation it sounds like your application is 
stuffing a lot of unnecessary things into the session.  Limiting that or taking 
a closer look at how those objects are being serialized is probably something 
you should consider.

 
 To solve this problem, I stopped serialization. This solved the problem.

This certainly works, however it's worth nothing that you'll lose any session 
data when you restart Tomcat.  For development that's fine, but in production 
you might not want to do that.  I guess it depends on your app and what's in 
the sessions though.

 
 From the notes I got from others (thanks Mark and ...):
 
 serialization can be stopped by putting this in many places

The many places

Re: serialization and newest tomcat

2014-01-13 Thread Ray Holme
I have (in the past) dealt with transient so OK, makes sense.
Not familiar with putting in container to shield from Apache serialization.

Will look for writeup. Thanks.





On Monday, January 13, 2014 10:12 AM, Johan Compagner jcompag...@servoy.com 
wrote:
 

IS THERE A WAY TO STOP WARNINGS AND TELL TOMCAT NOT TO SERIALIZE A BEAN?

Right now, I have stopped warnings but caused other problems.




just don't add those beans to a session or if you do add them make sure that 
they are in containers and that those fields are transient
then those fields (beans) are not serialized and they are null when they are 
deserialized (so you need to refill them if they are needed)

-- 
Johan Compagner
Servoy

Re: serialization and newest tomcat

2014-01-13 Thread Ray Holme
Nice, I do that for many things, but not all of it. You are right, I probably 
could do that.
Nice food for thought!

:=]





On Monday, January 13, 2014 11:31 AM, Daniel Mikusa dmik...@gopivotal.com 
wrote:
 
On Jan 13, 2014, at 8:37 AM, Ray Holme rayho...@yahoo.com wrote:

 OK, that makes perfect sense. We are NOT talking about SESSION objects (where 
 I am defining session as login to logout of a USER as I mentioned before, 
 perhaps you are defining this as while tomcat is up - I can see either 
 def.). These type beans are all fine, but I would actually never want them 
 serialized if Tomcat restarts as I would want the user to log back in for a 
 lot of reasons (but no damage would be caused if they were serialized).

I'm referring to HttpSession.

  http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpSession.html

Any thing you store on the session through the Servlet API will be persisted by 
Tomcat when it shuts down and restored when it restarts (unless you disable 
this behavior as you have).  This allows you to restart Tomcat and not lose 
session data.

If you want to see what your application is storing in the session, take a look 
at the Manager application.  It allows you to browse through active sessions 
and view what has been stored there.

 I am talking about java beans that are part of the application and shared 
 information available to all users. These MUST be initialized at startup 
 (they are) and OLD serial copies are defunct (dangerous as they cause crazy 
 connections to happen) when tomcat is restarted.

Not following you here.  Tomcat only serializes what you put into a session 
(javax.servlet.HttpSession).  Anything else is up to your application.

 S - here is the question:
 
 I would like to allow serialization,

Ok.  Make sure any object you put into the session implements Serializable.

 but tell Tomcat that certain beans should NOT be resurrected

Certainly one option is to not put them in the session, but you do have other 
options.  See last comment.

 without me getting warnings in the log file when I don't mark them as 
 serializable.

They *must* be serializable.  Otherwise you're going to get an exception.  This 
is a requirement of Java serialization.

 
 IS THERE A WAY TO STOP WARNINGS AND TELL TOMCAT NOT TO SERIALIZE A BEAN?
 
 Right now, I have stopped warnings but caused other problems.

As I've mentioned, your beans must implement Serializable or they won't be able 
to be serialized and you'll see error.  This is not an issue with Tomcat.  It's 
a requirement of Java serialization.  Tomcat uses Java serialization to persist 
your session data between restarts so it inherits this requirement.  

I would suggest that you look into how Java serializes your objects.  If you 
don't like the default behavior, it provides you with the ability to control 
that process.  One example, if you want to prohibit a field from being 
serialized you can mark it transient.

Dan

 
 
 
 
 
 On Monday, January 13, 2014 8:08 AM, Daniel Mikusa dmik...@gopivotal.com 
 wrote:
 
 On Jan 12, 2014, at 8:45 AM, Ray Holme rayho...@yahoo.com wrote:
 
 I haven't been following this thread, but I wanted to clarify a couple 
 comments here just to make sure someone reading this in the future doesn't 
 get the wrong ideas.
 
 serialization causes some problems in apache-tomcat-7.0.35
 
 No.  What causes problems is when application objects are placed in the 
 session and they are not serializable.  This happens because, by default, 
 Tomcat will try to save your session data when it restarts.  It does this by 
 serializing the data to disk.  Then when it restarts, it deserializes the 
 data and restores the sessions.
 
  
http://tomcat.apache.org/tomcat-7.0-doc/config/manager.html#Persistence_Across_Restarts
 
 The only other reason why your sessions would need to be serializable is if 
 you're using clustering (i.e. you add the distributable tag to web.xml).
 
 I have several applications and run on fedora linux. I have used many 
 releases of fedora and tomcat.
 
 My applications are characterized by
     a) all use a DB (firebird)
     b) all use both jsp and java servlets
     c) all use transient java beans for a round of interaction (user 
request - user response)
     d) all have 1 or more session java beans for each user (login - logout)
     e) all have 1 or more application beans (initialized at startup, can 
refresh, passed around)
     f) all have an application specific jar and share a common code jar
 
 Long ago I added serialization to almost all of the java beans to stop 
 tomcat whining in the catalina.out file. This worked just fine until the 
 most recent tomcat release.
 
 On my development machine, java changes build new jars and apache/tomcat 
 must be restarted to work right. Starting with the new release, problems 
 with connections happened.
 
 After research, I discovered that the applications were going nuts with 
 connection requests and xinetd

serialization and newest tomcat

2014-01-12 Thread Ray Holme
erialization causes some problems in apache-tomcat-7.0.35

I have several applications and run on fedora linux. I have used many releases 
of fedora and tomcat.

My applications are characterized by
   a) all use a DB (firebird)
   b) all use both jsp and java servlets
   c) all use transient java beans for a round of interaction (user request - 
user response)
   d) all have 1 or more session java beans for each user (login - logout)
   e) all have 1 or more application beans (initialized at startup, can 
refresh, passed around)
   f) all have an application specific jar and share a common code jar

Long ago I added serialization to almost all of the java beans to stop tomcat 
whining in the catalina.out file. This worked just fine until the most recent 
tomcat release.

On my development machine, java changes build new jars and apache/tomcat must 
be restarted to work right. Starting with the new release, problems with 
connections happened.

After research, I discovered that the applications were going nuts with 
connection requests and xinetd was shutting down the connection factory 
service. It took a 30 minute wait (or reboot) to fix this problem. My guess is 
that the application wide beans were not only being made fresh as always 
happens (they use one connection each to initialize), but that the serialized 
versions were coming back up and trying to refresh causing lots of strange 
connections to be created (if one is not passed, one is made and there are many 
routines each needing a connection).

To solve this problem, I stopped serialization. This solved the problem.

From the notes I got from others (thanks Mark and ...):

serialization can be stopped by putting this in many places - here is one:
   appname/META-INF/context.xml

   Manager pathname= /


Fw: apache tomcat serialization

2013-12-28 Thread Ray Holme
Yes I have done various things to trace. The problem is DB connections. I 
believe that the serialized versions of things went nuts trying to refresh. 
Once serialization is off, the problem is gone.

Each of the four applications initializes using one connection. But re-loading 
through serialization appears to do weir things.

So far things work great with it stopped.

   Manager pathname= /

Has calmed the waters.

Thanks to Mark for once again steering me in the right direction.




On Saturday, December 28, 2013 1:37 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Ray,


On 12/26/13, 12:14 PM, Ray Holme wrote:
 It appears new revisions of tomcat (current for sure) are much
 more sensitive to keeping serialized data BETWEEN restarts. I have
 to wait at least 30 minutes to properly restart my applications.

30 minutes to shut-down or 30 minutes to start-up?

Have you tried to take a few thread dumps to find out what's going on?

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

iQIcBAEBCAAGBQJSvxpSAAoJEBzwKT+lPKRY+5EP/3Bu4j80UJEqbfcew8c/WmD2
fITFoCq8fXfMVWZt8NmAXxAOJBnQ8Ddc64K4jLOXo3vkxL55OPay5FUiFT6OjPuZ
0AIFndQ62n7g6CjGXQwGAzGvwDIYt1c6xb1/xj3kEsp9/pbrKqE4SkX9y1aHIiOs
XNt8cD7f6332H0si2BHv9nhylC0o5y0J7fND2ZJbHAwaDZgMHf3QGcvrnJzLoFqO
sXvQ0gJEIstrlLWZkcufCjTKB9/5C8A3pbc9Kf5a+MFrY6cFszE6YBJq15RCc0X4
2gqJ8BBYHv8j60DGMmSvshA46TkjYDRD73UEgrx7dqEeLkXHC3iYeJTuA4cPL9Dw
NH0DxS1j1sLPq8hEPSDpC5w40Dl7jJBkRrXiLNIEiRKGEEr76VVwXohwgC4rRVGQ
/aMhUzqqaqpHtZdldjYWI3FHmkFH2ijMCIhjVk2TTJCJlsz9iur842wZwz/AY70U
YxaYxZuYDohmdLuGec5SffeS9L4XdeSUs3kEHI4xBL2PTxM5hVhwYDWIiaihdN1k
9ytMGfpnTWwDrLq1GYPeveD4HP1GnAqxG1Eq/5L6A7A9Ci4WVSmjk4/2Np5Kh9R6
bz808da8ur0Uc2sUoNPODPhmi6hg3GAGnQ0SnLfXDZAlZlD++PCx2+II3YVrhqHW
kMfOGBqksIVz1dgFh3p5
=t5Af
-END PGP SIGNATURE-

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

Fw: apache tomcat serialization

2013-12-27 Thread Ray Holme





On Thursday, December 26, 2013 6:10 PM, Mark Thomas ma...@apache.org wrote:
 
On 26/12/2013 17:14, Ray Holme wrote:
 It appears new revisions of tomcat (current for sure) are much more
 sensitive to keeping serialized data BETWEEN restarts. I have to wait
 at least 30 minutes to properly restart my applications.

Nope. Nothing has changed in the session serialization code since the
Tomcat 4.1.x days. It still works exactly the same way.

 In the OLD days $CATALINA_HOME/work/Catalina/localhost/appName/*.ser
 was where things were kept and I could remove these files before a
 startup. I no longer see these files and I am sure they are
 someplace.

Only if you have configured Tomcat to place them somewhere else.

NOPE, I have NOT changed the configuration AND YES I download directly from ASF.

 I have a couple java beans that are application wide resources. So
 tomcat does NOT complain, they are compiled saying they can be
 serialized (they can while the app is running, but not between
 shutdown/startup. It it these beans which I really do not want OLD
 copies found when tomcat restarts. But there is no reason to keep ANY
 serialized data between tomcat instances.

I assume you are placing these beans in the session.

YES, they need to be found by other beans.

 Can anyone tell me how to tell tomcat to NOT use old serialized data
 at startup?

Have you tried reading the manual for the session manager you are using?
You could start here:
http://tomcat.apache.org/tomcat-8.0-doc/config/manager.html#Disable_Session_Persistence

Thanks, ON IT.

 OR How to delete it so it cannot be found?

If sessions are serialised, the file will be created wherever you tell
Tomcat to create it.


 I run on fedora.

Ah. If you are using a Fedora packaged version of Tomcat I suggest you
direct your enquires to whomever maintains that package and ask them
where they opted to move the session serialization files to.
Alternatively you could remove the 3rd party packaged version of Tomcat,
download Tomcat from the ASF and install it in your location of choice
so you know exactly where every single file is that Tomcat is using.

Yes I download and run fedora, yes I download Tomcat DIRECTLY from ASF.
No packages.
Will read your link and thanks. Best.

Mark

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

Fw: apache tomcat serialization

2013-12-27 Thread Ray Holme





On Thursday, December 26, 2013 6:10 PM, Mark Thomas ma...@apache.org wrote:
 
On 26/12/2013 17:14, Ray Holme wrote:
 It appears new revisions of tomcat (current for sure) are much more
 sensitive to keeping serialized data BETWEEN restarts. I have to wait
 at least 30 minutes to properly restart my applications.

Nope. Nothing has changed in the session serialization code since the
Tomcat 4.1.x days. It still works exactly the same way.

 In the OLD days $CATALINA_HOME/work/Catalina/localhost/appName/*.ser
 was where things were kept and I could remove these files before a
 startup. I no longer see these files and I am sure they are
 someplace.

Only if you have configured Tomcat to place them somewhere else.

NOPE, I have NOT changed the configuration AND YES I download directly from ASF.

 I have a couple java beans that are application wide resources. So
 tomcat does NOT complain, they are compiled saying they can be
 serialized (they can while the app is running, but not between
 shutdown/startup. It it these beans which I really do not want OLD
 copies found when tomcat restarts. But there is no reason to keep ANY
 serialized data between tomcat instances.

I assume you are placing these beans in the session.

YES, they need to be found by other beans.

 Can anyone tell me how to tell tomcat to NOT use old serialized data
 at startup?

Have you tried reading the manual for the session manager you are using?
You could start here:
http://tomcat.apache.org/tomcat-8.0-doc/config/manager.html#Disable_Session_Persistence

Thanks, ON IT.

 OR How to delete it so it cannot be found?

If sessions are serialised, the file will be created wherever you tell
Tomcat to create it.


 I run on fedora.

Ah. If you are using a Fedora packaged version of Tomcat I suggest you
direct your enquires to whomever maintains that package and ask them
where they opted to move the session serialization files to.
Alternatively you could remove the 3rd party packaged version of Tomcat,
download Tomcat from the ASF and install it in your location of choice
so you know exactly where every single file is that Tomcat is using.

Yes I download and run fedora, yes I download Tomcat DIRECTLY from ASF.
No packages.
Will read your link and thanks. Best.

Mark

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

apache tomcat serialization

2013-12-26 Thread Ray Holme
It appears new revisions of tomcat (current for sure) are much more sensitive 
to keeping serialized data BETWEEN restarts. I have to wait at least 30 minutes 
to properly restart my applications.

In the OLD days $CATALINA_HOME/work/Catalina/localhost/appName/*.ser was where 
things were kept and I could remove these files before a startup. I no longer 
see these files and I am sure they are someplace.

I have a couple java beans that are application wide resources. So tomcat does 
NOT complain, they are compiled saying they can be serialized (they can while 
the app is running, but not between shutdown/startup. It it these beans which I 
really do not want OLD copies found when tomcat restarts. But there is no 
reason to keep ANY serialized data between tomcat instances.


Can anyone tell me how to tell tomcat to NOT use old serialized data at startup?
  OR
How to delete it so it cannot be found?

I run on fedora.

Thanks


Re: timing is everything when starting - a 32 bit question

2013-12-19 Thread Ray Holme
Getting tomcat the user/group to start did not turn out too hard.
   changed permissions of everything under apache to tomcat:tomcat
   then changed all permissions of all things under webapps to me (ray:staff)
  make the S95tomcat script (start/stop/restart SYSV style) su tomcat  
start/stop command

So tested and worked fine (well I had to fix some directory permissions in one 
of the apps - tomcat coucl not read, but that was not hard to find and fix.

Wrote a tomcat.start systemd file:

 /local/bin/tomcat.service 
--
[Unit]
Description=The Jakarta Apache/Tomcat Server
After=httpd.target

[Service]
Type=forking
ExecStart=/local/bin/S95tomcat start
ExecReload=/local/bin/S95tomcat restart
ExecStop=/local/bin/S95tomcat stop

[Install]
WantedBy=multi-user.target
--


then linked and started

systemctl link  /local/bin/tomcat.servic
systemctl start tomcat

WORKS fine - so does restart and stop

BUT UNLIKE HTTPD AND NFS, THIS SERVICE DOES NOT COME UP AT BOOT
I MUST MANUALLY START IT:  sudo systemctl start tomcat

I put some logging and see that when the system shutsdown the tomcat:stop 
script is run
but it does not start it.

Anyway, this is equivalent to my original rc.local invokation of S95tomcat 
start not working in the 32 bit world, but now it is in the 64 bit world too.

Glad that this is no longer running root, but the systemd problem is not one 
for this group - so I will ask somewhere else.

S95tomcat basically invokes the catalina startup and shutdown scripts with a 
lot of local cleaning and some other required processes coming up and down as 
needed.

Posting the tomcat.service script for those interested.




On Sunday, December 15, 2013 5:55 PM, Ray Holme rayho...@yahoo.com wrote:
 
OK, the init.d script was probably very old and it looks like I need to learn 
systemd control.

Did not check apache/logs as there was no sign the script ran, thanks will look 
there too.

yes built and installed mod_jk - the app works fine when I do get it going, yes 
running SELinux

so - time to dig into systemd scripts (after working with Unix BSD and Sys5 for 
years, I guess I am too used to doing things the old way. argh!!!

My approach would be the following:

1. Create an unprivileged user to run Tomcat
2. Install Tomcat from tomcat.apache.org for this user
3. Create a systemv init script - use tomcat-systemv contents as a guide
4. Wrap the init script in a service file.
5. Use systemctl enable or disable as other systemd services

The init script for Tomcat is pretty ugly - mine's around 575 lines for 
Tomcat 6 or 7 and CentOS 6.5. The scripts are pretty defensive, which 
accounts for most of the length.

1-3 are DONE. Yes my script is not quite that long but it is VERY defensive.
Time to wrap it in systemd and learn that.

Thanks for the pointers.






On Sunday, December 15, 2013 3:26 PM, Mark Eggers its_toas...@yahoo.com wrote:


Some inline and some at the end:

Note, this is almost all off-topic, since it concerns system 
administration and not Tomcat.

Note, I'm also comparing this to Fedora 19. Fedora 18 should be EOL in 
about 5 weeks.

On 12/15/2013 7:51 AM, Ray Holme wrote:
 I have a rc.local file setup to auto start tomcat and httpd under fedora 18 
 boot.
 It works fine on my 64 bit system (and a couple others for a friend)
    but there MUST BE a sleep before bringing up httpd (for some reason I 
forgot).

 start routine in /etc/init.d/rc.local
     S95tomcat start
     (sleep 10; S96httpd  start) 
     date  /tmp/last_start

 stop routine
     S96httpd stop
     S95tomcat stop
     date  /tmp/last_stop            # not meaningful unless testing rc.local 
as boot wipes /tmp

 for the record S96httpd is a link to /etc/init.d/httpd

There is no /etc/init.d/httpd script on Fedora 19. Where did you get 
this script?

             and S95tomcat is a script I wrote which does some extra things 
besides calling the
                 official release apache/tomcat up/down scripts

 I also have a portable 32bit fedora 18 box. After installing all the pieces, 
 I have tomcat/httpd working fine, BUT
 they WILL NOT START FROM THE BOOT up like the 64 bit systems do.

Don't do this.

Fedora 19 uses systemd. The HTTPD package comes with a
/usr/lib/systemd/system/httpd.service file that works just fine to 
control Apache HTTPD.


 I have tried putting more and longer sleeps in place (before tomcat as well 
 as httpd). All to no avail.

 BUT WHEN I TYPE IN rc.local start AS ROOT, ALL COMES UP FINE.
    (after logging into the desktop as me and becoming root with su) in a 
command tool

 The only visible difference I have found is in the httpd log
 Tomcat's failure is lost or I have not found it yet (yes I looked in 
 /var/log/messages where I would expect it).

Any logging should happen in catalina.out (unless you've done some 
changes to a stock Tomcat). That location is dependent on where / how 
you've installed Tomcat.


 --- so here is the /var/log/httpd/error_log after a boot - not sure

Re: linking (limiting???)

2013-12-19 Thread Ray Holme
OK, Chris thanks and thanks Mark.

Using tomcat as it should be used under tomcat user and removing links to 
applications found in /var/www/html (once required or supposedly faster - but 
now obsolete).

Now
a) allowlinking works
b) aliases work
c) failed with VirtualDirectory so far

Choosing aliases as they may work on a MS OS.

Thanks again.





On Wednesday, December 18, 2013 12:41 PM, Ray Holme rayho...@yahoo.com wrote:
 
Chris,

You may have hit the nail on the head.

While I have 4 working tomcat applications, I am a C/Java/SQL programmer and 
Unix admin person (ex IBM system BAL programmer). I am mostly a DBA and write 
Java bean code to provide better access to things in the DB (make sure rules 
are followed). My experience level with tomcat is not great but growing. Today 
I got it running as user tomcat (not root - thanks Mark), and am finishing up 
by making it come up right using systemd services (instead of rc.local as I 
have in the past).

So I will try my best to answer your questions.

I BELIEVE that the web browser uses port 80 only and that httpd passes things 
off to port 8080. (not sure).

I have created symbolic links in /var/www/html so applications worked in the 
past, but you say this is wrong and it may very well be. I will try removing 
the links (after I get systemd startup working) and test again. Maybe this will 
fix all 3 link scenarios I tried (2 or more would be great).

Results will be posted here - hoping by end of day.






On Wednesday, December 18, 2013 12:25 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Ray,

On 12/17/13, 1:23 PM, Ray Holme wrote:
 HTTP Status 404 - /appName/appName_tour/appNamev3.html type Status
 report message /appName/appName_tour/appNamev3.html description The
 requested resource is not available. Apache Tomcat/7.0.35

you're a few versions behind. Unless there is a particular reason to
stick with 7.0.35, you might want to update to 7.0.latest.

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

iQIcBAEBCAAGBQJSsdp0AAoJEBzwKT+lPKRYFrEP/2RB3svdpiLhEIw/eBbtuD4R
zrbmE/m4rAXyeC0rh3WRQeRt6LJH1Q6QpI3dUz8SK/YIzNuHw1qp2c+LfSgPsQFT
cJ4LdvUtMJEKLHfjbP0ghmKGsi2gqiMdLZ6L+JFV3cYwLCm9R5DUqKuTdPVnFoM8
sJ7v36tdaBM+UQs1l7/EuEXdRZDaOdIEenN34RnTJjfeu8TsWx4NxafUJEZ92HMJ
E3FggG5vtEICR56MXM4VNkvk3Hj9pXSglm1QGNyHX2Ya96O8Hx6l04QRWRHZs5cU
4aQZnjilArmb/G4oH4eLl5PtUPUfpDxW9U0XKoIjRyHPtfyYLUlkogQboRMSIkkr
uryjux/6BU2R/Xiu8g2A2UGYsexh9FZ0xwg43R7R9QPn/NxWFw87bH3VfU4Aj06C
bI8trMKed9TN+weXgDIPTEfSh6gTQbI9KxYzAfs1C6kZYTzspuU/YUvYOKV/Mg6f
Z8Knti0Cre90LMQaaNlou5Qxldlwn8vl+WVmo7tOjyEI1u1F9/mv3wRUdcfPJOJA
F8CXVGFgKWqt6kBvRxecBqYZWype9Hdfk+JW5fEHQbMGcHzQBqZnIBAn8V4j56bg
z8kTUto7JgGQPLB8A5XP6N1OCw2JsPJfbS5fcYkpxhru7UlQ6utmUTJxHRYiYzZ/
HYbL7TKjKZWMbC6a/jui
=1IVL

-END PGP SIGNATURE-

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

Re: linking (limiting???)

2013-12-18 Thread Ray Holme
Hmm . . . . Lots of speculation here. How are the files referenced in 
your application? It seems that if the physical files are available, 
then the application works fine. If the physical files are not 
available, then the database has problems (firebird under xinetd, 
perhaps?) and you get 404 errors. Does the application scan a directory 
and populate the database on startup? Does the database need to know 
where the files are? Does the database need read access to the files?

 I have spent the night thinking about this. As I said before, these files have 
NOTHING to do with the database (located elsewhere and outside of the webapp, 
of course).
They are accessed by either HTTPD or Apache/Tomcat (WHICH?). And therein may be 
the rub. Perhaps if the file is accessed by Apache/Tomcat (port 8080), they 
would be fine. Perhaps if HTTPD (port 80) tries to get them using 
/var/www/html/myApplication (a symbolic link to 
/opt/apache/webapps/MyApplication) it fails. If this makes sense (and it 
might), then it depends on how the file is going to be picked up - is there any 
write-up to figure out how this httpd VS apache/tomcat link works (I have no 
idea what modjk.so does except pass things back and forth between the two  :: 
totally needed in Linux but not on a deployed application in MS-XP using port 
8080 - perhaps exclusively without using  port 80). If this does NOT make 
sense, then making the application run as tomcat (not root) does not make sense 
for improving this particular situation (agreed that I should do this and will 
immediately, but root - tomcat should not change the link behavior - in any
 of the three scenarios (link, alias, virtual directory)).

Once I get the tomcat user to run everrything, I will try again and post the 
results.




On , Ray Holme rayho...@yahoo.com wrote:
 
I think I found out how to reply inline usine yahoo. I hope. Trying anyway - 
NO, it will not let embed replies.
BS.. I will copy paste.


Inline - per my usual:

Yes Doc.

On 12/17/2013 10:23 AM, Ray Holme wrote:
 First: Thanks for clarifying my understanding of XML tags AND FIXING my typo.
         and apologies for top-posting - I had hoped I was making it easier by
         restating the crux of the problem and shortening everyone's read.

 AND for the record, yahoo is NO longer including the prior message which is 
 what
 I intended originally. I am
 not sure when they changed things, but I am NOT a yahoo
 fan anymore. I tried to get your message included above.

I'm using yahoo for my mailing lists, all others end up in gmail. 
However I'm using Thunderbird and IMAP, so I can control how my mail 
works a bit better.


I use yahoo for gmail but straight front end.
 
 BUT SO far, I have totally failed with linking  - below is the detail.
 Quick recap - for those with shorter memories than even mine. :=]

 appName has a top level directory .../webapps/appName/appName_tour
    which contains a bunch of very large files - a demo tour
    the goal is to separate this from the WAR file
    (later in another app, I want photos separated for same reason
      BUT in the case HERE, the files are read only, nothing written to dir).

 a) try 1 - using links (moved the directory to /opt/appName_tour) and did a 
 symbolic link
   under the application directory (MS systems cannot do this)

 ---
 .../webapps/appName/META-INF/context.xml contains 3 lines
 ?xml version=1.0
 encoding=UTF-8?
 Context allowLinking=true
 /Context

   When I try to run the linked demo I get this in the popup window generated:

 HTTP Status 404 - /appName/appName_tour/appNamev3.html
 type Status report
 message /appName/appName_tour/appNamev3.html
 description The requested resource is not available.
 Apache Tomcat/7.0.35

So, a few questions are in order here:

1. Where did you get the Tomcat from?

STRAIGHT FROM THE APACHE TOMCAT DOWNLOAD SITE.
I USED THE apache-tomcat-7.0.35.tar.gz and installed myself in /opt/

If it's from a distribution repackage, components get scattered all 
over. However this should not impact linking.

2. Are you running with SELinux enabled?

YES

If SELinux is enforcing and you've installed Tomcat from a distribution 
package, you may be running into SELinux issues. What does sealert say?

sealert is complaining about mandb and abrtd - nothing else (those were there a 
long time ago)

3. General permissions

Does the user running Tomcat have proper permissions for 
/opt/appName_tour? You'll
 need read/execute access for all intervening 
directories, and read access for the files.

OH YES. It was 755 and all files in it are 644. I am a newbie to some features 
of tomcat, but some might say a very old hand at Unix and then much later Linux 
admin.

4. What user is Tomcat running as?

Right now it is root, but I plan to change that soon - you wrote about systemd 
and I plan to go thay way. There is a user and a group tomcat, but I am not 
using it yet. I was hoping to finish this link thing

Re: linking (limiting???)

2013-12-18 Thread Ray Holme
Chris,

You may have hit the nail on the head.

While I have 4 working tomcat applications, I am a C/Java/SQL programmer and 
Unix admin person (ex IBM system BAL programmer). I am mostly a DBA and write 
Java bean code to provide better access to things in the DB (make sure rules 
are followed). My experience level with tomcat is not great but growing. Today 
I got it running as user tomcat (not root - thanks Mark), and am finishing up 
by making it come up right using systemd services (instead of rc.local as I 
have in the past).

So I will try my best to answer your questions.

I BELIEVE that the web browser uses port 80 only and that httpd passes things 
off to port 8080. (not sure).

I have created symbolic links in /var/www/html so applications worked in the 
past, but you say this is wrong and it may very well be. I will try removing 
the links (after I get systemd startup working) and test again. Maybe this will 
fix all 3 link scenarios I tried (2 or more would be great).

Results will be posted here - hoping by end of day.





On Wednesday, December 18, 2013 12:25 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Ray,

On 12/17/13, 1:23 PM, Ray Holme wrote:
 HTTP Status 404 - /appName/appName_tour/appNamev3.html type Status
 report message /appName/appName_tour/appNamev3.html description The
 requested resource is not available. Apache Tomcat/7.0.35

you're a few versions behind. Unless there is a particular reason to
stick with 7.0.35, you might want to update to 7.0.latest.

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

iQIcBAEBCAAGBQJSsdp0AAoJEBzwKT+lPKRYFrEP/2RB3svdpiLhEIw/eBbtuD4R
zrbmE/m4rAXyeC0rh3WRQeRt6LJH1Q6QpI3dUz8SK/YIzNuHw1qp2c+LfSgPsQFT
cJ4LdvUtMJEKLHfjbP0ghmKGsi2gqiMdLZ6L+JFV3cYwLCm9R5DUqKuTdPVnFoM8
sJ7v36tdaBM+UQs1l7/EuEXdRZDaOdIEenN34RnTJjfeu8TsWx4NxafUJEZ92HMJ
E3FggG5vtEICR56MXM4VNkvk3Hj9pXSglm1QGNyHX2Ya96O8Hx6l04QRWRHZs5cU
4aQZnjilArmb/G4oH4eLl5PtUPUfpDxW9U0XKoIjRyHPtfyYLUlkogQboRMSIkkr
uryjux/6BU2R/Xiu8g2A2UGYsexh9FZ0xwg43R7R9QPn/NxWFw87bH3VfU4Aj06C
bI8trMKed9TN+weXgDIPTEfSh6gTQbI9KxYzAfs1C6kZYTzspuU/YUvYOKV/Mg6f
Z8Knti0Cre90LMQaaNlou5Qxldlwn8vl+WVmo7tOjyEI1u1F9/mv3wRUdcfPJOJA
F8CXVGFgKWqt6kBvRxecBqYZWype9Hdfk+JW5fEHQbMGcHzQBqZnIBAn8V4j56bg
z8kTUto7JgGQPLB8A5XP6N1OCw2JsPJfbS5fcYkpxhru7UlQ6utmUTJxHRYiYzZ/
HYbL7TKjKZWMbC6a/jui
=1IVL

-END PGP SIGNATURE-

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

Re: linking (limiting???)

2013-12-17 Thread Ray Holme
First: Thanks for clarifying my understanding of XML tags AND FIXING my typo.
   and apologies for top-posting - I had hoped I was making it easier by
   restating the crux of the problem and shortening everyone's read.

AND for the record, yahoo is NO longer including the prior message which is 
what I intended originally. I am not sure when they changed things, but I am 
NOT a yahoo fan anymore. I tried to get your message included above.

BUT SO far, I have totally failed with linking  - below is the detail.
Quick recap - for those with shorter memories than even mine. :=]

appName has a top level directory .../webapps/appName/appName_tour
  which contains a bunch of very large files - a demo tour
  the goal is to separate this from the WAR file
  (later in another app, I want photos separated for same reason
    BUT in the case HERE, the files are read only, nothing written to dir).

a) try 1 - using links (moved the directory to /opt/appName_tour) and did a 
symbolic link
 under the application directory (MS systems cannot do this)

--- .../webapps/appName/META-INF/context.xml contains 3 lines
?xml version=1.0 encoding=UTF-8?
Context allowLinking=true
/Context

 When I try to run the linked demo I get this in the popup window generated:

HTTP Status 404 - /appName/appName_tour/appNamev3.html
type Status report
message /appName/appName_tour/appNamev3.html
description The requested resource is not available.
Apache Tomcat/7.0.35

 The strange thing here is that I thought I had this one was working a few days 
back.

b) try 2 - using aliases - removed the symbolic link and left the real directory
   (/opt/appName_tour exists but there is NO .../webapps/appName/appName_tour)

---.../webapps/appName/META-INF/context.xml contains 3 lines
?xml version=1.0 encoding=UTF-8?
Context aliases=/appName_tour=/opt/appName_tour
/Context

 SAME RESULTS in the popup windowas in a) above.

c) try 3 use Virtual Directory Context - left directories setup as in b (above)
   (/opt/appName_tour exists but there is NO .../webapps/appName/appName_tour)

---.../webapps/appName/META-INF/context.xml contains 5 lines
?xml version=1.0 encoding=UTF-8? 
Context
Resources className=org.apache.naming.resources.VirtualDirContext
  extraResourcePaths=/appName_tour=/opt/appName_tour
/Resources
/Context

 SAME RESULTS in the popup windowas in a) and b) above.

Footnote: I also tried making an empty directory in the webapps/appName 
directory
instead of leaving it NOT THERE at all. Same results.

Painful Footnote: For some obscure reason, I must separate each trial by quite 
a bit of time (30 mins)
 - JUST THIS application goes nuts getting a database connection (looks like an 
xinetd shutdown)
   I get a null pointer to the startup of the app which requires the DB

 - there are FOUR apache-tomcat application directories here - all use 
databases (different)
   restarting tomcat does NOT affect any of three others - they ALL work fine

 - after 30 minutes of tomcat DOWN, this app starts fine too
 there are NO warnings in /var/log/messages about xinetd refusing 
connections (have seen before)
  just starts and stops of xinetd - db connectors (normal heavy startup 
usage)

 - without these changes to context.xml (a-c enumerated above) (i.e. the tour 
is a real directory)
 this application restarts just fine every time I restart tomcat
 (and did in fedora 8, 12, 14, 16 too)

 --- this is weird and painful or I would have completed all these tests hours 
ago




On Monday, December 16, 2013 5:19 PM, Mark Eggers its_toas...@yahoo.com wrote:
 
Replies inline.

Note, people on this mailing list frown on top-posting (see items 6 and 
7 here: http://tomcat.apache.org/lists.html). It does make the reply and 
response difficult to follow without rereading the entire thread.

Please either reply inline or at the end, so people late to the party 
(or those of us with short / fragmented memory :-p) can remember what's 
going on.

On 12/16/2013 1:00 PM, Ray Holme wrote:
 I have been trying three scenarios. So far one works (least security and not 
 good for all OS versions).
 Again thanks to both Marks for the pointers, but I am afraid they are not 
 working yet.

 My goal is to enable one directory to be used which is outside the 
 application (and tomcat too)
     .../webapps/mywebapp  hierarchy
     which mywebapp.war will replace with a new release

    use 1: to store/retrieve images locally to a machine
           under application control (db stores names of files)
    use 2: to store a static movie - demo (no update - this is the simple test 
case I try)

 The goal is to get this stuff out of the war file (leaving nothing, an empty 
 dir, or a link as needed - see below).  All of the below require 
 apache/tomcat to be down when you make the changes, then restart to test

 a) IF you have linux (or unix) or osx - you can do symbolic linking
      simply move the directory and link

Re: linking (limiting???)

2013-12-17 Thread Ray Holme
I think I found out how to reply inline usine yahoo. I hope. Trying anyway - 
NO, it will not let embed replies.
BS.. I will copy paste.


Inline - per my usual:

Yes Doc.

On 12/17/2013 10:23 AM, Ray Holme wrote:
 First: Thanks for clarifying my understanding of XML tags AND FIXING my typo.
         and apologies for top-posting - I had hoped I was making it easier by
         restating the crux of the problem and shortening everyone's read.

 AND for the record, yahoo is NO longer including the prior message which is 
 what
 I intended originally. I am not sure when they changed things, but I am NOT a 
 yahoo
 fan anymore. I tried to get your message included above.

I'm using yahoo for my mailing lists, all others end up in gmail. 
However I'm using Thunderbird and IMAP, so I can control how my mail 
works a bit better.


I use yahoo for gmail but straight front end.
 
 BUT SO far, I have totally failed with linking  - below is the detail.
 Quick recap - for those with shorter memories than even mine. :=]

 appName has a top level directory .../webapps/appName/appName_tour
    which contains a bunch of very large files - a demo tour
    the goal is to separate this from the WAR file
    (later in another app, I want photos separated for same reason
      BUT in the case HERE, the files are read only, nothing written to dir).

 a) try 1 - using links (moved the directory to /opt/appName_tour) and did a 
 symbolic link
   under the application directory (MS systems cannot do this)

 --- .../webapps/appName/META-INF/context.xml contains 3 lines
 ?xml version=1.0 encoding=UTF-8?
 Context allowLinking=true
 /Context

   When I try to run the linked demo I get this in the popup window generated:

 HTTP Status 404 - /appName/appName_tour/appNamev3.html
 type Status report
 message /appName/appName_tour/appNamev3.html
 description The requested resource is not available.
 Apache Tomcat/7.0.35

So, a few questions are in order here:

1. Where did you get the Tomcat from?

STRAIGHT FROM THE APACHE TOMCAT DOWNLOAD SITE.
I USED THE apache-tomcat-7.0.35.tar.gz and installed myself in /opt/

If it's from a distribution repackage, components get scattered all 
over. However this should not impact linking.

2. Are you running with SELinux enabled?

YES

If SELinux is enforcing and you've installed Tomcat from a distribution 
package, you may be running into SELinux issues. What does sealert say?

sealert is complaining about mandb and abrtd - nothing else (those were there a 
long time ago)

3. General permissions

Does the user running Tomcat have proper permissions for 
/opt/appName_tour? You'll need read/execute access for all intervening 
directories, and read access for the files.

OH YES. It was 755 and all files in it are 644. I am a newbie to some features 
of tomcat, but some might say a very old hand at Unix and then much later Linux 
admin.

4. What user is Tomcat running as?

Right now it is root, but I plan to change that soon - you wrote about systemd 
and I plan to go thay way. There is a user and a group tomcat, but I am not 
using it yet. I was hoping to finish this link thing before moving on to do 
that right.

If you're binding to port 80, then you'll at least have to start out as 
a privileged user. Typically this is done with a jsvc wrapper. Don't run 
Tomcat (or any server) as root.

I know you are right and I need to do this. Maybe now is the time, before 
solving the link problem.

The application we are talking about has been running for many years (slap me 
for doing it as root).

   The strange thing here is that I thought I had this one was working a few 
days back.

 b) try 2 - using aliases - removed the symbolic link and left the real 
 directory
     (/opt/appName_tour exists but there is NO 
.../webapps/appName/appName_tour)

 ---.../webapps/appName/META-INF/context.xml contains 3 lines
 ?xml version=1.0 encoding=UTF-8?
 Context aliases=/appName_tour=/opt/appName_tour
 /Context

   SAME RESULTS in the popup windowas in a) above.

 c) try 3 use Virtual Directory Context - left directories setup as in b 
 (above)
     (/opt/appName_tour exists but there is NO 
.../webapps/appName/appName_tour)

 ---.../webapps/appName/META-INF/context.xml contains 5 lines
 ?xml version=1.0 encoding=UTF-8?
 Context
 Resources className=org.apache.naming.resources.VirtualDirContext
                        extraResourcePaths=/appName_tour=/opt/appName_tour
 /Resources
 /Context

   SAME RESULTS in the popup windowas in a) and b) above.

 Footnote: I also tried making an empty directory in the webapps/appName 
 directory
 instead of leaving it NOT THERE at all. Same results.

 Painful Footnote: For some obscure reason, I must separate each trial by 
 quite a bit of time (30 mins)
   - JUST THIS application goes nuts getting a database connection (looks like 
an xinetd shutdown)
     I get a null pointer to the startup of the app which requires the DB

   - there are FOUR apache

Re: linking (limiting???)

2013-12-16 Thread Ray Holme
I have been trying three scenarios. So far one works (least security and not 
good for all OS versions).
Again thanks to both Marks for the pointers, but I am afraid they are not 
working yet.

My goal is to enable one directory to be used which is outside the application 
(and tomcat too)
   .../webapps/mywebapp  hierarchy
   which mywebapp.war will replace with a new release

  use 1: to store/retrieve images locally to a machine
 under application control (db stores names of files)
  use 2: to store a static movie - demo (no update - this is the simple test 
case I try)

The goal is to get this stuff out of the war file (leaving nothing, an empty 
dir, or a link as needed - see below).  All of the below require apache/tomcat 
to be down when you make the changes, then restart to test

a) IF you have linux (or unix) or osx - you can do symbolic linking
    simply move the directory and link (my case below):
    cd /webapps/mywebapp; mv images /opt; ln -s /opt/images

  and to enable symbolic linking to other directories on your machine (all of 
them)

  create a /webapps/mywebapp/META-INF/context.xml file (or edit the one you 
have)

?xml version=1.0 encoding=UTF-8?
Context allowLinking=true /Context

  advantages for this method: works simply
  faults:    MS os's don't do symbolic; also opens up ALL linking (security 
issues? probably)

 BUT THERE ARE 2 other SAFER more restrictive ways below, both also done in
  the same  context.xml file (if I can get either of them to work - the 
examples often say the server.xml file, but there is only one of them in the 
top tomcat conf directory, which has NO context references - but if they go 
there, then path= probably needs to be specified.)

b)

?xml version=1.0 encoding=UTF-8?
Context aliases=/images=/opt/images /
/Context

c)

?xml version=1.0 encoding=UTF-8? 
Context   Resources className=org.apache.naming.resources.VirtualDirContext
  extraResourcePaths=/images=/opt/images /
/Context

-
These are both more security conscious and might should work for MS
 (with MS correct paths such as d:\images)

Which of these is simpler and/or better - I have no idea.  Net comparisons 
don't say.
  but the VirtualDirContext.html pages say: DO NOT USE FOR PRODUCTION 
  of course- they don't say why NOT
Why both require the escaped greater than sign, beats me too. /
  I would have thought it would be simply  on the 2nd and 3rd lines resp. (b 
and c)

NEITHER OF THESE WORKED FOR ME! (so far and I have tried many variants)

 Do I have to have the symbolic link (in Linux - I did for a) obviously)  
 or should this be a plain empty directories (like Linux/Unix mount points)
 or should there be no ../webapps/myapp/images anything at all?

In the manual version there are more parameters, but most folks say to drop

   path=mywebapp

and the rest seem to not be relevant to what I am doing so I cut them out. 
Maybe that is the problem.

Here is the example I found under VirtualDirContext online

Context path=/mywebapp docBase=/Users/theuser/mywebapp/src/main/webapp 
Resources className=org.apache.naming.resources.VirtualDirContext
extraResourcePaths=/pictures=/Users/theuser/mypictures,/movies=/Users/theuser/mymovies
 / 
Loader className=org.apache.catalina.loader.VirtualWebappLoader 
virtualClasspath=/Users/theuser/mywebapp/target/classes /
JarScanner scanAllDirectories=true /
/Context





On Sunday, December 15, 2013 7:39 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Martin,

On 12/15/13, 4:52 PM, Martin Gainty wrote:
 Mark I assume you're referring to Virtual DirContext...? Context
 path=/mywebapp docBase=/Users/theuser/mywebapp/src/main/webapp
 

You shouldn't use the path attribute, here. You should know this.

 Resources
 className=org.apache.naming.resources.VirtualDirContext
 
 extraResourcePaths=/WEB-INF/classes=/Users/theuser/mywebapp/target/classes,/pictures=/Users/theuser/mypictures,/movies=/Users/theuser/mymovies/

VirtualDirContext
 
is not necessary, but it is one option.

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

iQIcBAEBCAAGBQJSrkvIAAoJEBzwKT+lPKRYZ4cP/1SvH4mwBFUIjmtiGnBfa3vU
IHwSsyfHaoyO55p1/1AasP6avv8rjpMl9i8d+kmYolIiYMF461UCGTuE44SzHP1Y
O1/VayieLS3A/pn2YS86LqfXTuuKD4pWQ93TDEihchpXpJ+/B3sMfJeCzvRRYue7
PZ32luoXvsHEgA2nt7Qpp88Nz+9RggYAw5KlnTrnndqyMl8FyWLkTccpaqTthOnW
LcZgieAW7ySWZRbyAiXNEsk6kVDTat9z/EAeDmMWqN43LJikxLh4Glez3jv80mhy
cNtZ43mqroyCRF82nSO6eHxeSxIh70kdVaz6/x7QaBNAWIe96DHlQFTZwBnClzwY
T5uHYEBwSTfZ7GFlT/z+zGWxhX0fme9q9auZyXnufEHqPadKWkGdbjFN4dgifYm6
Js/O5o2TsCK9RKYbNomPygZ+fek6AqtFtEOvimyFd0Udml4hoQKzTOc81Rb/Dhx9
J/u47Oj754kTL18mv0Ci1ZOB4IQ1jO8YZDz35RU/9MZeoQ+LKkSxZHZTL1/PaH0u
h15XSAWv5MVHelPJM7WZWfrQdGAuYKUR+QOB1T4zoW+HKkcjsY7pilO3FJvrv84Y

timing is everything when starting - a 32 bit question

2013-12-15 Thread Ray Holme
I have a rc.local file setup to auto start tomcat and httpd under fedora 18 
boot.
It works fine on my 64 bit system (and a couple others for a friend) 
  but there MUST BE a sleep before bringing up httpd (for some reason I forgot).

start routine in /etc/init.d/rc.local
   S95tomcat start
   (sleep 10; S96httpd  start) 
   date  /tmp/last_start

stop routine
   S96httpd stop
   S95tomcat stop
   date  /tmp/last_stop    # not meaningful unless testing rc.local as 
boot wipes /tmp

for the record S96httpd is a link to /etc/init.d/httpd
   and S95tomcat is a script I wrote which does some extra things 
besides calling the
   official release apache/tomcat up/down scripts

I also have a portable 32bit fedora 18 box. After installing all the pieces, I 
have tomcat/httpd working fine, BUT
they WILL NOT START FROM THE BOOT up like the 64 bit systems do.

I have tried putting more and longer sleeps in place (before tomcat as well as 
httpd). All to no avail.

BUT WHEN I TYPE IN rc.local start AS ROOT, ALL COMES UP FINE.
  (after logging into the desktop as me and becoming root with su) in a 
command tool

The only visible difference I have found is in the httpd log
Tomcat's failure is lost or I have not found it yet (yes I looked in 
/var/log/messages where I would expect it).

--- so here is the /var/log/httpd/error_log after a boot - not sure if the 
first two lines are errors, but the third is
  (timestamps shortened up for this note)

[12/15/2013] [core:notice] [pid 1686] SELinux policy enabled; httpd running as 
context system_u:system_r:httpd_t:s0
[12/15/2013] [suexec:notice] [pid 1686] AH01232: suEXEC mechanism enabled 
(wrapper: /usr/sbin/suexec)
[12/15/2013] [jk:emerg] [pid 1686] Error in reading worker properties from 
'/etc/httpd/conf/workers.properties'
AH00016: Configuration Failed


- and now for the AFTER I boot and run rc.local start as root - note line 
1 has different RUNTIME PERMISSIONS

[12/15/2013] [core:notice] [pid 2302] SELinux policy enabled; httpd running as 
context unconfined_u:system_r:unconfined_t:s0-s0:c0.c1023
[12/15/2013] [suexec:notice] [pid 2302] AH01232: suEXEC mechanism enabled 
(wrapper: /usr/sbin/suexec)
[12/15/2013] [auth_digest:notice] [pid 2303] AH01757: generating secret for 
digest authentication ...
[12/15/2013] [lbmethod_heartbeat:notice] [pid 2303] AH02282: No slotmem from 
mod_heartmonitor
[12/15/2013] [mpm_prefork:notice] [pid 2303] AH00163: Apache/2.4.6 (Fedora) 
mod_jk/1.2.37 configured -- resuming normal operations
[12/15/2013] [core:notice] [pid 2303] AH00094: Command line: '/usr/sbin/httpd'


--
So I am guessing here below - anyone please correct.

  Either
   a) the permissions are critical between the two runs (if so, how to set in 
rc.local)
   but ( again ) NO sign of apache tomcat being up either
 or
   b) something else is still coming up on the system as both tomcat AND httpd 
fail originally
   but later after I login and become root, the system is stable and up 
they come manually

Workarounds I see for now:
   a) use 64bit machines only
  or
   b) manually start tomcat and httpd every time I boot
 or
  c) some daemon process is still initializing and I need to ensure that it is 
done

What the HAY Wisdom appreciated!


linking (limiting???)

2013-12-15 Thread Ray Holme
I am a Linux user and love linking things to reduce copies.

Apache/Tomcat (by default) does not allow symbolic linking (nice as it can 
cross mounted file systems) except in the top apache/lib directory. I use hard 
links in the Application/WEB-INF/lib directories to reduce copying and help me 
manage things.

HOWEVER, some applications have special needs - e.g. pictures. You don't want 
to always distribute these with the release of the application (Application.war 
file), so symbolic links are the way to go (except for MS land, sorry). The 
nice solution to this is:
.../webapps/Application/WEB-INF/context.xml
which must contain at least the two below lines:

?xml version=1.0 encoding=UTF-8?
Context allowLinking=true /Context


However this allows ALL symbolic linking in the Application directory. I agree 
with the developers that this is dangerous.

Is there some way to allow linking in just ONE sub-directory of the 
Application?? - e.g.

.../webapps/Application/images

This would allow all I need to have local images for the application without 
endangering other things using a symbolic link.


slim and trim tomcat - which java is needed

2013-12-15 Thread Ray Holme
I have discovered that under the conf/localhost and webapps directories, all of 
the release directories and xml files can be removed, leaving just the 
application(s) you want running. I could b wrong but I think this also closes 
some possible security issues, besides keeping a smart-cookie from playing with 
the examples ...

However I am totally unclear which (if any) java pieces need to be on a 
distribution machine. Obviously a source machine needs the Java JDK. On a 
distribution machine, apache compiles JSP code initially so it needs something.

One person told me the JRE should be enough, but another said that 
Apache/Tomcat actually comes with it's own compiler, and yet another says to 
have the JDK.  On my Fedora-18 distribution (before I put in the JDK), there is 
at least one java compiler (/etc/alternatives/javac).

So do we need the JRE or the JDK or can Tomcat work without either on a 
non-sofware development box???


Re: slim and trim tomcat - which java is needed

2013-12-15 Thread Ray Holme
Thanks Chuck for hitting the nail on the head - I should have read that first.





On Sunday, December 15, 2013 11:56 AM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:
 
 From: Ray Holme [mailto:rayho...@yahoo.com] 

 Subject: slim and trim tomcat - which java is needed

 So do we need the JRE or the JDK or can Tomcat work without either on 
 a non-sofware development box???

Read the RUNNING.txt file in the standard Tomcat distribution.  If you're using 
a third-party repackaged version, you'll need to contact the supplier of that 
version.  Strongly recommend that you use real Tomcat download, since the 
third-party ones often turn things into mush.

You should also look at this:
http://tomcat.apache.org/tomcat-7.0-doc/security-howto.html

And the security-related items here:
http://wiki.apache.org/tomcat/HowTo

- 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: linking (limiting???)

2013-12-15 Thread Ray Holme
Hmmm - I use JNDI for connections and you lost me with extra paths - although 
it appears this is exactly what I want.


Context path=/mywebapp docBase=/Users/theuser/mywebapp/src/main/webapp  
Resources className=org.apache.naming.resources.VirtualDirContext 

extraResourcePaths=/WEB-INF/classes=/Users/theuser/mywebapp/target/classes,/pictures=/Users/theuser/mypictures,/movies=/Users/theuser/mymovies/Context
 path=/mywebapp docBase=/Users/theuser/mywebapp/src/main/webapp  
Resources className=org.apache.naming.resources.VirtualDirContext 

extraResourcePaths=/WEB-INF/classes=/Users/theuser/mywebapp/target/classes,/pictures=/Users/theuser/mypictures,/movies=/Users/theuser/mymovies/

This is exactly what I was thinking, I will start digging to learn how to use 
properly.


Thanks Mark




On Sunday, December 15, 2013 4:53 PM, Martin Gainty mgai...@hotmail.com wrote:
 

  


 Date: Sun, 15 Dec 2013 12:41:55 -0800
 From: its_toas...@yahoo.com
 To: users@tomcat.apache.org
 Subject: Re: linking (limiting???)
 
 On 12/15/2013 8:34 AM, Ray Holme wrote:
  I am a Linux user and love linking things to reduce copies.
 
  Apache/Tomcat (by default) does not allow symbolic linking (nice as
  it can cross mounted file systems) except in the top apache/lib
  directory. I use hard links in the Application/WEB-INF/lib
  directories to reduce copying and help me manage things.
 
  HOWEVER, some applications have special needs - e.g. pictures. You
  don't want to always distribute these with the release of the
  application (Application.war file), so symbolic links are the way to
  go (except for MS land, sorry). The nice solution to this is:
  .../webapps/Application/WEB-INF/context.xml which must contain at
  least the two below lines:
 
  ?xml version=1.0 encoding=UTF-8? Context allowLinking=true
  /Context
 
 
  However this allows ALL symbolic linking in the Application
  directory. I agree with the developers that this is dangerous.
 
  Is there some way to allow linking in just ONE sub-directory of the
  Application?? - e.g.
 
  .../webapps/Application/images
 
  This would allow all I need to have local images for the application
  without endangering other things using a symbolic link.
 
 
 If you use Tomcat 7, read the following:
 
 http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Resource_Definitions

MG...Mark I assume you're referring to Virtual DirContext...?
Context path=/mywebapp docBase=/Users/theuser/mywebapp/src/main/webapp  
Resources className=org.apache.naming.resources.VirtualDirContext 

extraResourcePaths=/WEB-INF/classes=/Users/theuser/mywebapp/target/classes,/pictures=/Users/theuser/mypictures,/movies=/Users/theuser/mymovies/
MG

 . . . just my two cents
 /mde/
MGThanks Mark, 

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

Re: timing is everything when starting - a 32 bit question

2013-12-15 Thread Ray Holme
OK, the init.d script was probably very old and it looks like I need to learn 
systemd control.

Did not check apache/logs as there was no sign the script ran, thanks will look 
there too.

yes built and installed mod_jk - the app works fine when I do get it going, yes 
running SELinux

so - time to dig into systemd scripts (after working with Unix BSD and Sys5 for 
years, I guess I am too used to doing things the old way. argh!!!

My approach would be the following:

1. Create an unprivileged user to run Tomcat
2. Install Tomcat from tomcat.apache.org for this user
3. Create a systemv init script - use tomcat-systemv contents as a guide
4. Wrap the init script in a service file.
5. Use systemctl enable or disable as other systemd services

The init script for Tomcat is pretty ugly - mine's around 575 lines for 
Tomcat 6 or 7 and CentOS 6.5. The scripts are pretty defensive, which 
accounts for most of the length.

1-3 are DONE. Yes my script is not quite that long but it is VERY defensive.
Time to wrap it in systemd and learn that.

Thanks for the pointers.





On Sunday, December 15, 2013 3:26 PM, Mark Eggers its_toas...@yahoo.com wrote:
 

Some inline and some at the end:

Note, this is almost all off-topic, since it concerns system 
administration and not Tomcat.

Note, I'm also comparing this to Fedora 19. Fedora 18 should be EOL in 
about 5 weeks.

On 12/15/2013 7:51 AM, Ray Holme wrote:
 I have a rc.local file setup to auto start tomcat and httpd under fedora 18 
 boot.
 It works fine on my 64 bit system (and a couple others for a friend)
    but there MUST BE a sleep before bringing up httpd (for some reason I 
forgot).

 start routine in /etc/init.d/rc.local
     S95tomcat start
     (sleep 10; S96httpd  start) 
     date  /tmp/last_start

 stop routine
     S96httpd stop
     S95tomcat stop
     date  /tmp/last_stop            # not meaningful unless testing rc.local 
as boot wipes /tmp

 for the record S96httpd is a link to /etc/init.d/httpd

There is no /etc/init.d/httpd script on Fedora 19. Where did you get 
this script?

             and S95tomcat is a script I wrote which does some extra things 
besides calling the
                 official release apache/tomcat up/down scripts

 I also have a portable 32bit fedora 18 box. After installing all the pieces, 
 I have tomcat/httpd working fine, BUT
 they WILL NOT START FROM THE BOOT up like the 64 bit systems do.

Don't do this.

Fedora 19 uses systemd. The HTTPD package comes with a
/usr/lib/systemd/system/httpd.service file that works just fine to 
control Apache HTTPD.


 I have tried putting more and longer sleeps in place (before tomcat as well 
 as httpd). All to no avail.

 BUT WHEN I TYPE IN rc.local start AS ROOT, ALL COMES UP FINE.
    (after logging into the desktop as me and becoming root with su) in a 
command tool

 The only visible difference I have found is in the httpd log
 Tomcat's failure is lost or I have not found it yet (yes I looked in 
 /var/log/messages where I would expect it).

Any logging should happen in catalina.out (unless you've done some 
changes to a stock Tomcat). That location is dependent on where / how 
you've installed Tomcat.


 --- so here is the /var/log/httpd/error_log after a boot - not sure if the 
 first two lines are errors, but the third is
    (timestamps shortened up for this note)

 [12/15/2013] [core:notice] [pid 1686] SELinux policy enabled; httpd running 
 as context system_u:system_r:httpd_t:s0
 [12/15/2013] [suexec:notice] [pid 1686] AH01232: suEXEC mechanism enabled 
 (wrapper: /usr/sbin/suexec)
 [12/15/2013] [jk:emerg] [pid 1686] Error in reading worker properties from 
 '/etc/httpd/conf/workers.properties'
 AH00016: Configuration Failed


 - and now for the AFTER I boot and run rc.local start as root - note 
 line 1 has different RUNTIME PERMISSIONS

 [12/15/2013] [core:notice] [pid 2302] SELinux policy enabled; httpd running 
 as context unconfined_u:system_r:unconfined_t:s0-s0:c0.c1023
 [12/15/2013] [suexec:notice] [pid 2302] AH01232: suEXEC mechanism enabled 
 (wrapper: /usr/sbin/suexec)
 [12/15/2013] [auth_digest:notice] [pid 2303] AH01757: generating secret for 
 digest authentication ...
 [12/15/2013] [lbmethod_heartbeat:notice] [pid 2303] AH02282: No slotmem from 
 mod_heartmonitor
 [12/15/2013] [mpm_prefork:notice] [pid 2303] AH00163: Apache/2.4.6 (Fedora) 
 mod_jk/1.2.37 configured -- resuming normal operations
 [12/15/2013] [core:notice] [pid 2303] AH00094: Command line: '/usr/sbin/httpd'



Looks at first glance like an SELinux problem. Do you have SELinux 
enabled? Hopefully you do. If you're using an old / custom script for 
HTTPD, then it may or may not account for SELinux.

Also, how did you install mod_jk, and what is the content of your 
workers.properties file?

BTW, I normally put workers.properties in /etc/httpd/conf.d instead of 
the main /etc/httpd/conf.


 --
 So I am guessing here below - anyone please correct.

    Either

Re: Strange compilation dates for JSPS

2013-02-12 Thread Ray Holme
OK, now it all makes sense. Thanks for opening my eyes. The comments in the 
.java file say it ALL.




 From: Konstantin Kolinko knst.koli...@gmail.com
To: Tomcat Users List users@tomcat.apache.org 
Sent: Tuesday, February 12, 2013 10:57 AM
Subject: Re: Strange compilation dates for JSPS
 
2013/2/12 Ray Holme rayho...@yahoo.com:
 While debugging a problem in Tomcat 7.0.35 (just upgraded), I noted OLD files 
 in the work/Catalina/localhost/APP/org/apache/jsp directory.

 I thought I had cleaned things out to make sure all was rebuilt. So I 
 manually stopped tomcat; manually cleaned the directory (rm -rf *); and 
 restarted.

 Lo and behold things were regenerated again (as expected) but the dates were 
 MOST peculiar.

 My system date is 2/12/2013 (today) but all the .java and .class files 
 generated show 2/28/2012.

 I have two questions:

    WHY is this back-dated? (this seems counter productive and not helpful to 
the user trying to figure things out)

    HOW is this back-dated? (I don't even know how to back date a file myself 
- I know tar does this but have never figured out how to do it)
                (and yes I have been using Unix and Linux a long time)

https://issues.apache.org/bugzilla/show_bug.cgi?id=33453
Implemented in 7.0.17

You may read a comment at the top of generated *.java files there.

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

Re: upgraded fedora and mod_jk will not work

2012-03-24 Thread Ray Holme
Andre and all - problem fixed.

Since the only thing that REALLY changed was Fedora 14 - Fedora 16, I should 
have guessed it was not in httpd or tomcat.

The problem was fedora's over fastidious security policies. It was fedora that 
was stopping the shared memory writes and fedora that was stopping read access 
to this and that.

I cleared about 20 troubleshooter problems and all web applications work fine 
with no more complaints about shared memory writing 

Thanks to you all (and thanks to my sub-conscious which woke me up at 2am to 
say - LOOK AT FEDORA fool).

:=]

PS - I hate these new hidden security policies. It is really hard to see what 
is happening and figure what to fix (even with the help you get from the 
troubleshooter).




 From: André Warnier a...@ice-sa.com
To: Tomcat Users List users@tomcat.apache.org 
Sent: Friday, March 23, 2012 1:33 PM
Subject: Re: upgraded fedora and mod_jk will not work
 
Ray Holme wrote:
 I have recently upgraded from Fedora 14 to Fedora 16. I am testing 4 tomcat 
 applications on the local web (and one plain apache app.) on one box (no 
 other tricks like multiple servers ...). The below should pretty well 
 describe everything I think matters.
 
 I was running Tomcat 6.0.29 and then 6.0.35 on Fedora 14 and am now trying 
 the latter on 16 - there were no changes in the apache-tomcat directory for 
 the new release (NONE _ just restored it and tomcat comes up with it's normal 
 chatter). Nut my release is pretty vanilla - after unpacking the gzip'd 
 tomcat tar file I added the 4 webapps; the .xml files for each under 
 conf/Catalina ... and added the DB driver .jar to the lib directory (symbolic 
 linked) - then it worked fine (under fedora 14)
 
 I downloaded and built the newest mod_jk.so (tomcat-connectors-1.2.33) from 
 src (had to strip final binary to make it work at all - not mentioned). I 
 still have the old one if need be and yes I tried it too.
 
 I installed the mod_jk.so in /usr/lib64/httpd/modules with the rest of them 
 (the Apache mod_jk online docs seems a little old here but were helpful).
 
 I modified the workers.properties (removed cache stuff which apache 
 complained of as dead). Here is what I have left:
 
 ---
 # workers.properties - ajp13
 workers.tomcat_home=/opt/apache  -- obsolete, delete line
 workers.java_home=/usr/java/jdk  -- obsolete, delete line
 ps=/  - maybe obsolete too, don't remember
 #
 # List workers
 worker.list=wrkr
 #
 # Define wrkr
 worker.wrkr.port=8009
 worker.wrkr.host=localhost
 worker.wrkr.type=ajp13
 worker.wrkr.socket_timeout=300   -- I wouldn't do that, unless you have a 
 specific reason to specify this.

 ---
 
 I have an /etc/rc.d/rc.local file which should bring up httpd, THEN tomcat. 
 Tomcat comes up fine (the logs look fine), but httpd never comes up till I 
 manually run the same script after login. I know the script ran from boot 
 time but it leaves NO complaints as I added an echo line to it and a clean 
 script for /etc/httpd/logs which did definitely run (until I am up, I want 
 fresh error files, maybe even after that).
 
Not sure I understand all of that, but it doesn't seem to be a Tomcat problem.
You should try to find out why httpd doesn't start when run from the boot 
script during boot.  Maybe you are trying to access something that the boot 
environment doesn't have yet, but that is available later when you run it by 
hand ? (like some filesystem which only gets mounted later on ?)

 Question 1: is the order right? (httpd then tomcat)
             or should I bring up tomcat before httpd??

Probably better tomcat first.  Otherwise, if a request comes in, Apache+mod_jk 
will try to connect to tomcat, tomcat won't be there yet, and you'll get errors.

             pause between?

Depends how long Tomcat and your applications need to start up and be ready to 
answer requests.

          1.1 - is the java home right or should it be /usr/java?
              - these were both dead wrong under fedora 14 (and it worked)
                as it pointed to /usr/java/jdk1.6.something and I have 
/usr/java/jdk1.7..
                and the tomcat_home was wrong too. They are correct now (both 
are symbolic links
                 to the real place so I don't do that again).

Not surprising that it worked while being wrong, because these parameters are 
obsolete and just ignored.

 
 I have carefully modified the http.conf file to be identical to what I had 
 before with identical lines about worker properties. For the sake of 
 completeness - here are the mods to the orginal httpd.conf (minus the comment 
 lines) - I had to add a JkShmFile line to my old conf file to remove one 
 startup complaint from the newer httpd mod_jk.
 
 
 Listen 192.168.101.101:80
 ...
 LoadModule jk_module modules/mod_jk.so
 JkWorkersFi

le /etc/httpd/conf/workers.properties
 JkLogFile /var/log

Re: upgraded fedora and mod_jk will not work

2012-03-24 Thread Ray Holme
PS - the answer to my original question about which linux ports had to be 
enabled is: 80
  (if you want another machine to get at the port) - the other four ports are 
internal and do not need firewall access
  (8005, 8009, 8080, 8443)

over and out on this one.

upgraded fedora and mod_jk will not work

2012-03-23 Thread Ray Holme
I have recently upgraded from Fedora 14 to Fedora 16. I am testing 4 tomcat 
applications on the local web (and one plain apache app.) on one box (no other 
tricks like multiple servers ...). The below should pretty well describe 
everything I think matters.

I was running Tomcat 6.0.29 and then 6.0.35 on Fedora 14 and am now trying the 
latter on 16 - there were no changes in the apache-tomcat directory for the new 
release (NONE _ just restored it and tomcat comes up with it's normal chatter). 
Nut my release is pretty vanilla - after unpacking the gzip'd tomcat tar file I 
added the 4 webapps; the .xml files for each under conf/Catalina ... and added 
the DB driver .jar to the lib directory (symbolic linked) - then it worked fine 
(under fedora 14)

I downloaded and built the newest mod_jk.so (tomcat-connectors-1.2.33) from src 
(had to strip final binary to make it work at all - not mentioned). I still 
have the old one if need be and yes I tried it too.

I installed the mod_jk.so in /usr/lib64/httpd/modules with the rest of them 
(the Apache mod_jk online docs seems a little old here but were helpful).

I modified the workers.properties (removed cache stuff which apache complained 
of as dead). Here is what I have left:

---
# workers.properties - ajp13
workers.tomcat_home=/opt/apache
workers.java_home=/usr/java/jdk
ps=/
#
# List workers
worker.list=wrkr
#
# Define wrkr
worker.wrkr.port=8009
worker.wrkr.host=localhost
worker.wrkr.type=ajp13
worker.wrkr.socket_timeout=300
---

I have an /etc/rc.d/rc.local file which should bring up httpd, THEN tomcat. 
Tomcat comes up fine (the logs look fine), but httpd never comes up till I 
manually run the same script after login. I know the script ran from boot time 
but it leaves NO complaints as I added an echo line to it and a clean script 
for /etc/httpd/logs which did definitely run (until I am up, I want fresh error 
files, maybe even after that).

Question 1: is the order right? (httpd then tomcat)
    or should I bring up tomcat before httpd??
    pause between?
 1.1 - is the java home right or should it be /usr/java?
 - these were both dead wrong under fedora 14 (and it worked)
   as it pointed to /usr/java/jdk1.6.something and I have 
/usr/java/jdk1.7..
   and the tomcat_home was wrong too. They are correct now (both 
are symbolic links
    to the real place so I don't do that again).

I have carefully modified the http.conf file to be identical to what I had 
before with identical lines about worker properties. For the sake of 
completeness - here are the mods to the orginal httpd.conf (minus the comment 
lines) - I had to add a JkShmFile line to my old conf file to remove one 
startup complaint from the newer httpd mod_jk.


Listen 192.168.101.101:80
...
LoadModule jk_module modules/mod_jk.so
JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel info
JkShmFile   /etc/httpd/logs/jk.shm
JkLogStampFormat [%a %b %d %H:%M:%S %Y] 
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat %w %V %T
JkMount /ledger wrkr
JkMount /ledger/* wrkr
### 3 other app line sets like the above 2 lines are cut for brevity


So I start httpd manually now and it says OK, but the log files do not say 
this. Here are the log messages (without the leading dates) and cutting 
duplicates

error_log -
[notice] mod_python: Creating 4 session mutexes based on 256 max processes and 
0 max threads.

Question 2: I suspect this might be OK (in earlier fedora too), why 0 max?
    - zero is small, is this a problem at all?

ssl_error_log-
[warn] RSA server certificate CommonName (CN) `localhost.localdomain' does NOT 
match server name!?

Question 3: Also seen in earlier ssl_error_logs, but I am not using SSL at all 
YET and I don't like errors. I cannot find where it is picking up 
localhost.localdomain at all. I would correct that if I knew. I have tried 
adding this alias on the line with my real hostname in /etc/hosts but that does 
no good. SO, is this a problem? Whether or not it is, can I fix it?

mod_jk.log - THESE ARE ALL NEW TO FEDORA 16 and the real problem I think
[error] init_jk::mod_jk.c (3348): Initializing shm:/etc/httpd/logs/jk.shm.2384 
errno=13. Load balancing workers will not function properly.
...
[info] ajp_connect_to_endpoint::jk_ajp_common.c (992): Failed opening socket to 
(127.0.0.1:8009) (errno=13)
[error] ajp_send_request::jk_ajp_common.c (1621): (wrkr) connecting to backend 
failed. Tomcat is probably not started or is listening on the wrong port 
(errno=13)
[info] ajp_service::jk_ajp_common.c (2614): (wrkr) sending request to tomcat 
failed (recoverable), because of error during request sending (attempt=1)
[info] jk_open_socket::jk_connect.c (627): connect to 127.0.0.1:8009 failed 

Re: upgraded fedora and mod_jk will not work

2012-03-23 Thread Ray Holme


 (had to strip final binary to make it work at all - not mentioned)

What do you mean?

I mean that the built binary was NOT stripped and would not work (apache 
complained about loading it - sorry I forgot the message).

I simply did strip mod_jk.so and the size went down by a factor of 4 and then 
it worked.

WORKED being a kind of funny word in this case. It loaded but did not work.

Re: upgraded fedora and mod_jk will not work

2012-03-23 Thread Ray Holme
Andre - good information. Thanks but still in the weeds here.


 Depends how long Tomcat and your applications need to start up and be ready 
 to answer requests.

makes sense. since httpd is NOT coming up on boot as it should, I will make it 
second
  with a preceding sleep and background the whole thing - maybe that will fix 
it:
    (sleep 10; S96httpd start) 

  THAT WORKS fine. httpd is now up correctly after a boot. YEA!

Not surprising that it worked while being wrong, because these parameters are 
obsolete and just ignored.

:=[ (thanks)

You don't seem to be using load balancing workers, so basically you don't care.
But the error message may indicate that Apache httpd is not able to write that 
file, in that location.
Does that directory even exist ?  (logfiles usually go to somewhere like 
/var/log/*.  /etc/hhtpd/logs is somewhat unusual.)

Thanks again. It turns out that /etc/httpd/logs is a symbolic link to 
/var/httpd/log (feel better?).
However as I did mention later in the original mail message- two files are 
created and are of size 0.
So it can write, but is not happy.
Without the new line about the shared memory in httpd.conf - httpd complained 
even more that it did not like it but would default.
Will correct the line to point directly and not use the link. (no effect, but 
makes better sense to me)

ls -l /var/log/httpd
...
-rw-r--r--. 1 root root    0 Mar 23 09:27 jk-runtime-status.3686
-rw-r--r--. 1 root root    0 Mar 23 09:27 jk-runtime-status.3690
...

I did pull the mod_jk.so release suggested 1.2.32. It also needed to be 
stripped after the install.
But it did not help - see below.

THIS IS THE CRUX OF THE PROBLEM - STILL!
 [info] ajp_connect_to_endpoint::jk_ajp_common.c (992): Failed opening socket 
 to (127.0.0.1:8009) (errno=13)
 [error] ajp_send_request::jk_ajp_common.c (1621): (wrkr) connecting to 
 backend failed. Tomcat is probably not started or is listening on the wrong 
 port (errno=13)
 [info] ajp_service::jk_ajp_common.c (2614): (wrkr) sending request to tomcat 
 failed (recoverable), because of error during request sending (attempt=1)
 [info] jk_open_socket::jk_connect.c (627): connect to 127.0.0.1:8009 failed 
 (errno=13)


That's probably because you start httpd before tomcat, as explained earlier.  
Tomcat has not opened its AJP socket 8009 yet, so httpd+mod_jk cannot connect 
to it.

You could be right, but
  a) these MESSAGES do not happen until both tomcat and httpd are up and I try 
to get to the application in a browser
  b) under prior releases of fedora (14, 12, 8) I was able to start httpd 
hugely later and it worked - no complaints
 (sometimes it came up by itself, sometimes not - I like this rc.local way 
better)

NOPE, in this case you did not hit the ball out of the park. I remain stuck 
with httpd thinking tomcat is NOT talking.
Since I have done almost nothing to configure tomcat as you noticed with ssl, I 
am baffled.

But thanks, you did solve one or two issues and explained a couple more.

Re: tomcat 5 and the JVM

2009-02-02 Thread Ray Holme
thanks - removed
On Mon, 2009-02-02 at 14:46 +0100, Felix Schumacher wrote:
 Hi Ray,
 
 On Mon, February 2, 2009 1:59 pm, Ray Holme wrote:
  I run tomcat 6 on Linux and have multiple applications in development
  mode. From my testing I have discovered that a Java bean shared by all
  applications and with ALL methods as static SEEMS to have  a separate
  instance for each appliction - i.e.
 look at
 http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html
 
  cool, but it means that each application must do a
System.gc()
 If you have to do a System.gc() by yourself, you (most) probably did
 something wrong with your Bean. And be careful with that call. First the
 jvm is free to ignore it. Second it can be a major performance hit. We
 once found an application to call System.gc() with every get|post call. We
 disabled the System.gc() functionality by starting the jvm with 
 -XX:+DisableExplicitGC.
 
 Bye
  Felix
 
 
 -
 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 5 and the JVM

2009-02-02 Thread Ray Holme
thanks - makes sense.

removed the GC call as someone else put it there a long time ago

also removed System.runFinalization()  - assume this is not something to
do in my garbage sweep where I check for other things.

:=]
On Mon, 2009-02-02 at 14:45 +0100, Kees de Kooter wrote:
 Hi Ray,
 
 It is one JVM, but separate classloaders so applications do not see
 classes of other apps.
 
 Oh and please be extremely careful with using System.gc(). Using it
 can lead to severe and unexpected performance issues. If you need
 gc() you almost always have a flaw in your code.
 
 Cheers,
 Kees de Kooter
 http://www.boplicity.net
 
 
 
 On Mon, Feb 2, 2009 at 13:59, Ray Holme rho...@roadrunner.com wrote:
  I run tomcat 6 on Linux and have multiple applications in development
  mode. From my testing I have discovered that a Java bean shared by all
  applications and with ALL methods as static SEEMS to have  a separate
  instance for each appliction - i.e.
 
getDebugLevel() returns 0 from the 2nd application
even if the first has set it to 100
 
  This is useful but contrary to what I would expect. I would expect one
  JVM for all applications. If there is one per application, that too is
  cool, but it means that each application must do a
 
   System.gc()
 
  occasionally and that this routine cannot be done once for all.
 
  So, does someone know for sure - one JVM per Tomcat OR one JVM per app??
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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



tomcat 5 and the JVM

2009-02-02 Thread Ray Holme
I run tomcat 6 on Linux and have multiple applications in development
mode. From my testing I have discovered that a Java bean shared by all
applications and with ALL methods as static SEEMS to have  a separate
instance for each appliction - i.e.

   getDebugLevel() returns 0 from the 2nd application
   even if the first has set it to 100

This is useful but contrary to what I would expect. I would expect one
JVM for all applications. If there is one per application, that too is
cool, but it means that each application must do a

  System.gc()

occasionally and that this routine cannot be done once for all.

So, does someone know for sure - one JVM per Tomcat OR one JVM per app??


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



Tomcat 6 on Linux - session - DB connections and other shared resources

2009-02-01 Thread Ray Holme
I have a few web applications being moved to tomcat. They all share some
commonality - I use Firebird not MySQL; I built my own ConnectionManager
long ago; and all three have an Application wide bean for shared
resources. Each user has a UserInfo bean (whether or not they log in
is important and can be found, but all functions require the common
resources and it is a VERY convenient place to put them) from which
hangs a DB-Connection bean and an Application bean. This enables
resources to be pooled (connections) and shared (Application).

Perhaps due to lack of knowledge, I try get the session's UserInfo
(getAttribute(..)) and on failure intstantiate a new one in hundreds of
servlets and/or JSP servlet codes sets (adding resources as needed).

I am sure that there must be some reasonable way to have all of the
servlets (no matter what form) go through some preliminary code, and
some post processing in order not to write the same code into hundreds
of places (and be sure the post processing routine which frees up
resources is ALWAYS executed).

I have tried to do this with filterchains but am failing so far - due to
ignorance or whatever. I realize that I could modify the source and do
it, but that seems counter productive as this seems like a fairly common
need.



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