Re: 8.5.4 to 8.5.5 SSL Issue

2016-10-21 Thread William Boyd
On Fri, Oct 21, 2016 at 2:05 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> William,
>
> On 10/21/16 4:37 PM, William Boyd wrote:
> > Hello,
> >
> > I am attempting to upgrade from Tomcat 7 to 8.5.6. Everything was
> > working great until I enabled SSL with a self-signed certificate. I
> > am able to recreated the issue on 8.5.5. I finally had to down
> > graded to 8.5.4 to get SSL working with identical configuration and
> > cert.
> >
> > I want to be sure that this is not a known issue and that I'm not
> > doing something wrong before I create a bug report.
> >
> > Server version:Apache Tomcat/8.5.5 64-bit OS Name:
> > Windows 7 JVM Version:   1.8.0_102-b14
> >
> > The cert was generated with this command: keytool -genkeypair
> > -keyalg RSA -alias tomcat -keystore "C:/keys/keystore.jsk"
> > -storepass changeit -validity 360 -keysize 2048 -dname
> > CN=localhost,OU=ITS,O=Co,L=City,ST=AB,C=CA
> >
> > Configuration includes adding
> > -Djavax.net.ssl.trustStore=c:/keys/keystore.jsk to JAVA_OPTS
>
> I think this might be the problem. Tomcat doesn't use
> javax.net.ssl.trustStore except as a backup in case you haven't
> specified a trust store in your . You have pointed that
> system property at a keystore, not a trust store. Technically, they
> are the same format, but they are used for different things.
>
> If you need that for making your own outgoing TLS connections then
> leave it in there and we'll try to get it to work, otherwise it's just
> confusing and might cause Tomcat to do weird things.
>
> > and using this connector config
> >
> >  > connectionTimeout="6" maxThreads="200" minSpareThreads="4"
> > enableLookups="false" compression="on" server="Apache"
> > scheme="https" secure="true" SSLEnabled="true"
> > keystoreFile="c:/keys/keystore.jsk" keystorePass="changeit"
> > keyAlias="tomcat" clientAuth="false" sslProtocol="TLS"/>
>
> Looks good so far.
>
> > Here is the exception I get at startup
> >
> > 13-Oct-2016 15:05:17.309 SEVERE [main]
> > org.apache.coyote.AbstractProtocol.init Failed to initialize end
> > point associated with ProtocolHandler ["https-openssl-nio-8001"]
> > java.lang.IllegalArgumentException:
> > java.security.InvalidAlgorithmParameterException: the trustAnchors
> > parameter must be non-empty at
> > org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(Abstr
> actJsseEndpoint.java:103)
> >
> >
> at
> > org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(Abstract
> JsseEndpoint.java:81)
> >
> >
> at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:244)
> > at
> > org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java
> :866)
> >
> >
> at
> > org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpo
> int.java:213)
> >
> >
> at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:575)
> > at
> > org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Pro
> tocol.java:65)
> >
> >
> at org.apache.catalina.connector.Connector.initInternal(Connector.java:9
> 44)
> > at
> > org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
> >
> >
> at
> > org.apache.catalina.core.StandardService.initInternal(StandardService.
> java:549)
> >
> >
> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
> > at
> > org.apache.catalina.core.StandardServer.initInternal(StandardServer.ja
> va:873)
> >
> >
> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
> > at org.apache.catalina.startup.Catalina.load(Catalina.java:606) at
> > org.apache.catalina.startup.Catalina.load(Catalina.java:629) at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:62)
> >
> >
> at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.java:43)
> >
> >
> at java.lang.reflect.Method.invoke(Method.java:498)
> > at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)
> > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
> > Caused by: java.security.InvalidAlgorithmParameterException: the
> > trustAnchors parameter must be non-empty at
> > java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:
> 200)
> >
> >
> at java.security.cert.PKIXParameters.(PKIXParameters.java:157)
> > at
> > java.security.cert.PKIXBuilderParameters.(PKIXBuilderParameters.
> java:130)
> >
> >
> at
> > org.apache.tomcat.util.net.jsse.JSSEUtil.getParameters(JSSEUtil.java:3
> 41)
> >
> >
> at
> > org.apache.tomcat.util.net.jsse.JSSEUtil.getTrustManagers(JSSEUtil.jav
> a:273)
> >
> >
> at
> > org.apache.tomcat.util.net.openssl.OpenSSLUtil.getTrustManagers(OpenSS
> LUtil.java:93)
> >
> >
> at
> > org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(Abstr
> actJsseEndpoint.java:101)
> >
> >
> ... 20 more
>
> Tomcat is choking when trying to load the trust 

Re: Strange wait time in my application - Tomcat 7.0.67

2016-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Tullio,

On 10/17/16 12:24 PM, Tullio Bettinazzi wrote:
> I monitored it using Yourkit profiler and I didn't see any extreme 
> GC.
> 
> I noticed anotehr thing : looking for 4 users which had the
> problem they seems to have the problem "in sequence".
> 
> The first user "stops" for 4 seconds then another one "stops" and
> so on : they don't seem to stop at the sam time (as it would be
> expected in case of GC) but in sequence.

My first reaction is that this has to be a database issue. Are you
using a traditional RDBMS under the hood? Can you look for
long-running queries on the db? Maybe you have a table that is being
locked during a transaction which is holding-up users.

Maybe you have a database connection pool without enough connections
in it.

During times of heavy traffic, when you have users "stalling", what
does a thread dump show you?

- -chris

>  Da: André Warnier (tomcat)
>  Inviato: lunedì 17 ottobre 2016 18.01 A:
> users@tomcat.apache.org Oggetto: Re: Strange wait time in my
> application - Tomcat 7.0.67
> 
> On 17.10.2016 17:52, Tullio Bettinazzi wrote:
>> I didn't find any solution to my problem.
>> 
>> Could someone provide suggestions or a strategy to find the
>> solution ?
>> 
> 
> "I don't see relevant garbage collection : heap size and permgen
> have correct dimentions."
> 
> Define "correct".  Are you really *logging* the JVM Garbage
> Collection, and do you *know* that this is not the issue ?
> 
> (Note that 4 seconds seems an awfully long time for a GC; but one
> would want to eliminate this with certainty, before looking any
> further).
> 
> 
>> 
>> 
>>  Da: Martijn Bos
>>  Inviato: lunedì 3 ottobre 2016 21.05 A: Tomcat
>> Users List Oggetto: Re: Strange wait time in my application -
>> Tomcat 7.0.67
>> 
>> On 2016-10-03 07:56:34, Tullio Bettinazzi wrote:
>>> I've an application under tomcat. When only a one or two users
>>> works on it everithing is ok. When the number of users grows
>>> the application slows down. Is not a memory nor a cpu problem :
>>> using top I see the system resources quite free. I don't see
>>> relevant garbage collection : heap size and permgen have
>>> correct dimentions. No other applications are running on the
>>> system. I log more or less every relevant operation in my
>>> system (db query and so on) and I see that every slowdown is
>>> concentered in a single operation. I mean all operations take
>>> "normal" time but one or two of them take 4 seconds more. The
>>> "slowing" operations are not the same in different executions,
>>> and theydo not have a specific type (not only DB query, not
>>> only DB stored procedures, not only.). It seems like if the
>>> thread is frozen for a fixed amount fo time (4 seconds more or
>>> less) and then it restarts. I don't think it's a "queue"
>>> problem because otherwise the wait time would be unperdictable
>>> and not a "fixed" 4 seconds time. I don't know any parameter
>>> impacting on that behaviour. I use Tomcat 7.0.32 with JVM
>>> 1.7.0.67 on a Linux server. Could someone suggest a solution
>>> for my problem or, at least, an investigation strategy. Tks
>>> 
>>> Tullio
>>> 
>> 
>> 
>> The few examples that you mention are all database related
>> (query/stored procedure). Can it be that your connection pool (if
>> used) combined with not closing connections is part of the
>> problem.
>> 
>> I can imagine : 1) Maybe you run out of conenctions, because
>> connections are not properly closed. And also the connection pool
>> teminates connections when they are not used for 4 seconds. After
>> 4 seconds the pool can recreate connections again.
>> 
>> or 2) Maybe your connection pool has very limited connections. 
>> With one or two users this limited number of connections in the
>> pool will suffice. If there are more users, the max. number of
>> connections isn't enough. The pool then has to wait for
>> connections to become fee again.
>> 
>> 
>> (uhhI'm not an expert at all, but the above came immediately
>> to my mind)
>> 
>> -- Met vriendelijke groet,
>> 
>> Martijn Bos +31 6 39477001
>> 
>> (Public pgp-key : http://maboc.nl/pubkey.maboc.asc)
> maboc.nl maboc.nl -BEGIN PGP
> PUBLIC KEY BLOCK- Version: GnuPG v1
> mQENBFJ6LpgBCADL9w2eicatZKiw4xijCVC8WZpcPOr2So6jFfQ6nWk3bTXoVsHk
> sYgdLIFeCn9Wn+EeC+CSoosyMcUeijKH5yVqc/mcg0 ...
> 
> 
> 
>> maboc.nl
> maboc.nl maboc.nl -BEGIN PGP
> PUBLIC KEY BLOCK- Version: GnuPG v1
> mQENBFJ6LpgBCADL9w2eicatZKiw4xijCVC8WZpcPOr2So6jFfQ6nWk3bTXoVsHk
> sYgdLIFeCn9Wn+EeC+CSoosyMcUeijKH5yVqc/mcg0 ...
> 
> 
> 
>> maboc.nl -BEGIN PGP PUBLIC KEY BLOCK- Version: GnuPG v1
>> mQENBFJ6LpgBCADL9w2eicatZKiw4xijCVC8WZpcPOr2So6jFfQ6nWk3bTXoVsHk
>> sYgdLIFeCn9Wn+EeC+CSoosyMcUeijKH5yVqc/mcg0 ...
>> 
>> 
>> 
>> 
> 
> 

Re: 8.5.4 to 8.5.5 SSL Issue

2016-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

William,

On 10/21/16 4:37 PM, William Boyd wrote:
> Hello,
> 
> I am attempting to upgrade from Tomcat 7 to 8.5.6. Everything was
> working great until I enabled SSL with a self-signed certificate. I
> am able to recreated the issue on 8.5.5. I finally had to down
> graded to 8.5.4 to get SSL working with identical configuration and
> cert.
> 
> I want to be sure that this is not a known issue and that I'm not
> doing something wrong before I create a bug report.
> 
> Server version:Apache Tomcat/8.5.5 64-bit OS Name:
> Windows 7 JVM Version:   1.8.0_102-b14
> 
> The cert was generated with this command: keytool -genkeypair
> -keyalg RSA -alias tomcat -keystore "C:/keys/keystore.jsk"
> -storepass changeit -validity 360 -keysize 2048 -dname
> CN=localhost,OU=ITS,O=Co,L=City,ST=AB,C=CA
> 
> Configuration includes adding 
> -Djavax.net.ssl.trustStore=c:/keys/keystore.jsk to JAVA_OPTS

I think this might be the problem. Tomcat doesn't use
javax.net.ssl.trustStore except as a backup in case you haven't
specified a trust store in your . You have pointed that
system property at a keystore, not a trust store. Technically, they
are the same format, but they are used for different things.

If you need that for making your own outgoing TLS connections then
leave it in there and we'll try to get it to work, otherwise it's just
confusing and might cause Tomcat to do weird things.

> and using this connector config
> 
>  connectionTimeout="6" maxThreads="200" minSpareThreads="4" 
> enableLookups="false" compression="on" server="Apache" 
> scheme="https" secure="true" SSLEnabled="true" 
> keystoreFile="c:/keys/keystore.jsk" keystorePass="changeit" 
> keyAlias="tomcat" clientAuth="false" sslProtocol="TLS"/>

Looks good so far.

> Here is the exception I get at startup
> 
> 13-Oct-2016 15:05:17.309 SEVERE [main] 
> org.apache.coyote.AbstractProtocol.init Failed to initialize end
> point associated with ProtocolHandler ["https-openssl-nio-8001"] 
> java.lang.IllegalArgumentException: 
> java.security.InvalidAlgorithmParameterException: the trustAnchors 
> parameter must be non-empty at 
> org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(Abstr
actJsseEndpoint.java:103)
>
> 
at
> org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(Abstract
JsseEndpoint.java:81)
>
> 
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:244)
> at 
> org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java
:866)
>
> 
at
> org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpo
int.java:213)
>
> 
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:575)
> at 
> org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Pro
tocol.java:65)
>
> 
at org.apache.catalina.connector.Connector.initInternal(Connector.java:9
44)
> at
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
>
> 
at
> org.apache.catalina.core.StandardService.initInternal(StandardService.
java:549)
>
> 
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
> at 
> org.apache.catalina.core.StandardServer.initInternal(StandardServer.ja
va:873)
>
> 
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
> at org.apache.catalina.startup.Catalina.load(Catalina.java:606) at
> org.apache.catalina.startup.Catalina.load(Catalina.java:629) at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
ava:62)
>
> 
at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
orImpl.java:43)
>
> 
at java.lang.reflect.Method.invoke(Method.java:498)
> at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311) 
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494) 
> Caused by: java.security.InvalidAlgorithmParameterException: the 
> trustAnchors parameter must be non-empty at 
> java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:
200)
>
> 
at java.security.cert.PKIXParameters.(PKIXParameters.java:157)
> at 
> java.security.cert.PKIXBuilderParameters.(PKIXBuilderParameters.
java:130)
>
> 
at
> org.apache.tomcat.util.net.jsse.JSSEUtil.getParameters(JSSEUtil.java:3
41)
>
> 
at
> org.apache.tomcat.util.net.jsse.JSSEUtil.getTrustManagers(JSSEUtil.jav
a:273)
>
> 
at
> org.apache.tomcat.util.net.openssl.OpenSSLUtil.getTrustManagers(OpenSS
LUtil.java:93)
>
> 
at
> org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(Abstr
actJsseEndpoint.java:101)
>
> 
... 20 more

