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: Skip resource path in TLD scanner?

2017-11-17 Thread Christopher Schultz
-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 property for skipping jar files, but I
 couldn't find one for resource paths. I reported this as a
 bug and was told that the property exists. Where is it?
>>> 
>>> Where have you looked?
>>> 
>>> Mark
>> 
>> -
>>
>>
>
>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
>> 
>> -
>>
>>
>
>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
> 
> 
> -
>
> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional 

Re: Question - Tomcat Memory

2017-11-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Ramya,

On 11/16/17 1:48 PM, Ramya Elineni wrote:
> The "Initial memory pool" and "maximum memory pool" are the two 
> configurations under Tomcat. I couldn't find any detailed
> explanation of how Tomcat uses these settings.

Others have provided feedback about this question already on this thread
.

> I request you to please provide me that informaiotn so that I can 
> have the appropriate values set on a production environment.
Nobody can tell you what those values should be in your environment.
Please see Savendu's reply for why not.

> We are encountering issues where Tomcat is running on the higher
> end of the maximum memory pool configuration after about 25 days of
> its last restart. Thanks.

Is that a problem? If you give Tomcat (really your application) a
64MiB heap and it's using all of that heap, isn't that a good thing?
Memory exists to be used, not to be left empty.

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

iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAloPKPAdHGNocmlzQGNo
cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFiBRQ//f8fvNyOW45tBUfyd
feCXODtpJgtMlg5w3eqWpXuH9zSwV885+NZTl4WG0ILw5yPxrAzaWlwnbsXvtDpy
VScPuA6hi1BX7Mc1HnXddpUEtWizx2kAzSHoly//OTw9L88jEG7ZQ4sjS5h4nMfz
z3BRuJGtg+oQfW+qGOcPwMIcqqJuP/SDGE2jZQ54EhcraLDguTterbWuYHqRcAn8
ZQ9DMav+hV3hqTUfMWkodkldjLoSdcv/fI1FDNhQgblT0LzFgwbSSRrYJbyG7TwV
758zejZfAH/0dJaNbln+Ek1TUceUR7l4OkctAXxA3J1MMqDlcQ7klbINNd/UoCr+
xf/cjhr4XXk2Jex5w4kMdAnF1aYkBoltP3ZSxgpMOZsVGpUey1Yvkh3TPTVOWAZY
ChRNqx78oof3FZ9HzqIbqcmOHY8ASoB88ZIgpiZw8MIAGiKouOnI01cFkAzKDqe0
+MwMjFFl8GPhCg5GvT15ZO4kIMsuBnU7d8aMHbpcieqLQDQft4wRBteB56xsnwxM
fAea7DF2bbzZ3foEkl67HDYvpDhhBXybKAQfTE0M1ciY7enx2cjQeOtniJhCp0Z4
c8OTONO/rPYgvRY1zy0wuzxykjj7peDQm18dJwebX6APiVS8GmNX9JJ+Qvr4dtx+
D/HnnPRkbpMa0epZo7AKoYNyCAw=
=dzXN
-END PGP SIGNATURE-

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



Re: Tomcat Xml parser issue

2017-11-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Vicky,

On 11/16/17 1:30 PM, Vicky B wrote:
> Thanks but the same war works fine is WebSphere and tomcat on
> Windows it is just tomcat provided by  Redhat which work different
> i.e it throws the exception

My guess is that something in your Windows environment causes the JRE
to establish the JRE-provided XML parser as the system parser *before*
your code takes over and bootstraps something else.

This is not a Tomcat problem. This is not a Linux problem. It's a
problem with the interaction of one of your libraries and what should
be a system-provided XML parser.

- -chris

> On Nov 16, 2017 11:39 PM, "Christopher Schultz" < 
> ch...@christopherschultz.net> wrote:
> 
> Vicky,
> 
> On 11/16/17 12:24 PM, Vicky B wrote:
 It is XML parser (DOM and SAX ) from oracle (doc 
 
 
2.htm>)
 
 
> .
> 
> Why do you need a custom XML parser? Why not simply use the one 
> bundled with the JRE?
> 
 Why is tomcat using XMLparserv2