Tomcat is choking when trying to load the trust managers, which is
synonymous with loading the data from the "trust store". You don't
need a "trust store", otherwise you'd have specified is in the
.

Try just removing that system property and see what happens.

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

Re: Setting up a Context outside of webapps

2016-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Igal,

On 10/21/16 3:41 PM, Igal @ Lucee.org wrote:
> Chris,
> 
> On 10/21/2016 12:03 PM, Christopher Schultz wrote:
>> I'm not sure anyone else's opinion matters at this point. You've 
>> decided what you want to do... you're just looking for
>> validation. Technically, this works. Whether there are better
>> ways to do it are debatable.
> I've been running Tomcat for almost 10 years now, and this works
> for me well, having separate directory trees for software, config
> files, and web documents.
> 
> So yes, I've decided what I want to do.  But I want to make sure
> that there are no unintended consequences of which I'm unaware.

I don't believe there are any untended consequences of doing what
you're doing, other than the caveat that you have to bounce Tomcat to
make any changes.

>> But you're not interested in anyone else's opinon, so why bother
>> asking?
> That's because I'm not looking for an opinion of users who've found
> some config files online and copied/pasted them to their server.
> I'm looking for an opinion of someone who knows the inner workings
> of Tomcat, e.g. someone from the core team members.
> 
> So far no one has shown me how they set up Tomcat in a directory
> outside of $CATALINA_BASE.  The few "opinions" that I received say
> that my web directories should reside inside
> $CATALINA_BASE/webapps, which as you stated -- I've already decided
> that is not what I want.

If you want applications deployed outside of the appBase, then the
best way IMO is to drop your application.xml into
conf/[service]/[host]/[appname].xml. Point the docbase anywhere you
please.

>> How many different ways are there to demonstrate:
>> 
>>   
>> 
>> ??
> How exactly does that show how to specify where the web root will
> be, and have it outside of $CATALINA_BASE/webapps?

I'm sorry, that reference was for a few lines below what you're asking
here. This is the one you want, now:

http://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Naming

It says pretty clearly: the docbase identifies where your files are,
and the name of the XML file defines the URL mount-point.

> My question, at least the 2nd time around, is in my opinion very
> clear and very valid.  It'd be really great if someone can provide
> a real answer rather than post a couple of links to the docs (I
> have access to google too), or tell me that I'm just "doing it
> wrong".

Okay: you're doing it wrong and instead you should do what I've
outlined above and is detailed in Tomcat's configuration reference:
put your application's XML file in conf/[service]/[host]/[appname].xml
and put your bite wherever the heck you want.

The only difference between what I'm recommending and what you are
doing is the location of the : I recommend a separate file,
and you like server.xml. They will both work. There are advantages to
each, and I suspect you know what they are. I happen to like the
advantages of my recommendation over your current deployment and I've
explained what those advantages are. If you don't think it's worth the
trouble, don't change anything.

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

iQIcBAEBCAAGBQJYCoBRAAoJEBzwKT+lPKRYxoUQAJoKQy/+XrIeEIWQpVQBCtOZ
JkLBKsme5GSXEYlnB/qhBWjnMeGbK5NP4Fq3XpMLnJzCPtEhNMuhsf0ONld2YPQN
XEN2s1lA+LedNbg83RrsXWXupR+G5rbx0LwxO8sdAl8qHkYMUad0DMTx54EPzBZB
CeeRSEa251Ty3owaw+DZNQrVN6GFKLf1HnM29KUghVSvjtk17W79Fq6nVsLEvmt4
oRtZ/Oc+k7dXB7EAqwQEi7sCHk/1qcCW8nnI52enrQMuFvp9obTj3z1AcZs2EbPI
RAr9FY5qoVp/GcV6Z0YyPkgTkNEBTkYbB/hgJq+ELbmVJ9WFKjSy+04f8yEhLM3T
rjD53UwguuTAL6uO3wfyrWIgLZM0at+oDdXSB2ieos0Sq++/Nd7MBcTkLhH1ljBr
zDNscvg7kVDU9UJ2WQeziGynST8vfJ8JySF1VYXjhqNS3O4dRtoP/EK63IrbXRJb
iruokzzMMm8lWoxtnl297VWUwcGcV6m3E/MQkRCxvuC76ndVwXbTL/kkLhKcz5AN
HkSvMxO0ZSwuKSYUAxA413a9w4Gys9R9TeOwtQrPB9LMzpMj4dlziGgTQNHWf5eE
8QRQA12SFGGSu3nqhyyueZgcrGUotS27exC7Cfv+6ggLGLjg+yIvRCWjFbcLphdm
cSyT7BSR+kGOkBO77wF5
=lhEp
-END PGP SIGNATURE-

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



8.5.4 to 8.5.5 SSL Issue

2016-10-21 Thread William Boyd
Hello,

I am attempting to upgrade from Tomcat 7 to 8.5.6. Everything was working
great until I enabled SSL with a self-signed certificate. I am able to
recreated the issue on 8.5.5. I finally had to down graded to 8.5.4 to get
SSL working with identical configuration and cert.

I want to be sure that this is not a known issue and that I'm not doing
something wrong before I create a bug report.

Server version:Apache Tomcat/8.5.5 64-bit
OS Name:   Windows 7
JVM Version:   1.8.0_102-b14

The cert was generated with this command:
keytool -genkeypair -keyalg RSA -alias tomcat -keystore
"C:/keys/keystore.jsk" -storepass changeit -validity 360 -keysize 2048
-dname CN=localhost,OU=ITS,O=Co,L=City,ST=AB,C=CA

Configuration includes adding
-Djavax.net.ssl.trustStore=c:/keys/keystore.jsk to JAVA_OPTS and using this
connector config



Here is the exception I get at startup

13-Oct-2016 15:05:17.309 SEVERE [main]
org.apache.coyote.AbstractProtocol.init Failed to initialize end point
associated with ProtocolHandler ["https-openssl-nio-8001"]
 java.lang.IllegalArgumentException:
java.security.InvalidAlgorithmParameterException: the trustAnchors
parameter must be non-empty
 at
org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:103)
 at
org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:81)
 at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:244)
 at
org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:866)
 at
org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpoint.java:213)
 at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:575)
 at
org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:65)
 at org.apache.catalina.connector.Connector.initInternal(Connector.java:944)
 at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
 at
org.apache.catalina.core.StandardService.initInternal(StandardService.java:549)
 at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
 at
org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:873)
 at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
 at org.apache.catalina.startup.Catalina.load(Catalina.java:606)
 at org.apache.catalina.startup.Catalina.load(Catalina.java:629)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
Caused by: java.security.InvalidAlgorithmParameterException: the
trustAnchors parameter must be non-empty
 at
java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)
 at java.security.cert.PKIXParameters.(PKIXParameters.java:157)
 at
java.security.cert.PKIXBuilderParameters.(PKIXBuilderParameters.java:130)
 at
org.apache.tomcat.util.net.jsse.JSSEUtil.getParameters(JSSEUtil.java:341)
 at
org.apache.tomcat.util.net.jsse.JSSEUtil.getTrustManagers(JSSEUtil.java:273)
 at
org.apache.tomcat.util.net.openssl.OpenSSLUtil.getTrustManagers(OpenSSLUtil.java:93)
 at
org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:101)
 ... 20 more


Thanks in advance


Will


Re: Setting up a Context outside of webapps

2016-10-21 Thread Igal @ Lucee.org

Chris,

On 10/21/2016 12:03 PM, Christopher Schultz wrote:

I'm not sure anyone else's opinion matters at this point. You've
decided what you want to do... you're just looking for validation.
Technically, this works. Whether there are better ways to do it are
debatable.
I've been running Tomcat for almost 10 years now, and this works for me 
well, having separate directory trees for software, config files, and 
web documents.


So yes, I've decided what I want to do.  But I want to make sure that 
there are no unintended consequences of which I'm unaware.



But you're not interested in anyone else's opinon, so why
bother asking?
That's because I'm not looking for an opinion of users who've found some 
config files online and copied/pasted them to their server. I'm looking 
for an opinion of someone who knows the inner workings of Tomcat, e.g. 
someone from the core team members.


So far no one has shown me how they set up Tomcat in a directory outside 
of $CATALINA_BASE.  The few "opinions" that I received say that my web 
directories should reside inside $CATALINA_BASE/webapps, which as you 
stated -- I've already decided that is not what I want.



How many different ways are there to demonstrate:


   


??
How exactly does that show how to specify where the web root will be, 
and have it outside of $CATALINA_BASE/webapps?


My question, at least the 2nd time around, is in my opinion very clear 
and very valid.  It'd be really great if someone can provide a real 
answer rather than post a couple of links to the docs (I have access to 
google too), or tell me that I'm just "doing it wrong".


Sincerely,


Igal



There is a description of all the ways to define a context here:
https://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Defining_a_
context

The files go where the files go. The contents are not terribly
relevant. What kind of example were you looking for?

- -chris


On 10/21/2016 1:21 AM, r.bott...@afterbit.com wrote:

Hello, did you received some real config? Roberto. -Messaggio
originale- Da: Igal @ Lucee.org [mailto:i...@lucee.org]
Inviato: venerdì 7 ottobre 2016 21:57 A: Tomcat Users List
 Oggetto: Re: Host appBase vs. Context
docBase


Suppose you tell us your Tomcat version.

I'm using Tomcat 8.5.5 -- not sure how relevant that is since
AFAIK this has not changed in years.


It is highly unlikely that you want the  name to be App1

Of course that my host name is not App1, that was to remove fluff
and to keep only the relevant information in the email.


The path attribute of the  element must not be used
unless the  element is in server.xml, which it should
not be

I actually prefer it to be in server.xml


The docBase attribute is used only when the  element
is located in conf/Catalina/[host]/[appName].xml

That is definitely not true.  I've set up Tomcat many many times
like this and it works.  I may have not set it up the best way,
hence my question here, but the docBase attribute is indeed,
used.


You need to read the documentation for , , and
deployment

for the Tomcat version you're using. It would have been nice to
see some real life examples of complete configurations.

Igal Sapir Lucee Core Developer Lucee.org 

On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:

From: Igal @ Lucee.org [mailto:i...@lucee.org] Subject: Host
appBase vs. Context docBase Suppose that I have an
application at C:\WebApps\App1

Suppose you tell us your Tomcat version.


  

Both of the above are incorrect.  It is highly unlikely that
you want the

 name to be App1.  The appBase attribute of  must
point to a directory where one or more webapps are located for
automatic deployment. It must never point to a specific webapp.
The path attribute of the  element must not be used
unless the  element is in server.xml, which it should
not be.  The docBase attribute is used only when the 
element is located in conf/Catalina/[host]/[appName].xml.

You need to read the documentation for , , and
deployment

for the Tomcat version you're using.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
PROPRIETARY

MATERIAL and is thus for use only by the intended recipient. If
you received this in error, please contact the sender and delete
the e-mail and its attachments from all computers.



- -



To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org

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



-



To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org

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




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

iQIcBAEBCAAGBQJYCmaZAAoJEBzwKT+lPKRYAi4P/AyKInOBGGYWGTLLPmtIuWhf

Re: Allow Customization of service.bat

2016-10-21 Thread Igal @ Lucee.org

Chris,

On 10/21/2016 12:05 PM, Christopher Schultz wrote:



For some reason I thought that I read somewhere that the git repo
is read-only.  I didn't realize that I can submit a PR there.

It *is* read-only. But you can clone the repo and make a read-write
copy, then publish a pull-request from there.

It doesn't matter to you at all if the ASF's git repo is read-only.
Only the owner cares about that.


When I wrote read-only I meant a "read-only mirror for Subversion". 
Obviously I did not expect to have commit permissions on the official 
Tomcat repo.


Anyway, I've submitted a PR at 
https://github.com/apache/tomcat/pull/36/files



Igal

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



Re: Tomcat crashes with java 1.7

2016-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Rajesh,

On 10/21/16 2:13 AM, Rajesh Cherukuri wrote:
> can some one help me on this , tomcat servers crashes if i use java
> 1.7 , i have tried chaining this to java 1.6 and i am be to start
> the tomcat , issue is only when i use 1.7
> 
> here is the log when i use 1.7 after it crashes
> 
> Oct 21, 2016 7:37:28 AM org.apache.catalina.core.StandardService 
> startInternal INFO: Starting service Catalina Oct 21, 2016 7:37:28
> AM org.apache.catalina.core.StandardEngine startInternal INFO:
> Starting Servlet Engine: Apache Tomcat/7.0.53 # # A fatal error has
> been detected by the Java Runtime Environment: # #  SIGSEGV (0xb)
> at pc=0xfbc7e41c, pid=2081, tid=21 # # JRE version: Java(TM) SE
> Runtime Environment (7.0_79-b15) (build 1.7.0_79-b15) # Java VM:
> Java HotSpot(TM) Server VM (24.79-b02 mixed mode solaris-sparc ) #
> Problematic frame: # J 78 C2 
> java.util.HashMap.getEntry(Ljava/lang/Object;)Ljava/util/HashMap$Entry
;
> (86 bytes) @ 0xfbc7e41c [0xfbc7e380+0x9c]

This is a JVM bug and, almost by definition, is not linked to Tomcat.

Try switching to a higher or lower version of Java 1.7 (e.g. 7u80 or
7.76).

You also might want to test your CPU+RAM to see if they are buggy.

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

iQIcBAEBCAAGBQJYCmg3AAoJEBzwKT+lPKRYoxMP/iDMLrF6o054zEY/PWm13ac7
9kjCoukd7lCN0GxrEvtuCuSuCZT5WkLKp318oyEIgd4DRqkuhEyLl1OBz2sNMlw9
+HODmAoMM2P19FWagL5HFCzhHx/8MTBKsB2FdmKAN6Db6yBJPlqOTBPvigx4jNpq
1Ub32fn5Rqk3HX+LoyOFCalePOUlJnyz/KQ7XNAMHoHaJAIZ6N/ZQVJjFYLIuChS
ZgSC1CxyZPXcuXTJxQmNasiRlAAU4SpIFBlA4B1h74iSYc5z4YP/cjz0F1v7/UbY
RvovOUa5pj2SgUO9QnBhnpfnqrlqr6hM3ByOLMuQdqnif30eTONmV0yGaOswoQ8s
lpvOVAXGLvI5pbp8IAp9vXDvQSrmnAz/PJAD2uStPCkIvdXAunjqDG2hlqgkvuxP
1/AkX2LP3Pv4yCgbqGG8o7THmR7+IsV2IYNkvOEKEF+pIKIVCh493uE6ST069mSL
+OiyvZv9tGgVEp61bgpIKhb5vCZj+4uaVoXzF37dLNWTNrWG9uTMeEbnh21tAsNO
CcSgWpodXZC3jRlnKv+pM62hNRxONtVHO4sFHMqN0PsG2Qlv4ldDXmq726aUCk1r
3gaCrTMAjjbwLdzzrNtMnsfxQF8I7sK8bLy9cjyt9rB2vDhrFNE7U+kgkLz2xEn3
JYX9YS53PxfN24kCe6ue
=k9kI
-END PGP SIGNATURE-

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



Re: Allow Customization of service.bat

2016-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Igal,

On 10/21/16 1:02 PM, Igal @ Lucee.org wrote:
> Thanks Violeta,
> 
> On 10/20/2016 11:10 PM, Violeta Georgieva wrote:
>> We also accept PRs from GitHub [2]. [2]
>> https://github.com/apache/tomcat
> 
> For some reason I thought that I read somewhere that the git repo
> is read-only.  I didn't realize that I can submit a PR there.

It *is* read-only. But you can clone the repo and make a read-write
copy, then publish a pull-request from there.

It doesn't matter to you at all if the ASF's git repo is read-only.
Only the owner cares about that.

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

iQIcBAEBCAAGBQJYCmbdAAoJEBzwKT+lPKRY9CwP/jmNWJHZCdGwYX2M68JvQHul
qk+/pMoOSQvTsRGbaTMJJuKjeKNp3rJ35iEfHzBUF0svA7D2Y1WHkIv8wwWq4euk
ewnYItsxu1QwyNC6rQUA8b2m4n6jWlM4rsQclpv/eUmZIpblxciAHrGnIED2fG4v
4sWBEiQe6NO22MlT2UYxK1viESfuZOMfUxcXMSuUIgyAVYAiITSYLI/eHcfH8qAn
NluNlVDcPGqwHaCA1UGVToHmBOLwWqTUp5LcKY0/XQX/tVHjkgAL+1xSxW+Dr705
o+OFJTD1OcMk2F/kdoXeAolzGb6Q8ai4rr/hJrxNdiwYbIaQpwy0H6Ao2xkmbkR6
Ujdqt8Nl/kB+HuodpmFAGzXY2wB/mTDCw+uTbvik8t2cTZICoM8Vue6uR4Q15feN
4Mj2IlxGxdoK4Q4NpuAciqrMs75WizaRk0XQWSXmYAPdqIDNP6lD4sdAZiY9riMc
aFVT5kuyLaA8IyjBmTlh4bieH9dF6jT4KsBn6Tw4idG+pEKyQR9Hq1hlpjxxuBWe
8knbu8aKvAcrWop9E8qW5eviJUEvp1Gvxq9VP9g3h1hZ1N1O9257hljnYhi3JBaZ
rwolek5O3vZK0QZVdIjGj67mA9ihbB9Dvpiq+kXmqTWFW4IEymgmZpLc63h5rLrt
vgfqzCD+NG53w021RHge
=IybW
-END PGP SIGNATURE-

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



Re: Setting up a Context outside of webapps

2016-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Igal,

On 10/21/16 1:31 PM, Igal @ Lucee.org wrote:
> I'm asking my question differently since it didn't get much
> traction when I asked it before.
> 
> I want to set up a Web Context outside of %CATALINA_BASE%/webapps,
> e.g. at C:\WebRoot\myapp.  I prefer to configure it in server.xml,
> because I like it that all of my config files are at
> %CATALINA_BASE%/conf.
> 
> So for example, to set up an app for myapp.tld, with contents in 
> C:\WebRoot\myapp, I use the following snippet:
> 
>   docBase="C:\WebRoot\myapp" /> 
> 
> I don't want to specify Host appBase to C:\WebRoot because it
> contains separate sites (Contexts) in different directories, and
> each site is configured to run at the root directory of the site,
> e.g. http://myapp.tld/.  I also clear the contents of
> %CATALINA_BASE%/webapps.
> 
> Is that the right way to do it?  Is there a better way?  Anything
> wrong with this set up?

I'm not sure anyone else's opinion matters at this point. You've
decided what you want to do... you're just looking for validation.
Technically, this works. Whether there are better ways to do it are
debatable. But you're not interested in anyone else's opinon, so why
bother asking?

> It'd be great if the docs had contained some real examples.

How many different ways are there to demonstrate:


  


??

There is a description of all the ways to define a context here:
https://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Defining_a_
context

The files go where the files go. The contents are not terribly
relevant. What kind of example were you looking for?

- -chris

> On 10/21/2016 1:21 AM, r.bott...@afterbit.com wrote:
>> Hello, did you received some real config? Roberto. -Messaggio
>> originale- Da: Igal @ Lucee.org [mailto:i...@lucee.org] 
>> Inviato: venerdì 7 ottobre 2016 21:57 A: Tomcat Users List
>>  Oggetto: Re: Host appBase vs. Context
>> docBase
>> 
>>> Suppose you tell us your Tomcat version.
>> I'm using Tomcat 8.5.5 -- not sure how relevant that is since
>> AFAIK this has not changed in years.
>> 
>>> It is highly unlikely that you want the  name to be App1
>> Of course that my host name is not App1, that was to remove fluff
>> and to keep only the relevant information in the email.
>> 
>>> The path attribute of the  element must not be used
>>> unless the  element is in server.xml, which it should
>>> not be
>> I actually prefer it to be in server.xml
>> 
>>> The docBase attribute is used only when the  element
>>> is located in conf/Catalina/[host]/[appName].xml
>> That is definitely not true.  I've set up Tomcat many many times
>> like this and it works.  I may have not set it up the best way,
>> hence my question here, but the docBase attribute is indeed,
>> used.
>> 
>>> You need to read the documentation for , , and
>>> deployment
>> for the Tomcat version you're using. It would have been nice to
>> see some real life examples of complete configurations.
>> 
>> Igal Sapir Lucee Core Developer Lucee.org 
>> 
>> On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:
 From: Igal @ Lucee.org [mailto:i...@lucee.org] Subject: Host
 appBase vs. Context docBase Suppose that I have an 
 application at C:\WebApps\App1
>>> Suppose you tell us your Tomcat version.
>>> 
  >>> autoDeploy="false">   >>> name="App1" autoDeploy="false"> >>> path=""docBase="C:\WebApps\App1" /> 
>>> Both of the above are incorrect.  It is highly unlikely that
>>> you want the
>>  name to be App1.  The appBase attribute of  must
>> point to a directory where one or more webapps are located for
>> automatic deployment. It must never point to a specific webapp.
>> The path attribute of the  element must not be used
>> unless the  element is in server.xml, which it should
>> not be.  The docBase attribute is used only when the 
>> element is located in conf/Catalina/[host]/[appName].xml.
>>> You need to read the documentation for , , and
>>> deployment
>> for the Tomcat version you're using.
>>> - Chuck
>>> 
>>> 
>>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
>>> PROPRIETARY
>> MATERIAL and is thus for use only by the intended recipient. If
>> you received this in error, please contact the sender and delete
>> the e-mail and its attachments from all computers.
>>> 
- -
>>>
>>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>> 
>> 
>> 
>> -
>>
>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
> 
> 
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYCmaZAAoJEBzwKT+lPKRYAi4P/AyKInOBGGYWGTLLPmtIuWhf