> 
> Where is the xmlparserv2.jar file? Some badly-behaved libraries 
> install themselves as the "system" parser when they are used even
> if they aren't being loaded by the system or application (which
> doesn't mean YOUR application) ClassLoader. If that happens, you
> can get weird problems like this.
> 
 tomcat we have in linux machine is from redhat . Why does
 tomcat downloaded from apache tomcat site work different form
 the one provided by REDHat.
> 
> Package managers often make adjustments that make sense for their 
> environments. I suspect that this problem has less to do with
> RedHat's Tomcat package and more to do with how you deploy your
> application, its libraries, etc.
> 
 how does class loading work in tomcat.
> 
> Tomcat sets up a ClassLoader for itself to work in. For each
> webapp, a separate ClassLoader is created for them to work in with
> the Tomcat server ClassLoader as the parent. But the webapp's
> ClassLoader is a "child-first" ClassLoader meaning that classes and
> libraries bundled with the application are preferred when code is
> executing in the application's context.
> 
> If you had told us your Tomcat version (or anything else about
> your environment), we might have been able to help more, but you
> aren't providing much in the way of information.
> 
> Assuming Tomcat 8.0 (because why not?), here is the explanation
> for how class loading works in Tomcat. Almost as if someone was
> /trying/ to make that information available for people looking for
> it.
> 
> https://tomcat.apache.org/tomcat-8.0-doc/class-loader-howto.html
> 
> -chris
> 
 On Thu, Nov 16, 2017 at 8:15 PM, Christopher Schultz < 
 ch...@christopherschultz.net> wrote:
 
 Vicky,
 
 On 11/16/17 6:53 AM, Vicky B wrote:
>>> Hi All,
>>> 
>>> I have application which is using spring , ESAPI and
>>> oracle xmlparserv2.jar , this application works fine in
>>> my local tomcat on windows  but when i deployed in
>>> linux server with linux based apache tomcat i got below
>>> error when spring container  was trying to parse
>>> application specific xmls
>>> 
>>> org.apache.catalina.core.StandardContext.listenerStart 
>>> Exception sending context initialized event to
>>> listener instance of class 
>>> org.springframework.web.context.ContextLoaderListener
>>> 
>>> org.springframework.beans.factory.BeanDefinitionStoreException:
>>>
>>>
>
>>> 
Parser configuration exception parsing XML from class path
>>> resource [spring/spring-context.xml]; nested exception
>>> is javax.xml.parsers.ParserConfigurationException:
>>> Unable to validate using XSD: Your JAXP provider 
>>> [oracle.xml.jaxp.JXDocumentBuilderFactory@526ad194]
>>> does not support XML Schema. Are you running on Java
>>> 1.4 with Apache Crimson? Upgrade to Apache Xerces (or
>>> Java 1.5) for full XSD support.
>>> 
>>> 
>>> when i removed xmlparserv2.jar from my war file the 
>>> application worked fine , what is the issue is this due
>>> to class loading issue or could be possible reason for
>>> this issue . Does tomcat provide xml parser which
>>> spring loads.
 
 What is xmlparserv2.jar?
 
 -chris
> 
> --
- ---
>
>
>
> 
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
>> 
>> 
> 
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/


Re: ISAPI and IIS 10 Logging Issue

2017-11-17 Thread Mark Thomas
On 17/11/17 15:47, jumiller wrote:
> I finally managed to figure out what the issue is/was.  The
> c:\windows\system32\inetsrv\config\applicationHost.config file has a
> definition for IsapiFilter in the  overrideMode="Allow"> section.  The
> IsapiFilterModule needs to be before the HttpLoggingModule in the list. 
> I've made this change on all of my Windows 2016 servers where logging wasn't
> working and they're all happy now, logging correctly.

Thanks for letting us know how you solved this.

Mark

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



Re: ISAPI and IIS 10 Logging Issue

2017-11-17 Thread jumiller
I finally managed to figure out what the issue is/was.  The
c:\windows\system32\inetsrv\config\applicationHost.config file has a
definition for IsapiFilter in the  section.  The
IsapiFilterModule needs to be before the HttpLoggingModule in the list. 
I've made this change on all of my Windows 2016 servers where logging wasn't
working and they're all happy now, logging correctly.




--
Sent from: http://tomcat.10.x6.nabble.com/Tomcat-User-f1968778.html

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