Re: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jon,

On 10/21/16 3:46 AM, Moore, Jon, Vodafone UK wrote:
> Yes I am a novice at Java as well. I support the IVR system that 
> points to the application servers and have ended up trying to
> resolve this issue as our developers of the applications can't
> help.

Understood. Welcome to the Java world. :)

> The way we are told on the training to deploy the application in
> the IVR is to use the deploy/un-deploy options in tomcat manager. I
> have also seen a colleague make a copy of the applications war file
> away from its normal folder (webapps), stop the tomcat Windows
> service, delete the applications deployed folder and restart the
> tomcat windows service to re-deploy the application.

Since you are using manager-based deply/undeploy, you could very well
be running into a classloader-pinning error. If there's no hope of
modifying the code to fix any leaks, the only remedy is to bounce the
entire JVM after a certain number of redeploy operations. If you find
that you can redeploy 10 times before you get permgen OOMEs, then
you'll need to keep a count and restart after e.g. 8 redeployments.

If you *can* fix the code, the manager has a "find memory leaks"
button that can help you find out if an application has not undeployed
properly: deploy the application in a fresh Tomcat start-up. Then,
undeploy the application, wait 5-10 seconds, and click the "find
memory leaks" button. If it syas there are no leaks, then you may just
need a slightly larger permgen in general and you'll be fine.

If it says there are problems, start a new thread on this mailing list
asking for help identifying and fixing those leaks.

> I have tried to run the commands you suggested from a CMD box but 
> nothing gets outputted.

Hmm.

Try NOT piping-through the FINDSTR program and looking at the output
of the initial "java" command. I don't have a Windows system to play
with ATM so I'm doing a bit of guesswork, here. "FIND" is garbage
compared to a proper "grep". I had never even heard of FINDSTR before.

- -chris

> -Original Message- From: Christopher Schultz 
> [mailto:ch...@christopherschultz.net] Sent: 20 October 2016 17:40
> To: Tomcat Users List Subject: Re: java.lang.OutOfMemoryError:
> PermGen space
> 
> Jon,
> 
> On 10/20/16 6:00 AM, Moore, Jon, Vodafone UK wrote:
>> I have a problem where our customers application server stops 
>> working intermittently and when we check the Tomcat logs we get
>> the message " java.lang.OutOfMemoryError: PermGen space" but the
>> Tomcat service is still running, and we have to restart the
>> Tomcat service. I am a complete novice when it comes to Tomcat
>> but am expected to resolve this issue as this server is part of
>> the Avaya telephony solution.
> 
>> I have 2 questions please.
> 
>> 1 - What would be causing this.
> 
> Are you also a Java novice as well? No judgement... I just want to 
> adjust my level of snark appropriately :)
> 
> Java has a special heap space called the "permanent generation" (a 
> term which becomes less descriptive as time goes on) but basically 
> all java.lang.Class objects loaded by the JVM go there. The more 
> libraries and other stuff that gets loaded, the more space in
> permgen is used. The defaults for the size of permgen are often
> fairly small, and you may have to raise them. This is especially
> true for applications that use large frameworks like Spring.
> 
> Raising the permgen space is almost always the right decision
> under normal circumstances when you get an OOME:permgen error. I
> would double whatever its current value is and monitor the
> application for a while to see if that improves things.
> 
> The only situation I know of where raising the permgen size is not 
> the right move is when there is a "classloader-pinning leak". That 
> happens when you hot-deploy an application many times, but the old 
> versions of the application are not undeploying cleanly. This 
> situation is quite the rabbit-hole, so I'll stop there unless you
> can confirm that you do hot-deployments without restarting Tomcat
> and the JVM.
> 
> If you instead get OOME for other reasons, it's frequently NOT the 
> right decision to increase the heap size because it usually
> indicates that there is a memory leak in the application and giving
> it more heap just means you'll wait longer between failures.
> Instead, the application should be fixed to not leak memory :)
> 
>> 2 - What are the default Java memory settings for Initial memory 
>> pool, maximum memory pool size and thread stack size when the 
>> fields are blank when you use the "Configure Tomcat" interface
>> on Windows. I was wondering if changing one or more of these
>> settings would help ?
> 
> The default depends upon the JVM and the OS.
> 
>> We are running Tomcat 6.0.26 on Windows Server 2008 R2 standard
>> and JVM version is 1.6.0_20-b02
> 
> Best way to find out for sure[1] is:
> 
> C:\> java -XX:+PrintFlagsFinal -version 2>&1 | 

Re: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

André,

On 10/21/16 11:15 AM, André Warnier (tomcat) wrote:
> Hi. Understood. Make sure that you are looking at the "Java" tab.

And at the right Service name. The tomcat6w.exe can be used to
configure any number of services. If you've got the wrong one, you'll
be configuring something OTHER than what you want to configure.

Do you have multiple Tomcat6-based services configured? If so, make
sure you are editing the right now.

> I have an old installation of Tomcat 6 on my laptop, and took a 
> screenshot of that tab. I am not sure that the image that I attach
> will make it on the list however (it strips most attachments). If
> not, here are the parameters which I see in the Java tab, in the
> box "Java Options" :
> 
> -Djava.io.tmpdir=C:\apache-tomcat-6.0.24\temp 
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
> -Djava.util.logging.config.file=C:\apache-tomcat-6.0.24\conf\logging.p
roperties
>
> 
> 
> There is nothing about memory there, but this is where you should
> add the relevant switches for the Java PermGen, one per line.
> 
> Further down, there are 3 more boxes :
> 
> Initial memory pool : 128 MB Maximum memory pool : 256 MB Thread
> stack size : (blank)
> 
> The first 2 are the Java Heap size (which is not your problem). On
> my laptop, the JVM for the above is Sun's jdk7_u45. Your mileage
> may vary..
> 
> There may be more to find out searching Google for "java default
> memory settings" or similar.
> 
> This link provides an example of a setting for Java 6 / Tomcat 7 : 
> http://stackoverflow.com/questions/21104340/increase-windows-installer
- -based-tomcat-permgen-space
>
> 
> 
> I saw something somewhere which mentioned 64 MB as the default
> PermGen (no guarantees).
> 
> Another proviso : at this point, I am not quite sure if the PermGen
> is or not a part of the Heap (Chuck ?).

PermGen is not a part of any other heap space: it is separate.

> If it is, and you increase the PermGen, you may need to also
> increase the Heap size accordingly (see the 2 boxes above).

Not necessary.

> For maximum performance, it is also recommended to set the
> "initial" and "maximum" Heap size values above to the same value
> (use the maximum of course), as this avoids the JVM spending some
> time resizing the heap dynamically.
> 
> In any case, and still without guarantees or liability of any
> kind, if you have enough memory on that server, it would probably
> not hurt to set the following :
> 
> Initial memory pool : 1024 MB Maximum memory pool : 1024 MB

Eh. I wouldn't increase anything you don't need to increase. I've seen
JVMs configured for huge heaps on multi-tenant VMs that have
over-committed the physical hardware. The hypervisor does what it can,
and every VM runs slow as a dog. If you don't need a gig of RAM, don't
requested it.

> and add the options -XX:PermSize=128m -XX:MaxPermSize=128m
> 
> to the Java Options.

+1

- -chris

> On 21.10.2016 16:25, Moore, Jon, Vodafone UK wrote:
>> Thanks Andre.
>> 
>> When I open up tomcat6w.exe the fields are all blank, hence
>> trying to find out what the defaults are before I enter anything
>> in them as I don't want to put in a lesser value then the
>> defaults.
>> 
>> -Original Message- From: André Warnier (tomcat)
>> [mailto:a...@ice-sa.com] Sent: 21 October 2016 09:34 To:
>> users@tomcat.apache.org Subject: Re: java.lang.OutOfMemoryError:
>> PermGen space
>> 
>> On 21.10.2016 09:46, Moore, Jon, Vodafone UK wrote:
>>> Thanks Chris. (and to everyone else who has replied)
>>> 
>>> Yes I am a novice at Java as well. I support the IVR system
>>> that points to the application servers and have ended up trying
>>> to resolve this issue as our developers of the applications
>>> can't help.
>>> 
>>> The way we are told on the training to deploy the application
>>> in the IVR is to use the deploy/un-deploy options in tomcat
>>> manager. I have also seen a colleague make a copy of the
>>> applications war file away from its normal folder (webapps),
>>> stop the tomcat Windows service, delete the applications
>>> deployed folder and restart the tomcat windows service to
>>> re-deploy the application.
>>> 
>>> I have tried to run the commands you suggested from a CMD box
>>> but nothing gets outputted.
>>> 
>> 
>> Some additional info :
>> 
>> When Tomcat is running as a Service under Windows, the Java 
>> command-line switches (which allow to control the Java memory
>> sizes among other tings), are stored in the Windows Registry.
>> The Windows Tomcat-as-a-Service installation includes a program
>> (named "tomcat(version)w.exe", which is a kind of GUI Registry
>> Editor, specially for these Java/Tomcat related parameters.
>> Normally, this program is running, and appears as a small Apache
>> icon at the bottom right of the console. That is the program that
>> you should use, to change the Java startup parameters, and
>> stop/start Tomcat.
>> 
>> As explained in previous posts here 

Re: Setting up a Context outside of webapps

2016-10-21 Thread Igal @ Lucee.org

Hi,

On 10/21/2016 10:51 AM, Mark Eggers wrote:

1. Create separate Host entries for each host that you wish to serve.
See:

http://tomcat.apache.org/tomcat-8.5-doc/virtual-hosting-howto.html
This shows how to have separate xml files for the different hosts, which 
is not what I am asking about



2. Name your WAR file ROOT.war (case is important even on Windows)
I am not using WAR files, nor do I want to be limited to name it 
according to convention, i.e. ROOT.war



There are a lot of examples - here's an old one:

http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts


Those examples use webapps container directory (regardless of whether 
it's $CATALINA_BASE/webapps or in a different path.


Again, not what I'm after, and not what I'm asking about.


Igal




On 10/21/2016 1:21 AM, r.bott...@afterbit.com wrote:

Hello,
did you received some real config?
Roberto.
   -Messaggio originale-
Da: Igal @ Lucee.org [mailto:i...@lucee.org]
Inviato: venerdì 7 ottobre 2016 21:57
A: Tomcat Users List 
Oggetto: Re: Host appBase vs. Context docBase


Suppose you tell us your Tomcat version.

I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK
this has
not changed in years.


It is highly unlikely that you want the  name to be App1

Of course that my host name is not App1, that was to remove fluff and to
keep only the relevant information in the email.


The path attribute of the  element must not be used unless
the  element is in server.xml, which it should not be

I actually prefer it to be in server.xml


The docBase attribute is used only when the  element is
located in conf/Catalina/[host]/[appName].xml

That is definitely not true.  I've set up Tomcat many many times like
this
and it works.  I may have not set it up the best way, hence my question
here, but the docBase attribute is indeed, used.


You need to read the documentation for , , and deployment

for the Tomcat version you're using.
It would have been nice to see some real life examples of complete
configurations.

Igal Sapir
Lucee Core Developer
Lucee.org 

On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:

From: Igal @ Lucee.org [mailto:i...@lucee.org]
Subject: Host appBase vs. Context docBase Suppose that I have an
application at C:\WebApps\App1

Suppose you tell us your Tomcat version.







  

Both of the above are incorrect.  It is highly unlikely that you want
the

 name to be App1.  The appBase attribute of  must point to a
directory where one or more webapps are located for automatic deployment.
It must never point to a specific webapp.  The path attribute of the
 element must not be used unless the  element is in
server.xml, which it should not be.  The docBase attribute is used
only when
the  element is located in conf/Catalina/[host]/[appName].xml.

You need to read the documentation for , , and deployment

for the Tomcat version you're using.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY

MATERIAL and is thus for use only by the intended recipient. If you
received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.

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



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








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



Re: Setting up a Context outside of webapps

2016-10-21 Thread Mark Eggers
Replying inline and at the end of the most recently posted message:

On 10/21/2016 10:31 AM, Igal @ Lucee.org wrote:
> I'm asking my question differently since it didn't get much traction
> when I asked it before.
> 
> I want to set up a Web Context outside of %CATALINA_BASE%/webapps, e.g.
> at C:\WebRoot\myapp.  I prefer to configure it in server.xml, because I
> like it that all of my config files are at %CATALINA_BASE%/conf.
> 
> So for example, to set up an app for myapp.tld, with contents in
> C:\WebRoot\myapp, I use the following snippet:
> 
> 
> 
> 
> 
> I don't want to specify Host appBase to C:\WebRoot because it contains
> separate sites (Contexts) in different directories, and each site is
> configured to run at the root directory of the site, e.g.
> http://myapp.tld/.  I also clear the contents of %CATALINA_BASE%/webapps.
> 
> Is that the right way to do it?  Is there a better way?  Anything wrong
> with this set up?

1. In my opinion, no
2. In my opinion, yes
3. Read the docs concerning docBase, appBase, and ROOT.war

> 
> It'd be great if the docs had contained some real examples.
> 
> Thanks,
> 
> Igal Sapir
> Lucee Core Developer
> Lucee.org 
> 

1. Create separate Host entries for each host that you wish to serve.
   See:

http://tomcat.apache.org/tomcat-8.5-doc/virtual-hosting-howto.html

2. Name your WAR file ROOT.war (case is important even on Windows)

3. Navigate to http://hostname/

The appropriate site will come up with the default application being
ROOT.war.

There are a lot of examples - here's an old one:

http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts

One of these days I'll get around to revising, rewriting, and updating
the document for a production environment.

We use a variant of that setup with CATALINA_BASE and CATALINA_HOME for
production. It makes managing hosts and doing upgrades simple. Most of
the work can be done without taking the system offline.

. . . just my two cents
/mde/


> On 10/21/2016 1:21 AM, r.bott...@afterbit.com wrote:
>> Hello,
>> did you received some real config?
>> Roberto.
>>   -Messaggio originale-
>> Da: Igal @ Lucee.org [mailto:i...@lucee.org]
>> Inviato: venerdì 7 ottobre 2016 21:57
>> A: Tomcat Users List 
>> Oggetto: Re: Host appBase vs. Context docBase
>>
>>> Suppose you tell us your Tomcat version.
>> I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK
>> this has
>> not changed in years.
>>
>>> It is highly unlikely that you want the  name to be App1
>> Of course that my host name is not App1, that was to remove fluff and to
>> keep only the relevant information in the email.
>>
>>> The path attribute of the  element must not be used unless
>>> the  element is in server.xml, which it should not be
>> I actually prefer it to be in server.xml
>>
>>> The docBase attribute is used only when the  element is
>>> located in conf/Catalina/[host]/[appName].xml
>> That is definitely not true.  I've set up Tomcat many many times like
>> this
>> and it works.  I may have not set it up the best way, hence my question
>> here, but the docBase attribute is indeed, used.
>>
>>> You need to read the documentation for , , and deployment
>> for the Tomcat version you're using.
>> It would have been nice to see some real life examples of complete
>> configurations.
>>
>> Igal Sapir
>> Lucee Core Developer
>> Lucee.org 
>>
>> On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:
 From: Igal @ Lucee.org [mailto:i...@lucee.org]
 Subject: Host appBase vs. Context docBase Suppose that I have an
 application at C:\WebApps\App1
>>> Suppose you tell us your Tomcat version.
>>>
 
 
 
 
 
  
>>> Both of the above are incorrect.  It is highly unlikely that you want
>>> the
>>  name to be App1.  The appBase attribute of  must point to a
>> directory where one or more webapps are located for automatic deployment.
>> It must never point to a specific webapp.  The path attribute of the
>>  element must not be used unless the  element is in
>> server.xml, which it should not be.  The docBase attribute is used
>> only when
>> the  element is located in conf/Catalina/[host]/[appName].xml.
>>> You need to read the documentation for , , and deployment
>> for the Tomcat version you're using.
>>>- Chuck
>>>
>>>
>>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
>> MATERIAL and is thus for use only by the intended recipient. If you
>> received
>> this in error, please contact the sender and delete the e-mail and its
>> attachments from all computers.
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For 

Setting up a Context outside of webapps (was: Host appBase vs. Context docBase)

2016-10-21 Thread Igal @ Lucee.org
I'm asking my question differently since it didn't get much traction 
when I asked it before.


I want to set up a Web Context outside of %CATALINA_BASE%/webapps, e.g. 
at C:\WebRoot\myapp.  I prefer to configure it in server.xml, because I 
like it that all of my config files are at %CATALINA_BASE%/conf.


So for example, to set up an app for myapp.tld, with contents in 
C:\WebRoot\myapp, I use the following snippet:






I don't want to specify Host appBase to C:\WebRoot because it contains 
separate sites (Contexts) in different directories, and each site is 
configured to run at the root directory of the site, e.g. 
http://myapp.tld/.  I also clear the contents of %CATALINA_BASE%/webapps.


Is that the right way to do it?  Is there a better way?  Anything wrong 
with this set up?


It'd be great if the docs had contained some real examples.

Thanks,

Igal Sapir
Lucee Core Developer
Lucee.org 

On 10/21/2016 1:21 AM, r.bott...@afterbit.com wrote:

Hello,
did you received some real config?
Roberto.
  
-Messaggio originale-

Da: Igal @ Lucee.org [mailto:i...@lucee.org]
Inviato: venerdì 7 ottobre 2016 21:57
A: Tomcat Users List 
Oggetto: Re: Host appBase vs. Context docBase


Suppose you tell us your Tomcat version.

I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK this has
not changed in years.


It is highly unlikely that you want the  name to be App1

Of course that my host name is not App1, that was to remove fluff and to
keep only the relevant information in the email.


The path attribute of the  element must not be used unless
the  element is in server.xml, which it should not be

I actually prefer it to be in server.xml


The docBase attribute is used only when the  element is
located in conf/Catalina/[host]/[appName].xml

That is definitely not true.  I've set up Tomcat many many times like this
and it works.  I may have not set it up the best way, hence my question
here, but the docBase attribute is indeed, used.


You need to read the documentation for , , and deployment

for the Tomcat version you're using.
It would have been nice to see some real life examples of complete
configurations.

Igal Sapir
Lucee Core Developer
Lucee.org 

On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:

From: Igal @ Lucee.org [mailto:i...@lucee.org]
Subject: Host appBase vs. Context docBase Suppose that I have an
application at C:\WebApps\App1

Suppose you tell us your Tomcat version.







 

Both of the above are incorrect.  It is highly unlikely that you want the

 name to be App1.  The appBase attribute of  must point to a
directory where one or more webapps are located for automatic deployment.
It must never point to a specific webapp.  The path attribute of the
 element must not be used unless the  element is in
server.xml, which it should not be.  The docBase attribute is used only when
the  element is located in conf/Catalina/[host]/[appName].xml.

You need to read the documentation for , , and deployment

for the Tomcat version you're using.

   - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY

MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.

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




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





Re: Allow Customization of service.bat

2016-10-21 Thread Igal @ Lucee.org

Thanks Violeta,

On 10/20/2016 11:10 PM, Violeta Georgieva wrote:

We also accept PRs from GitHub [2].
[2] https://github.com/apache/tomcat


For some reason I thought that I read somewhere that the git repo is 
read-only.  I didn't realize that I can submit a PR there.


I'll do that.

Igal Sapir
Lucee Core Developer
Lucee.org 




Re: Limit connections in multi-context environment

2016-10-21 Thread Bryan Larson
Mark,

Sorry for the delayed response.  I had a chance to test out the valve, and
my preliminary testing showed that this worked like a charm for my
application.  Thanks for your help.

Bryan

On Tue, Oct 18, 2016 at 9:24 AM, Mark Thomas  wrote:

> On 18/10/2016 15:04, Bryan Larson wrote:
> > Good morning.  I recently posted a question on Stack Overflow that I
> think
> > would be better suited for this group.  Here is the question:
> > http://stackoverflow.com/questions/40050063/tomcat-max-
> connections-on-a-per-context-basis.
> > To summarize: Besides using multiple connectors in the server.xml file,
> is
> > there a way to limit max connections on a per context basis?
>
> http://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Semaphore_Valve
>
> Also available all the way back to Tomcat 6.
>
> > I read through the slides for Tomcat 9 here:
> > http://events.linuxfoundation.org/sites/events/files/slides/
> 2015-09-24-Tomcat-9.pdf.
> > Wording such as "Better infrastructure for the cloud"
>
> Before I even looked at the slides I thought that sounded like JavaEE 8
> waffle rather than a Tomcat feature. In the past there have been
> mutterings about this having something to do with multi-tenancy without
> any hard information on what that means for a Servlet container.
>
> > and "Tomcat 9 supports – multiple virtual hosts per connector (SNI)"
>
> That is just standard TLS virtual hosting.
>
> > lead me to believe
> > there might be changes in Tomcat 9 that support this without extensive
> > configuration changes.  Can this be confirmed?
>
> There are no Tomcat 9 specific changes to support this feature. (But you
> don't need them.)
>
> Mark
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread Berneburg, Cris J. - US
Hi Jon

-Original Message-
From: Moore, Jon, Vodafone UK [mailto:jon.mo...@vodafone.com] 
Sent: Thursday, October 20, 2016 6:00 AM
To: users@tomcat.apache.org
Subject: java.lang.OutOfMemoryError: PermGen space

> I have a problem where our customers application server stops
> working intermittently and when we check the Tomcat logs we get the
> message " java.lang.OutOfMemoryError: PermGen space" but the Tomcat
> service is still running, and we have to restart the Tomcat service. I
> am a complete novice when it comes to Tomcat but am expected to
> resolve this issue as this server is part of the Avaya telephony
> solution.
>
> I have 2 questions please.
>
> 1 - What would be causing this.

In my very limited experience it is likely a "memory leak" in your application 
"hosted" inside of Tomcat rather than Tomcat itself.  You will need to debug 
your application.

I went through something very similar starting in July 2016, starting off as a 
complete newbie.  See threads relating to "OutOfMemoryError: PermGen space" for 
the whole sorry affair.  :-)

> 2 - What are the default Java memory settings for Initial memory pool,
> maximum memory pool size and thread stack size when the fields are
> blank when you use the "Configure Tomcat" interface on Windows. I was
> wondering if changing one or more of these settings would help ?

FWIW, I agree with the other folks saying not to alter these settings as the 
solution to solve your problem.  If you have a memory leak, increasing the size 
of the memory will not stop the leak.

I suggest following a path that was recommended to me.  Start by reading this:

http://markmail.org/message/fcbvwapt6afyndxn

> 1. Find an app that you can't reload without OOME.
> 2. Get a profiler [...]
> 3. Reload you app once.
> 4. Use the profiler to look for instances of WebappClassLoader.
> 5. Look for the one with the started attribute == false.
> 6. Trace the GC roots for this instance.

In the process, I learned how to perform a Java "heap dump" and how to use a 
memory analyzer.  FYI, I used Eclipse Memory Analyzer (free) to track things 
down.  This will be a learning experience for you too.  ;-)

> We are running Tomcat 6.0.26 on Windows Server 2008 R2 standard and
> JVM version is 1.6.0_20-b02

Thanks for providing those details.  :-)  We had almost the same setup as you, 
but Win2012 instead of 2008.  FYI, upgrading from Java 6 to 8 did not fix my 
memory leak.

Good luck, and let us know your progress!

--
Cris Berneburg
CACI Lead Software Engineer


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



Re: Tomcat clustering and FarmDeployer

2016-10-21 Thread Daniel Savard
Le 20 oct. 2016 3:21 PM, "André Warnier (tomcat)"  a écrit :
>
> Maybe naive, and I have never tried any of this myself, but is there a
reason why you cannot use method 2 in
>
http://tomcat.apache.org/tomcat-8.0-doc/deployer-howto.html#A_word_on_Contexts
> in that scenario ?
>

Thanks, tested for my needs and it's working fine. I had to change one
minor thing in my approach.


Re: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread tomcat

Hi.
Understood.
Make sure that you are looking at the "Java" tab.

I have an old installation of Tomcat 6 on my laptop, and took a screenshot of 
that tab.
I am not sure that the image that I attach will make it on the list however (it strips 
most attachments).

If not, here are the parameters which I see in the Java tab, in the box "Java 
Options" :

-Djava.io.tmpdir=C:\apache-tomcat-6.0.24\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\apache-tomcat-6.0.24\conf\logging.properties

There is nothing about memory there, but this is where you should add the relevant 
switches for the Java PermGen, one per line.


Further down, there are 3 more boxes :

Initial memory pool : 128 MB
Maximum memory pool : 256 MB
Thread stack size : (blank)

The first 2 are the Java Heap size (which is not your problem).
On my laptop, the JVM for the above is Sun's jdk7_u45.
Your mileage may vary..

There may be more to find out searching Google for "java default memory 
settings" or similar.

This link provides an example of a setting for Java 6 / Tomcat 7 :
http://stackoverflow.com/questions/21104340/increase-windows-installer-based-tomcat-permgen-space

I saw something somewhere which mentioned 64 MB as the default PermGen (no 
guarantees).

Another proviso : at this point, I am not quite sure if the PermGen is or not a part of 
the Heap (Chuck ?).
If it is, and you increase the PermGen, you may need to also increase the Heap size 
accordingly (see the 2 boxes above).


For maximum performance, it is also recommended to set the "initial" and "maximum" Heap 
size values above to the same value (use the maximum of course), as this avoids the JVM 
spending some time resizing the heap dynamically.


In any case, and still without guarantees or liability of any kind,
if you have enough memory on that server, it would probably not hurt to set the 
following :

Initial memory pool : 1024 MB
Maximum memory pool : 1024 MB

and add the options
-XX:PermSize=128m
-XX:MaxPermSize=128m

to the Java Options.



On 21.10.2016 16:25, Moore, Jon, Vodafone UK wrote:

Thanks Andre.

When I open up tomcat6w.exe the fields are all blank, hence trying to find out 
what the defaults are before I enter anything in them as I don't want to put in 
a lesser value then the defaults.

-Original Message-
From: André Warnier (tomcat) [mailto:a...@ice-sa.com]
Sent: 21 October 2016 09:34
To: users@tomcat.apache.org
Subject: Re: java.lang.OutOfMemoryError: PermGen space

On 21.10.2016 09:46, Moore, Jon, Vodafone UK wrote:

Thanks Chris. (and to everyone else who has replied)

Yes I am a novice at Java as well. I support the IVR system that points to the 
application servers and have ended up trying to resolve this issue as our 
developers of the applications can't help.

The way we are told on the training to deploy the application in the IVR is to 
use the deploy/un-deploy options in tomcat manager. I have also seen a 
colleague make a copy of the applications war file away from its normal folder 
(webapps), stop the tomcat Windows service, delete the applications deployed 
folder and restart the tomcat windows service to re-deploy the application.

I have tried to run the commands you suggested from a CMD box but nothing gets 
outputted.



Some additional info :

When Tomcat is running as a Service under Windows, the Java command-line switches (which 
allow to control the Java memory sizes among other tings), are stored in the Windows 
Registry.  The Windows Tomcat-as-a-Service installation includes a program (named 
"tomcat(version)w.exe", which is a kind of GUI Registry Editor, specially for 
these Java/Tomcat related parameters.  Normally, this program is running, and appears as 
a small Apache icon at the bottom right of the console.
That is the program that you should use, to change the Java startup parameters, 
and stop/start Tomcat.

As explained in previous posts here on this list, and in some of the articles 
to which I pointed you in Google, it may be that your issue is only that the 
default PermGen size, is insufficient for your application(s), and that just 
increasing the Java PermGen size would solve the problem definitely.

Or not, if the application is flawed. But you can at least try.

For the full story about tomcat(x)w.exe, try the Tomcat FAQ (which does not seem to be 
on-line right now, or very slow), and look for an article entitled "what are 
tomcatx.exe and tomcatxw.exe".
Ah, here : http://wiki.apache.org/tomcat/FAQ/Windows




-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: 20 October 2016 17:40
To: Tomcat Users List
Subject: Re: java.lang.OutOfMemoryError: PermGen space

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jon,

On 10/20/16 6:00 AM, Moore, Jon, Vodafone UK wrote:

I have a problem where our customers application server stops working
intermittently and when we check the Tomcat logs we get the message "

Re: Strange wait time in my application - Tomcat 7.0.67

2016-10-21 Thread Tullio Bettinazzi
No further help ?

Tks



Da: André Warnier (tomcat) 
Inviato: lunedì 17 ottobre 2016 18.01
A: users@tomcat.apache.org
Oggetto: Re: Strange wait time in my application - Tomcat 7.0.67

On 17.10.2016 17:52, Tullio Bettinazzi wrote:
> I didn't find any solution to my problem.
>
> Could someone provide suggestions or a strategy to find the solution ?
>

"I don't see relevant garbage collection : heap size and permgen have correct 
dimentions."

Define "correct".  Are you really *logging* the JVM Garbage Collection, and do 
you *know*
that this is not the issue ?

(Note that 4 seconds seems an awfully long time for a GC; but one would want to 
eliminate
this with certainty, before looking any further).


>
>
> 
> Da: Martijn Bos 
> Inviato: lunedì 3 ottobre 2016 21.05
> A: Tomcat Users List
> Oggetto: Re: Strange wait time in my application - Tomcat 7.0.67
>
> On 2016-10-03 07:56:34, Tullio Bettinazzi wrote:
>> I've an application under tomcat.
>> When only a one or two users works on it everithing is ok.
>> When the number of users grows the application slows down.
>> Is not a memory nor a cpu problem : using top I see the system resources 
>> quite free.
>> I don't see relevant garbage collection : heap size and permgen have correct 
>> dimentions.
>> No other applications are running on the system.
>> I log more or less every relevant operation in my system (db query and so 
>> on) and I see that every slowdown is concentered in a single operation.
>> I mean all operations take "normal" time but one or two of them take 4 
>> seconds more.
>> The "slowing" operations are not the same in different executions, and 
>> theydo not have a specific type (not only DB query, not only DB stored 
>> procedures, not only.).
>> It seems like if the thread is frozen for a fixed amount fo time (4 seconds 
>> more or less) and then it restarts.
>> I don't think it's a "queue" problem because otherwise the wait time would 
>> be unperdictable and not a "fixed" 4 seconds time.
>> I don't know any parameter impacting on that behaviour.
>> I use Tomcat 7.0.32 with JVM 1.7.0.67 on a Linux server.
>> Could someone suggest a solution for my problem or, at least, an 
>> investigation strategy.
>> Tks
>>
>> Tullio
>>
>
>
> The few examples that you mention are all database related (query/stored 
> procedure).
> Can it be that your connection pool (if used) combined with not closing 
> connections is part of the problem.
>
> I can imagine :
> 1)
> Maybe you run out of conenctions, because connections are not properly closed.
> And also the connection pool teminates connections when they are not used for 
> 4 seconds.
> After 4 seconds the pool can recreate connections again.
>
> or 2)
> Maybe your connection pool has very limited connections.
> With one or two users this limited number of connections in the pool will 
> suffice.
> If there are more users, the max. number of connections isn't enough.
> The pool then has to wait for connections to become fee again.
>
>
> (uhhI'm not an expert at all, but the above came immediately to my mind)
>
> --
> Met vriendelijke groet,
>
> Martijn Bos
> +31 6 39477001
>
> (Public pgp-key : http://maboc.nl/pubkey.maboc.asc)
maboc.nl
maboc.nl
-BEGIN PGP PUBLIC KEY BLOCK- Version: GnuPG v1 
mQENBFJ6LpgBCADL9w2eicatZKiw4xijCVC8WZpcPOr2So6jFfQ6nWk3bTXoVsHk 
sYgdLIFeCn9Wn+EeC+CSoosyMcUeijKH5yVqc/mcg0 ...



> maboc.nl
> maboc.nl
> -BEGIN PGP PUBLIC KEY BLOCK- Version: GnuPG v1 
> mQENBFJ6LpgBCADL9w2eicatZKiw4xijCVC8WZpcPOr2So6jFfQ6nWk3bTXoVsHk 
> sYgdLIFeCn9Wn+EeC+CSoosyMcUeijKH5yVqc/mcg0 ...
>
>
>
>


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



RE: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread Moore, Jon, Vodafone UK
Thanks Andre.

When I open up tomcat6w.exe the fields are all blank, hence trying to find out 
what the defaults are before I enter anything in them as I don't want to put in 
a lesser value then the defaults.

-Original Message-
From: André Warnier (tomcat) [mailto:a...@ice-sa.com] 
Sent: 21 October 2016 09:34
To: users@tomcat.apache.org
Subject: Re: java.lang.OutOfMemoryError: PermGen space

On 21.10.2016 09:46, Moore, Jon, Vodafone UK wrote:
> Thanks Chris. (and to everyone else who has replied)
>
> Yes I am a novice at Java as well. I support the IVR system that points to 
> the application servers and have ended up trying to resolve this issue as our 
> developers of the applications can't help.
>
> The way we are told on the training to deploy the application in the IVR is 
> to use the deploy/un-deploy options in tomcat manager. I have also seen a 
> colleague make a copy of the applications war file away from its normal 
> folder (webapps), stop the tomcat Windows service, delete the applications 
> deployed folder and restart the tomcat windows service to re-deploy the 
> application.
>
> I have tried to run the commands you suggested from a CMD box but nothing 
> gets outputted.
>

Some additional info :

When Tomcat is running as a Service under Windows, the Java command-line 
switches (which allow to control the Java memory sizes among other tings), are 
stored in the Windows Registry.  The Windows Tomcat-as-a-Service installation 
includes a program (named "tomcat(version)w.exe", which is a kind of GUI 
Registry Editor, specially for these Java/Tomcat related parameters.  Normally, 
this program is running, and appears as a small Apache icon at the bottom right 
of the console.
That is the program that you should use, to change the Java startup parameters, 
and stop/start Tomcat.

As explained in previous posts here on this list, and in some of the articles 
to which I pointed you in Google, it may be that your issue is only that the 
default PermGen size, is insufficient for your application(s), and that just 
increasing the Java PermGen size would solve the problem definitely.

Or not, if the application is flawed. But you can at least try.

For the full story about tomcat(x)w.exe, try the Tomcat FAQ (which does not 
seem to be on-line right now, or very slow), and look for an article entitled 
"what are tomcatx.exe and tomcatxw.exe".
Ah, here : http://wiki.apache.org/tomcat/FAQ/Windows


>
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: 20 October 2016 17:40
> To: Tomcat Users List
> Subject: Re: java.lang.OutOfMemoryError: PermGen space
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Jon,
>
> On 10/20/16 6:00 AM, Moore, Jon, Vodafone UK wrote:
>> I have a problem where our customers application server stops working 
>> intermittently and when we check the Tomcat logs we get the message "
>> java.lang.OutOfMemoryError: PermGen space" but the Tomcat service is 
>> still running, and we have to restart the Tomcat service. I am a 
>> complete novice when it comes to Tomcat but am expected to resolve 
>> this issue as this server is part of the Avaya telephony solution.
>>
>> I have 2 questions please.
>>
>> 1 - What would be causing this.
>
> Are you also a Java novice as well? No judgement... I just want to 
> adjust my level of snark appropriately :)
>
> Java has a special heap space called the "permanent generation" (a term which 
> becomes less descriptive as time goes on) but basically all java.lang.Class 
> objects loaded by the JVM go there. The more libraries and other stuff that 
> gets loaded, the more space in permgen is used.
> The defaults for the size of permgen are often fairly small, and you may have 
> to raise them. This is especially true for applications that use large 
> frameworks like Spring.
>
> Raising the permgen space is almost always the right decision under normal 
> circumstances when you get an OOME:permgen error. I would double whatever its 
> current value is and monitor the application for a while to see if that 
> improves things.
>
> The only situation I know of where raising the permgen size is not the right 
> move is when there is a "classloader-pinning leak". That happens when you 
> hot-deploy an application many times, but the old versions of the application 
> are not undeploying cleanly. This situation is quite the rabbit-hole, so I'll 
> stop there unless you can confirm that you do hot-deployments without 
> restarting Tomcat and the JVM.
>
> If you instead get OOME for other reasons, it's frequently NOT the 
> right decision to increase the heap size because it usually indicates 
> that there is a memory leak in the application and giving it more heap 
> just means you'll wait longer between failures. Instead, the 
> application should be fixed to not leak memory :)
>
>> 2 - What are the default Java memory settings for Initial memory 
>> pool, maximum memory pool size and 

Re: Question about ServletOutputStream.setWriteListener

2016-10-21 Thread Violeta Georgieva
2016-10-20 21:47 GMT+03:00 Mark Thomas :
>
> On 20/10/2016 14:08, Violeta Georgieva wrote:
> > Hi,
> >
> > I have a question about ServletOutputStream.setWriteListener.
> >
> > I have the following scenario:
> > - Request 1 - in the servlet service method it starts async operation
and
> > starts waiting for a particular notification
> > - Request 2  - in the servlet service method it starts async operation
and
> > notifies the Request 1 to write to the response
> > - During this notification Request 1 sets WriteListener. This happens
while
> > we are still in the service method of the servlet for Request 2 i.e.
this
> > happens in the thread that processes Request 2.
> > - Request 1 starts waiting for onWritePossible but the event is never
sent.
> >
> > So the question is whether it is allowed to set the WriteListener from
the
> > thread that is processing another request?
>
> Yes, but we don't handle that very well. That looks like a bug to me.
>
> > I can see that when setWriteListener is invoked [1] we add to the
> > dispatches - NON_BLOCKING_WRITE - this is a result of the DISPATCH_WRITE
> > action.
> > But I think that we have to invoke DISPATCH_EXECUTE.
> >
> > I tried to extract one very simple example [2] that shows the scenario.
>
> Can you turn that into a unit test for the AsyncContext?

http://svn.apache.org/viewvc?view=revision=1765995
I added a test. It is marked with @Ignore as it will fail with the current
implementation.

Thanks,
Violeta

> Mark
>
>
> >
> > What do you think?
> >
> > Thanks,
> > Violeta
> >
> > [1]
> >
https://github.com/apache/tomcat/blob/trunk/java/org/apache/coyote/Response.java#L607
> > [2] https://github.com/violetagg/test-write-listener
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>


Re: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread tomcat

On 21.10.2016 09:46, Moore, Jon, Vodafone UK wrote:

Thanks Chris. (and to everyone else who has replied)

Yes I am a novice at Java as well. I support the IVR system that points to the 
application servers and have ended up trying to resolve this issue as our 
developers of the applications can't help.

The way we are told on the training to deploy the application in the IVR is to 
use the deploy/un-deploy options in tomcat manager. I have also seen a 
colleague make a copy of the applications war file away from its normal folder 
(webapps), stop the tomcat Windows service, delete the applications deployed 
folder and restart the tomcat windows service to re-deploy the application.

I have tried to run the commands you suggested from a CMD box but nothing gets 
outputted.



Some additional info :

When Tomcat is running as a Service under Windows, the Java command-line switches (which 
allow to control the Java memory sizes among other tings), are stored in the Windows 
Registry.  The Windows Tomcat-as-a-Service installation includes a program (named 
"tomcat(version)w.exe", which is a kind of GUI Registry Editor, specially for these 
Java/Tomcat related parameters.  Normally, this program is running, and appears as a small 
Apache icon at the bottom right of the console.
That is the program that you should use, to change the Java startup parameters, and 
stop/start Tomcat.


As explained in previous posts here on this list, and in some of the articles to which I 
pointed you in Google, it may be that your issue is only that the default PermGen size, is 
insufficient for your application(s), and that just increasing the Java PermGen size would 
solve the problem definitely.


Or not, if the application is flawed. But you can at least try.

For the full story about tomcat(x)w.exe, try the Tomcat FAQ (which does not seem to be 
on-line right now, or very slow), and look for an article entitled "what are tomcatx.exe 
and tomcatxw.exe".

Ah, here : http://wiki.apache.org/tomcat/FAQ/Windows




-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: 20 October 2016 17:40
To: Tomcat Users List
Subject: Re: java.lang.OutOfMemoryError: PermGen space

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jon,

On 10/20/16 6:00 AM, Moore, Jon, Vodafone UK wrote:

I have a problem where our customers application server stops working
intermittently and when we check the Tomcat logs we get the message "
java.lang.OutOfMemoryError: PermGen space" but the Tomcat service is
still running, and we have to restart the Tomcat service. I am a
complete novice when it comes to Tomcat but am expected to resolve
this issue as this server is part of the Avaya telephony solution.

I have 2 questions please.

1 - What would be causing this.


Are you also a Java novice as well? No judgement... I just want to adjust my 
level of snark appropriately :)

Java has a special heap space called the "permanent generation" (a term which 
becomes less descriptive as time goes on) but basically all java.lang.Class objects 
loaded by the JVM go there. The more libraries and other stuff that gets loaded, the more 
space in permgen is used.
The defaults for the size of permgen are often fairly small, and you may have 
to raise them. This is especially true for applications that use large 
frameworks like Spring.

Raising the permgen space is almost always the right decision under normal 
circumstances when you get an OOME:permgen error. I would double whatever its 
current value is and monitor the application for a while to see if that 
improves things.

The only situation I know of where raising the permgen size is not the right move is when 
there is a "classloader-pinning leak". That happens when you hot-deploy an 
application many times, but the old versions of the application are not undeploying 
cleanly. This situation is quite the rabbit-hole, so I'll stop there unless you can 
confirm that you do hot-deployments without restarting Tomcat and the JVM.

If you instead get OOME for other reasons, it's frequently NOT the right 
decision to increase the heap size because it usually indicates that there is a 
memory leak in the application and giving it more heap just means you'll wait 
longer between failures. Instead, the application should be fixed to not leak 
memory :)


2 - What are the default Java memory settings for Initial memory pool,
maximum memory pool size and thread stack size when the fields are
blank when you use the "Configure Tomcat" interface on Windows. I was
wondering if changing one or more of these settings would help ?


The default depends upon the JVM and the OS.


We are running Tomcat 6.0.26 on Windows Server 2008 R2 standard and
JVM version is 1.6.0_20-b02


Best way to find out for sure[1] is:

C:\> java -XX:+PrintFlagsFinal -version 2>&1 | findstr HeapSize

The two settings you are looking for are MaxHeapSize and InitialHeapSize. Those values 
are in bytes, so you'll 

R: Host appBase vs. Context docBase

2016-10-21 Thread r.bottoni
Hello,
did you received some real config?
Roberto.
 
-Messaggio originale-
Da: Igal @ Lucee.org [mailto:i...@lucee.org] 
Inviato: venerdì 7 ottobre 2016 21:57
A: Tomcat Users List 
Oggetto: Re: Host appBase vs. Context docBase

> Suppose you tell us your Tomcat version.
I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK this has
not changed in years.

> It is highly unlikely that you want the  name to be App1
Of course that my host name is not App1, that was to remove fluff and to
keep only the relevant information in the email.

> The path attribute of the  element must not be used unless 
> the  element is in server.xml, which it should not be
I actually prefer it to be in server.xml

> The docBase attribute is used only when the  element is 
> located in conf/Catalina/[host]/[appName].xml
That is definitely not true.  I've set up Tomcat many many times like this
and it works.  I may have not set it up the best way, hence my question
here, but the docBase attribute is indeed, used.

> You need to read the documentation for , , and deployment
for the Tomcat version you're using.
It would have been nice to see some real life examples of complete
configurations.

Igal Sapir
Lucee Core Developer
Lucee.org 

On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:
>> From: Igal @ Lucee.org [mailto:i...@lucee.org]
>> Subject: Host appBase vs. Context docBase Suppose that I have an 
>> application at C:\WebApps\App1
> Suppose you tell us your Tomcat version.
>
>> 
>>  
>> 
>> 
>> 
>> 
> Both of the above are incorrect.  It is highly unlikely that you want the
 name to be App1.  The appBase attribute of  must point to a
directory where one or more webapps are located for automatic deployment.
It must never point to a specific webapp.  The path attribute of the
 element must not be used unless the  element is in
server.xml, which it should not be.  The docBase attribute is used only when
the  element is located in conf/Catalina/[host]/[appName].xml.
>
> You need to read the documentation for , , and deployment
for the Tomcat version you're using.
>
>   - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>



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



Re: Using digest.bat or digest.sh with Tomcat version 8 gives strange results

2016-10-21 Thread Mark Thomas
On 21/10/2016 08:22, Thomas Hoffmann (Speed4Trade GmbH) wrote:
> Hello,
> 
> I am using Apache Tomcat/8.0.32 and the tool digest.sh and digest.bat returns 
> maybe wrong results.

Nope.

> When i test under Ubuntu Xenial i get the following results:
> ./digest.sh -a sha foo
> foo:d4b2c2a918630e63e2796a92c6269417f992ba4038811ca1711e72af772619ad$1$aa6235fbec4962c26e9ccb0efcb5aebf2af49b86
> 
> ./digest.sh -a md5 foo
> foo:4e5b42806cc055bc4b4378521f86419ce882386b15068d079e387bff8299adc2$1$adc491e6773ceb0a0463b09f322d9be3

As expected.

> With Tomcat 6.0.35 i get correct results:
> ./digest.sh -a sha foo
> foo:0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33
> 
> ./digest.sh -a MD5 foo
> foo:acbd18db4cc2f85cedef654fccc4a4d8

Also as expected.

> Did some parameters change or how do I get an md5 or sha1 hash with 
> digest-script?

http://tomcat.apache.org/migration-8.html#Realms

> Is the script working correctly?

Yes.

Mark

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



RE: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread Moore, Jon, Vodafone UK
Thanks Chris. (and to everyone else who has replied)

Yes I am a novice at Java as well. I support the IVR system that points to the 
application servers and have ended up trying to resolve this issue as our 
developers of the applications can't help.

The way we are told on the training to deploy the application in the IVR is to 
use the deploy/un-deploy options in tomcat manager. I have also seen a 
colleague make a copy of the applications war file away from its normal folder 
(webapps), stop the tomcat Windows service, delete the applications deployed 
folder and restart the tomcat windows service to re-deploy the application.

I have tried to run the commands you suggested from a CMD box but nothing gets 
outputted.

Regards

Jon Moore 

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: 20 October 2016 17:40
To: Tomcat Users List
Subject: Re: java.lang.OutOfMemoryError: PermGen space

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jon,

On 10/20/16 6:00 AM, Moore, Jon, Vodafone UK wrote:
> I have a problem where our customers application server stops working 
> intermittently and when we check the Tomcat logs we get the message " 
> java.lang.OutOfMemoryError: PermGen space" but the Tomcat service is 
> still running, and we have to restart the Tomcat service. I am a 
> complete novice when it comes to Tomcat but am expected to resolve 
> this issue as this server is part of the Avaya telephony solution.
> 
> I have 2 questions please.
> 
> 1 - What would be causing this.

Are you also a Java novice as well? No judgement... I just want to adjust my 
level of snark appropriately :)

Java has a special heap space called the "permanent generation" (a term which 
becomes less descriptive as time goes on) but basically all java.lang.Class 
objects loaded by the JVM go there. The more libraries and other stuff that 
gets loaded, the more space in permgen is used.
The defaults for the size of permgen are often fairly small, and you may have 
to raise them. This is especially true for applications that use large 
frameworks like Spring.

Raising the permgen space is almost always the right decision under normal 
circumstances when you get an OOME:permgen error. I would double whatever its 
current value is and monitor the application for a while to see if that 
improves things.

The only situation I know of where raising the permgen size is not the right 
move is when there is a "classloader-pinning leak". That happens when you 
hot-deploy an application many times, but the old versions of the application 
are not undeploying cleanly. This situation is quite the rabbit-hole, so I'll 
stop there unless you can confirm that you do hot-deployments without 
restarting Tomcat and the JVM.

If you instead get OOME for other reasons, it's frequently NOT the right 
decision to increase the heap size because it usually indicates that there is a 
memory leak in the application and giving it more heap just means you'll wait 
longer between failures. Instead, the application should be fixed to not leak 
memory :)

> 2 - What are the default Java memory settings for Initial memory pool, 
> maximum memory pool size and thread stack size when the fields are 
> blank when you use the "Configure Tomcat" interface on Windows. I was 
> wondering if changing one or more of these settings would help ?

The default depends upon the JVM and the OS.

> We are running Tomcat 6.0.26 on Windows Server 2008 R2 standard and 
> JVM version is 1.6.0_20-b02

Best way to find out for sure[1] is:

C:\> java -XX:+PrintFlagsFinal -version 2>&1 | findstr HeapSize

The two settings you are looking for are MaxHeapSize and InitialHeapSize. Those 
values are in bytes, so you'll probably have to divide by 1024 a couple of 
times to get at the "real" value in human-readable terms.

The best way to find the default permgen size is:

C:\> java -XX:+PrintFlagsFinal -version 2>&1  | findstr PermSize

Hope that helps,
- -chris

[1]
http://stackoverflow.com/questions/2915276/what-is-the-default-maximum-h
eap-size-for-suns-jvm-from-java-se-6
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYCPN3AAoJEBzwKT+lPKRYCXEQAK3AKioa7kRPTvs24yj+1vq6
SFo20WtjFhBrqyhSRdcvcwUjoDAIS6d6wqjDQ13v919jFRTsqCrDh9FQg1MeCWVB
UJVmcV33XjTQUmqEY03YUPwOVjgQe6RJM+FJAE60werkHEEirg85gL/WamQ+QtfW
C39sp2NO6kHpD7VWnBKPhToNmcy7lz2EK6Ye8aEXkn2mk2PZhJFRysgTqeJ/CChA
KnUzWAqrDBM3OtHerivHuIEHhJB7+43bD9kiX7JZXDlcVkubAz6bep3m2sXO3T9O
VYZs0ACKvnzuc6kqkStMcsGUeLWvYc5+xhCDNcxGhYXjrIWOaW5aS9QipZmAXze7
IoY2UC4vxyajRNuFmLeUWaeICDtYZaf/5d3wrlsbCIWF/vf2C+NpuynEidq6N6Yv
pFvTqRd+ZsNEbsKaQwaHSHsfQVxtQbPlFfUlYWvu7vz+Y5xCyTSFoct2UqDcBedi
Bo+vdHVoih/i9+4Zhg+Bieh5lygcoE9VS0KX2yu+4kwaaSohFoxwHcHXoD1SjXTU
FDq2H+GXV/3bS/hAek+5WzQuPJC5etsqcMUfIcf8YjrDmR6BabEvQFk5p9APYV+x
7lcODhWFlF3tEOvKiIRmPuQz/d4/hR5ETo6h12g2UMsfY9ogEZF7I8SP1uNK3bpO
cH97Lssd2MS5qj/Kd/m5
=JBc2

Using digest.bat or digest.sh with Tomcat version 8 gives strange results

2016-10-21 Thread Thomas Hoffmann (Speed4Trade GmbH)
Hello,

I am using Apache Tomcat/8.0.32 and the tool digest.sh and digest.bat returns 
maybe wrong results.

When i test under Ubuntu Xenial i get the following results:
./digest.sh -a sha foo
foo:d4b2c2a918630e63e2796a92c6269417f992ba4038811ca1711e72af772619ad$1$aa6235fbec4962c26e9ccb0efcb5aebf2af49b86

./digest.sh -a md5 foo
foo:4e5b42806cc055bc4b4378521f86419ce882386b15068d079e387bff8299adc2$1$adc491e6773ceb0a0463b09f322d9be3

With Tomcat 6.0.35 i get correct results:
./digest.sh -a sha foo
foo:0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33

./digest.sh -a MD5 foo
foo:acbd18db4cc2f85cedef654fccc4a4d8

Did some parameters change or how do I get an md5 or sha1 hash with 
digest-script?
Is the script working correctly?

Thanks for your support,
Tom


Tomcat crashes with java 1.7

2016-10-21 Thread Rajesh Cherukuri
hi

can some one help me on this , tomcat servers crashes if i use java 1.7 , i
have tried chaining this to java 1.6 and i am be to start the tomcat ,
issue is only when i use 1.7

here is the log when i use 1.7 after it crashes






Oct 21, 2016 7:37:28 AM org.apache.catalina.core.StandardService
startInternal
INFO: Starting service Catalina
Oct 21, 2016 7:37:28 AM org.apache.catalina.core.StandardEngine
startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.53
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xfbc7e41c, pid=2081, tid=21
#
# JRE version: Java(TM) SE Runtime Environment (7.0_79-b15) (build
1.7.0_79-b15)
# Java VM: Java HotSpot(TM) Server VM (24.79-b02 mixed mode solaris-sparc )
# Problematic frame:
# J 78 C2
java.util.HashMap.getEntry(Ljava/lang/Object;)Ljava/util/HashMap$Entry; (86
bytes) @ 0xfbc7e41c [0xfbc7e380+0x9c]
#
# Core dump written. Default location:
/softs/gnu/ISOTomcat7/tomcatcore/temp/core or core.2081
#
# An error report file with more information is saved as:
# /softs/gnu/Tomcat7/tomcatcore/temp/hs_err_pid2181.log
Compiled method (c2)   13710   78 java.util.HashMap::getEntry
(86 bytes)
 total in heap  [0xfbc7e288,0xfbc7e6ec] = 1124
 relocation [0xfbc7e354,0xfbc7e380] = 44
 main code  [0xfbc7e380,0xfbc7e500] = 384
 stub code  [0xfbc7e500,0xfbc7e530] = 48
 oops   [0xfbc7e530,0xfbc7e544] = 20
 scopes data[0xfbc7e544,0xfbc7e5fc] = 184
 scopes pcs [0xfbc7e5fc,0xfbc7e68c] = 144
 dependencies   [0xfbc7e68c,0xfbc7e690] = 4
 handler table  [0xfbc7e690,0xfbc7e6d8] = 72
 nul chk table  [0xfbc7e6d8,0xfbc7e6ec] = 20
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp






-
HS error log



---  T H R E A D  ---

Current thread (0x00531000):  JavaThread "localhost-startStop-1" daemon
[_thread_in_Java, id=21, stack(0xe5b1,0xe5b9)]

siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR),
si_addr=0x672f4374

Registers:
 G1=0xff80 G2=0x00531000 G3=0xfa5b4be8 G4=0xe5b8f044
 G5=0xe7405408 G6=0x G7=0xfdeb9a00 Y=0x
 O0=0x00019ec3 O1=0xe5b8f048 O2=0xe5b8f04c O3=0xfbc177e0
 O4=0x115f O5=0x O6=0xe5b8efa0 O7=0xfbc7e47c
 L0=0x00125b4c L1=0x0400 L2=0xfdea8000 L3=0xf6fb6cb0
 L4=0x000a L5=0x0001840a L6=0xe74bec20 L7=0xe7493ab0
 I0=0x672f436c I1=0xfa5b4be8 I2=0xe5b8f0d8 I3=0xfbc1b140
 I4=0x0470 I5=0xe5b8efe8 I6=0xe5b8efe8 I7=0xfbc066d0
 PC=0xfbc7e41c nPC=0xfbc7e420


Top of Stack: (sp=0xe5b8efa0)
0xe5b8efa0:   00125b4c 0400 fdea8000 f6fb6cb0
0xe5b8efb0:   000a 0001840a e74bec20 e7493ab0
0xe5b8efc0:   672f436c fa5b4be8 e5b8f0d8 fbc1b140
0xe5b8efd0:   0470 e5b8efe8 e5b8efe8 fbc066d0
0xe5b8efe0:     e5b8f044 e74ba5b2
0xe5b8eff0:   e74ba5c8 e5b8f0dc e5b8f050 e5b8efe8
0xe5b8f000:   e74bc180 0001b407 f6fb2fa0 e742d538
0xe5b8f010:   e7dfdca4 fbc1b140 e7407be8 e5b8f068

Instructions: (pc=0xfbc7e41c)
0xfbc7e3fc:   e2 04 a0 08 a0 04 7f ff a8 0c 00 15 a1 2d 20 02
0xfbc7e40c:   a6 04 80 10 3a c5 03 d1 f0 04 e0 0c 12 c6 02 00
0xfbc7e41c:   e0 06 20 08 32 c4 01 55 d2 06 20 0c 12 c2 41 b9
0xfbc7e42c:   90 10 00 19 c6 02 20 04 ca 00 e1 24 c6 01 60 4c

Register to memory mapping:

G1=0xff80 is an unknown value
G2=0x00531000 is a thread
G3=0xfa5b4be8 is an oop
java.lang.String
 - klass: 'java/lang/String'
G4=0xe5b8f044 is pointing into the stack for thread: 0x00531000
G5=0xe7405408 is an oop
{method}
 - klass: {other class}
G6=0x is an unknown value
G7=0xfdeb9a00 is an unknown value

O0=0x00019ec3 is an unknown value
O1=0xe5b8f048 is pointing into the stack for thread: 0x00531000
O2=0xe5b8f04c is pointing into the stack for thread: 0x00531000
O3=0xfbc177e0 is at code_begin+64 in an Interpreter codelet
return  177 return  [0xfbc177a0, 0xfbc17980]  480 bytes
O4=0x115f is an unknown value
O5=0x is an unknown value
O6=0xe5b8efa0 is pointing into the stack for thread: 0x00531000
O7=0xfbc7e47c is at entry_point+252 in (nmethod*)0xfbc7e288

L0=0x00125b4c is an unknown value
L1=0x0400 is an unknown value
L2=0xfdea8000 is an unknown value
L3=0xf6fb6cb0 is an unknown value
L4=0x000a is an unknown value
L5=0x0001840a is an unknown value
L6=0xe74bec20 is an oop
{constant pool cache}
 - klass: {other class}
 -
  0  (0xe74bec30)  [00|b7|1]
 [   0xe74be028]
 [   0x]
 [   0x8042]
 -
  1  (0xe74bec40)  [b5|b4|2]
 [   0xfa2f2818]
 [   0x001c]
 [   0x7440]
 -
  2  (0xe74bec50)  [00|b7|3]
 [   0xe74be558]
 [   0x]
 [   0x8002]
 -
  3  (0xe74bec60)  [b6|00|4]
 [   0x]
 [   0xe74be6f8]
   

Re: Allow Customization of service.bat

2016-10-21 Thread Violeta Georgieva
Hi,

2016-10-21 1:23 GMT+03:00 Igal @ Lucee.org :
>
> Hi Mark,
>
> On 10/20/2016 1:19 PM, Mark Thomas wrote:
>>
>>
>>> Can I submit a patch for that?
>>
>> Sure. Got for it.
>
>
> I'm not very familiar with SVN (hopefully Apache will move to GIT soon),
so I wasn't sure where to submit the patch.
>
> The Apache Contributors Guide suggests the bug tracking platform. Should
I create a ticket in Bugzilla and add the patch there?
>
> I also attached the patch file here for convenience.
>
> Thank you,

Here [1] it is described how you can report a bug. Attach the patch to the
bug. When you attaching the file there is a checkbox "patch".
We also accept PRs from GitHub [2].

[1] http://tomcat.apache.org/bugreport.html#Reporting_Apache_Tomcat_bugs
[2] https://github.com/apache/tomcat

Regards,
Violeta

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