Re: context root with relative path

2016-04-20 Thread David kerber

On 4/20/2016 12:07 PM, Dimitar Valov wrote:

System.out.println(new File("C:").exists()); prints true, so I guess it
works okay.


All that means is that it does something.  That doesn't means it's doing 
the correct thing.  That *should* be checking the existence of the 
"current" directory, which is always going to succeed.  The question is, 
is it actually checking for the existence of the root directory?  And 
what does


new File("C:\").exists()

give you?  And is it different?





On Wed, Apr 20, 2016 at 3:31 PM, Konstantin Kolinko 
wrote:


2016-04-19 22:42 GMT+03:00 Mark Thomas :

On 19/04/2016 19:38, Dimitar Valov wrote:

All static resources such as index.html will not be found when

application

is added with , for example

tomcat

is put inside the application's META-INF.

I've drilled down that the AbstractFileResourceSet class is responsible

for

this behaviour, inside the protected final File file(String name,

boolean

mustExist) method. There absoluteBase and canonicalBase (absolute,

unique

with resolved symlinks) are used to determine if the file should be
accessed based on a case sensitivity check.

Everything works fine if the docBase is not just path like

../../.././../

but has an actual directory at the end, like ../../../web-app. However

in

this edgy case the difference appears since the behaviour of
the org.apache.tomcat.util.http.RequestUtil.normalize method has

slightly

different behavior than the File.getCanonicalPath.

System.out.println(RequestUtil.normalize("/base/1/2/3/../../../"));
/base/

System.out.println(RequestUtil.normalize("/base/1/2/3/../../.."));
/base/1/..
System.out.println(new

File("/base/1/2/3/../../../").getCanonicalPath());

/base

The added /from RequestUtil breakes the logic inside the file method,

since

when doing the substring operation inside AbstractFileResourceSet.file
method it may or may not have a trailing /. In such situation /index.html substring with the absoluteBase becomes ndex.html. At

the

end the file method returns from here:

 if (!canPath.equals(absPath)) //

!"index.html".equals("ndex.html")

=> true
 return null;

The RequestUtil comes from the http packages and follows their

conventions

when normalizing the path, so an obvious way to fix this is to add and

if

statement after the normalization
inside AbstractFileResourceSet.initInternal.

 this.absoluteBase = normalize(absolutePath);
 if (this.absoluteBase.endsWith("/")) {
 this.absoluteBase = this.absoluteBase.substring(0,
this.absoluteBase.length() - 1);
 }

With Java 7 instead of using the RequestUtil for normalization, Path
java.nio.file.Path.normalize() can accomplish the correct thing.

Do you think that is something that can be fixed? Maybe the above is not
the best approach, however it's the least invasive.


We need to be very careful here since this is security sensitive.

Given that normalize handles URIs, there is an argument for slightly
different handling of trailing '/'. I'm currently of the view (subject
to the results of some local tests I am running) that if the input ends
in '/', so should the output. If the input doesn't end in '/' neither
should the output unless the output is the string "/".

The end result is likely to be that docBase values should not end in "/".



(I have not looked at the context. Just a general comment / review of
r1740134)

There is a risk of normalizing Windows path of "C:\foo\.." into "C:"
which denotes the current directory on drive C:  while the expected
value is the root of the drive, "C:\".

I have not tested how  java.io.File("C:") actually works.

Best regards,
Konstantin Kolinko

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







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



RE: context root with relative path

2016-04-20 Thread Caldarale, Charles R
> From: Dimitar Valov [mailto:dimitar.va...@gmail.com] 
> Subject: Re: context root with relative path

> System.out.println(new File("C:").exists()); prints true, so I guess it
> works okay.

Depends on the definition of "okay"; that only tells us that the C drive's 
current directory is present.  As Konstantin pointed out, the normalization 
should have produced "C:\" - which will also pass the exists() test.

 - Chuck


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


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



Re: context root with relative path

2016-04-20 Thread Dimitar Valov
System.out.println(new File("C:").exists()); prints true, so I guess it
works okay.

On Wed, Apr 20, 2016 at 3:31 PM, Konstantin Kolinko 
wrote:

> 2016-04-19 22:42 GMT+03:00 Mark Thomas :
> > On 19/04/2016 19:38, Dimitar Valov wrote:
> >> All static resources such as index.html will not be found when
> application
> >> is added with , for example
> tomcat
> >> is put inside the application's META-INF.
> >>
> >> I've drilled down that the AbstractFileResourceSet class is responsible
> for
> >> this behaviour, inside the protected final File file(String name,
> boolean
> >> mustExist) method. There absoluteBase and canonicalBase (absolute,
> unique
> >> with resolved symlinks) are used to determine if the file should be
> >> accessed based on a case sensitivity check.
> >>
> >> Everything works fine if the docBase is not just path like
> ../../.././../
> >> but has an actual directory at the end, like ../../../web-app. However
> in
> >> this edgy case the difference appears since the behaviour of
> >> the org.apache.tomcat.util.http.RequestUtil.normalize method has
> slightly
> >> different behavior than the File.getCanonicalPath.
> >>
> >> System.out.println(RequestUtil.normalize("/base/1/2/3/../../../"));
> >> /base/
> >>
> >> System.out.println(RequestUtil.normalize("/base/1/2/3/../../.."));
> >> /base/1/..
> >> System.out.println(new
> File("/base/1/2/3/../../../").getCanonicalPath());
> >> /base
> >>
> >> The added /from RequestUtil breakes the logic inside the file method,
> since
> >> when doing the substring operation inside AbstractFileResourceSet.file
> >> method it may or may not have a trailing /. In such situation  >> path>/index.html substring with the absoluteBase becomes ndex.html. At
> the
> >> end the file method returns from here:
> >>
> >> if (!canPath.equals(absPath)) //
> !"index.html".equals("ndex.html")
> >> => true
> >> return null;
> >>
> >> The RequestUtil comes from the http packages and follows their
> conventions
> >> when normalizing the path, so an obvious way to fix this is to add and
> if
> >> statement after the normalization
> >> inside AbstractFileResourceSet.initInternal.
> >>
> >> this.absoluteBase = normalize(absolutePath);
> >> if (this.absoluteBase.endsWith("/")) {
> >> this.absoluteBase = this.absoluteBase.substring(0,
> >> this.absoluteBase.length() - 1);
> >> }
> >>
> >> With Java 7 instead of using the RequestUtil for normalization, Path
> >> java.nio.file.Path.normalize() can accomplish the correct thing.
> >>
> >> Do you think that is something that can be fixed? Maybe the above is not
> >> the best approach, however it's the least invasive.
> >
> > We need to be very careful here since this is security sensitive.
> >
> > Given that normalize handles URIs, there is an argument for slightly
> > different handling of trailing '/'. I'm currently of the view (subject
> > to the results of some local tests I am running) that if the input ends
> > in '/', so should the output. If the input doesn't end in '/' neither
> > should the output unless the output is the string "/".
> >
> > The end result is likely to be that docBase values should not end in "/".
> >
>
> (I have not looked at the context. Just a general comment / review of
> r1740134)
>
> There is a risk of normalizing Windows path of "C:\foo\.." into "C:"
> which denotes the current directory on drive C:  while the expected
> value is the root of the drive, "C:\".
>
> I have not tested how  java.io.File("C:") actually works.
>
> Best regards,
> Konstantin Kolinko
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: context root with relative path

2016-04-20 Thread Konstantin Kolinko
2016-04-19 22:42 GMT+03:00 Mark Thomas :
> On 19/04/2016 19:38, Dimitar Valov wrote:
>> All static resources such as index.html will not be found when application
>> is added with , for example tomcat
>> is put inside the application's META-INF.
>>
>> I've drilled down that the AbstractFileResourceSet class is responsible for
>> this behaviour, inside the protected final File file(String name, boolean
>> mustExist) method. There absoluteBase and canonicalBase (absolute, unique
>> with resolved symlinks) are used to determine if the file should be
>> accessed based on a case sensitivity check.
>>
>> Everything works fine if the docBase is not just path like ../../.././../
>> but has an actual directory at the end, like ../../../web-app. However in
>> this edgy case the difference appears since the behaviour of
>> the org.apache.tomcat.util.http.RequestUtil.normalize method has slightly
>> different behavior than the File.getCanonicalPath.
>>
>> System.out.println(RequestUtil.normalize("/base/1/2/3/../../../"));
>> /base/
>>
>> System.out.println(RequestUtil.normalize("/base/1/2/3/../../.."));
>> /base/1/..
>> System.out.println(new File("/base/1/2/3/../../../").getCanonicalPath());
>> /base
>>
>> The added /from RequestUtil breakes the logic inside the file method, since
>> when doing the substring operation inside AbstractFileResourceSet.file
>> method it may or may not have a trailing /. In such situation > path>/index.html substring with the absoluteBase becomes ndex.html. At the
>> end the file method returns from here:
>>
>> if (!canPath.equals(absPath)) // !"index.html".equals("ndex.html")
>> => true
>> return null;
>>
>> The RequestUtil comes from the http packages and follows their conventions
>> when normalizing the path, so an obvious way to fix this is to add and if
>> statement after the normalization
>> inside AbstractFileResourceSet.initInternal.
>>
>> this.absoluteBase = normalize(absolutePath);
>> if (this.absoluteBase.endsWith("/")) {
>> this.absoluteBase = this.absoluteBase.substring(0,
>> this.absoluteBase.length() - 1);
>> }
>>
>> With Java 7 instead of using the RequestUtil for normalization, Path
>> java.nio.file.Path.normalize() can accomplish the correct thing.
>>
>> Do you think that is something that can be fixed? Maybe the above is not
>> the best approach, however it's the least invasive.
>
> We need to be very careful here since this is security sensitive.
>
> Given that normalize handles URIs, there is an argument for slightly
> different handling of trailing '/'. I'm currently of the view (subject
> to the results of some local tests I am running) that if the input ends
> in '/', so should the output. If the input doesn't end in '/' neither
> should the output unless the output is the string "/".
>
> The end result is likely to be that docBase values should not end in "/".
>

(I have not looked at the context. Just a general comment / review of r1740134)

There is a risk of normalizing Windows path of "C:\foo\.." into "C:"
which denotes the current directory on drive C:  while the expected
value is the root of the drive, "C:\".

I have not tested how  java.io.File("C:") actually works.

Best regards,
Konstantin Kolinko

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



Re: pgp-keys jsp taglibs

2016-04-20 Thread Konstantin Kolinko
2016-04-20 10:23 GMT+03:00 Martijn Bos :
> Hi Konstantin,
>
> On 2016-04-20 01:25:25, Konstantin Kolinko wrote:
>> 2016-04-19 23:00 GMT+03:00 Martijn Bos :
>> > Hi all,
>> >
>> > (I post in this list since I downloaded from tomcat.apache.org. If there 
>> > is a more appropriate list, off course I will try overthere)
>> >
>> > 1 - Downloaded the taglibs from 
>> > http://tomcat.apache.org/download-taglibs.cgi#Standard-1.2.5
>>
>> The "verify" word on above page links to a detailed instruction,
>> https://www.apache.org/info/verification.html
>>
>> > 2 - Downloaded the PGP signatures for the files
>> > 2 - Downloaded KEYS. (The pgp public keys from the releaser(s)  of the 
>> > files)
>> > 3 - Imported the keys into gpg:
>> > martijn@radijs:~/external_documents/Downloads$ gpg --import KEYS
>> > gpg: sleutel A7A0233C: publieke sleutel "Jeremy Boynes 
>> > " geïmporteerd
>> > gpg:   Totaal aantal verwerkt: 1
>> > gpg: geïmporteerd: 1  (RSA: 1)
>> > martijn@radijs:~/external_documents/Downloads$
>> >
>> > 4 - checked the signature of the downloaded files:
>> > martijn@radijs:~/external_documents/Downloads$ gpg 
>> > taglibs-standard-impl-1.2.5.jar.asc
>>
>> The above verification command is wrong. You must specify 2 file
>> arguments to gpg --verify.  See the verification.html page that I
>> mentioned above.
>>
>
> Thank you. I didn't read the page in the first place, because I thought I 
> know it all :-(
> (Once again I'm proven wrong)
>
> However (call me stuborn), as far as I understand, in this case my way is not 
> wrong per se.
> The verify is with a detached signature. gpg can deduct (and find) the name 
> of the file, which was signed, from the name of the detached signature.
>
> Below I copy/pasted the same verification with 1 and with 2 arguments. To me 
> the results looks the same
>
> (If the signature and the file name do not match, then my approach will not 
> work at all, ofcourse)
>
>> > gpg: gegevens in `taglibs-standard-impl-1.2.5.jar' worden verondersteld 
>> > ondertekend te zijn
>> > gpg: Ondertekening gemaakt op di 10 mrt 2015 17:11:32 CET met RSA 
>> > sleutel-ID A7A0233C
>> > gpg: Goede handtekening van "Jeremy Boynes "
>> > gpg: Noot: Deze sleutel is vervallen!
>> > Vingerafdruk van de primaire sleutel: 8B46 CA49 EF48 37B8 C7F2  92DA A54A 
>> > D08E A7A0 233C
>> >
>> > It's in dutch :-)
>>
>> Executing the below command before the above one should switch it to English.
>> LANG=C
>>
>> Maybe it also needs  export LANG, I do not remember.
>>
>
> The moment I read your comment I thought:"Could've done that myself"
>
> So ... now in enlish, so everyone can read it:
>
>
> martijn@radijs:~/external_documents/Downloads$ export LANG=C
> martijn@radijs:~/external_documents/Downloads$ gpg --verify 
> taglibs-standard-compat-1.2.5.jar.asc
> gpg: assuming signed data in `taglibs-standard-compat-1.2.5.jar'
> gpg: Signature made Tue Mar 10 17:11:38 2015 CET using RSA key ID A7A0233C
> gpg: Good signature from "Jeremy Boynes "
> gpg: Note: This key has expired!
> Primary key fingerprint: 8B46 CA49 EF48 37B8 C7F2  92DA A54A D08E A7A0 233C
> martijn@radijs:~/external_documents/Downloads$
>
>
> And with the signed file as a second argument:
>
> martijn@radijs:~/external_documents/Downloads$ gpg --verify 
> taglibs-standard-compat-1.2.5.jar.asc taglibs-standard-compat-1.2.5.jar
> gpg: Signature made Tue Mar 10 17:11:38 2015 CET using RSA key ID A7A0233C
> gpg: Good signature from "Jeremy Boynes "
> gpg: Note: This key has expired!
> Primary key fingerprint: 8B46 CA49 EF48 37B8 C7F2  92DA A54A D08E A7A0 233C
> martijn@radijs:~/external_documents/Downloads$

There was a blog post, explaining the difference.
See a link here:
https://bz.apache.org/bugzilla/show_bug.cgi?id=57103#c6

The issue is that you goal is to verify integrity of the "jar" file.
The 1-arg invocation validates integrity of "asc" file. Whether that
result says anything about the jar depends on what the asc file is.
You may be fooled into a false positive.

The difference between two invocations is the following line:

> gpg: assuming signed data in `taglibs-standard-compat-1.2.5.jar'

It is good that it is printed, but it is easy to miss the case when
that line is missing.


>> > The message is telling me that the file is signed by key A7A0233C
>> > (I never did sign this key myself..there is no trust..so gpg also tells me 
>> > that)
>> > Then gpg tells me "This key is expired"!!!
>> >
>> > I'm not sure what to think of this...Is this a problem, or am I just to 
>> > paranoid?
>> >
>> > Can anyone shine his/her light on this.
>>
>>
>> $ gpg --list-keys A7A0233C
>>
>> pub   2048R/A7A0233C 2012-02-25 [expired: 2016-02-25]
>> uid  Jeremy Boynes 
>>
>>
>> 1. Binaries released and signed before February 2016 are OK.
>>
>
> Thanks, ultimately, that is what I wanted to know :-)
>
>
>> 2. Jeremy needs to do something with his key before signing a next
>> release (if there ever be one).
>> As said elsew

Re: Fwd: bug

2016-04-20 Thread David kerber

On 4/20/2016 3:47 AM, André Warnier (tomcat) wrote:

On 20.04.2016 09:31, Cristian Lorenzetto wrote:

i sincronized the method for sending message but error is the same when
ubuntu is suspended. The connections are not restored correctly when
tomcat
websocket process is wakeup



Ach so ..
You are talking about running Tomcat on an Ubuntu laptop, which goes to
sleep after a while.  That was not clear from your initial explanation,
where it seemed that you were talking about a *client* PC that goes to
sleep.

My personal opinion, is that this case is not really part of the
specification : it is generally assumed that Tomcat is a server-based
process, running on a server with the purpose of serving multiple
clients.  It is not really expected generally that a server would "go to
sleep" in the middle of doing something.


+1.  There is nothing in the spec that mentions how a server should 
handle going to sleep and waking back up, and I would not expect any 
normal service to handle that situation with aplomb.  It's going to be 
up to you to come up with something that serves your needs.








Hi I m using tomcat in ubuntu system. When i leave my pc for 10 mins
  system is suspended. When i return to work i have this exception

java.lang.IllegalStateException: The remote endpoint was in state
[BINARY_PARTIAL_WRITING] which is an invalid state for called method
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase$StateMachine.checkState(WsRemoteEndpointImplBase.java:1213)

at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase$StateMachine.binaryPartialStart(WsRemoteEndpointImplBase.java:1160)

at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendPartialBytes(WsRemoteEndpointImplBase.java:158)

at
org.apache.tomcat.websocket.WsRemoteEndpointBasic.sendBinary(WsRemoteEndpointBasic.java:56)

at
org.springframework.web.socket.adapter.standard.StandardWebSocketSession.sendBinaryMessage(StandardWebSocketSession.java:202)

at
org.springframework.web.socket.adapter.AbstractWebSocketSession.sendMessage(AbstractWebSocketSession.java:108)

at
com.itiboss.utils.FragmentationOutputStream.close(FragmentationOutputStream.java:39)

at com.itiboss.utils.Utils.send(Utils.java:80)
... 21 more




-
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: performance of tomcat 8 is less than tomcat 6

2016-04-20 Thread Ravi Chandra Suryavanshi
Yes I tried the NIO and NIO2 but not seen much difference. The TPS only 
increased 3K  with NIO2.

-Original Message-
From: Igor Cicimov [mailto:icici...@gmail.com] 
Sent: Wednesday, April 20, 2016 4:21 PM
To: Tomcat Users List
Subject: RE: performance of tomcat 8 is less than tomcat 6

On 20 Apr 2016 1:30 pm, "Ravi Chandra Suryavanshi" < 
ravi.chandra.suryavan...@ericsson.com> wrote:
>
> Hi Christopher,
> PFA, the requested XMLs. Just want to highlight that tomcat 8  is not
able to use the CPU usage. I have tried maxThread 200,300,400 but result is 
same sometimes even less TPS.
> Regards,
> Ravi
>
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Tuesday, April 19, 2016 7:38 PM
> To: Tomcat Users List
> Subject: Re: performance of tomcat 8 is less than tomcat 6
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Ravi,
>
> On 4/19/16 1:04 AM, Ravi Chandra Suryavanshi wrote:
> > Hi, I am using tomcat 6 in my product. I am planning to upgrade to 
> > tomcat 8 as tomcat is going to EoS in Dec-2016. I have just taken 
> > the performance of Tomcat 8 and found the 70% less performance 
> > compared to tomcat 6. See the below results Tomcat 6 is giving 
> > 167473.2/s whereas tomcat 8 is giving 100436.6/s I have just 
> > compared with two standalone tomcat which is just hitting the 
> > HelloWorld servlet available in example.
> >
> > Kindly let me know what need to configure to boost the performance.
> >
> > Following are my setup: Java=Java 8 HttpClient=HttpClient4 Benchmark 
> > tool=jmeter
> >
> > testserver:~# uname -a Linux testserver 3.10.0-229.el7.x86_64 #1 SMP 
> > Thu Jan 29 18:37:38 EST 2015 x86_64 x86_64 x86_64 GNU/Linux
> >
> >
> >
> > testserver:~# lscpu Architecture:  x86_64 CPU op-mode(s):
> > 32-bit, 64-bit Byte Order:Little Endian CPU(s):
> > 32 On-line CPU(s) list:   0-31 Thread(s) per core:2 Core(s) per
> > socket:8 Socket(s): 2 NUMA node(s):  2
> > Vendor ID: GenuineIntel CPU family:6 Model:
> > 63 Model name:Intel(R) Xeon(R) CPU E5-2640 v3 @
> > 2.60GHz Stepping:  2 CPU MHz:   2600.000
> > BogoMIPS:  5210.53 Virtualization:VT-x L1d
> > cache: 32K L1i cache: 32K L2 cache:
> > 256K L3 cache:  20480K NUMA node0 CPU(s):
> > 0-7,16-23 NUMA node1 CPU(s): 8-15,24-31
> >
> > testserver:~# vmstat -s 131730840 K total memory 5931052 K used 
> > memory
> > 7126352 K active memory 5511616 K inactive memory 116069376 K free 
> > memory 20888 K buffer memory 9709520 K swap cache 11681788 K total 
> > swap 0 K used swap 11681788 K free swap 54069797 non-nice user cpu 
> > ticks 997 nice user cpu ticks 9712353 system cpu ticks
> > 15112937897 idle cpu ticks 37101 IO-wait cpu ticks 73 IRQ cpu ticks
> > 21245 softirq cpu ticks 0 stolen cpu ticks 8918100 pages paged in
> > 267868897 pages paged out 0 pages swapped in 0 pages swapped out
> > 4281536287 interrupts 4185543972 CPU context switches
> > 1456296771 boot time 84815522 forks
> >
> >
> >
> > Tomcat 6 performance
> >
> > Linux 3.10.0-229.el7.x86_64 (testserver) 04/19/2016
> > _x86_64_(32 CPU) 05:36:33 PM CPU %user %nice
> > %system   %iowait%steal %idle 05:36:38 PM all 37.66
> > 0.00 14.69  0.10  0.00 47.55 05:36:43 PM all
> > 37.61  0.00 14.50  0.01  0.00 47.89 05:36:48 PM
> > all 38.31  0.00 14.48  0.03  0.00 47.19
> > 05:36:53 PM all 37.45  0.00 14.53  0.01
> > 0.00 48.01 05:36:58 PM all 37.97  0.00 14.67
> > 0.02  0.00 47.34 05:37:03 PM all 37.68  0.00
> > 14.62  0.01  0.00 47.69
> >
> > Created the tree successfully using HTTPRequest.jmx Starting the 
> > test @ Wed Apr 13 17:34:58 CEST 2016 (1460561698701) Waiting for
> > possible shutdown message on port 4445 summary +  16181 in   1.3s =
> > 12893.2/s Avg: 0 Min: 0 Max:67 Err: 0 (0.00%)
> > Active: 3 Started: 3 Finished: 0 summary + 5187350 in30s =
> > 172911.7/s Avg: 0 Min: 0 Max:31 Err: 0 (0.00%)
> > Active: 24 Started: 24 Finished: 0 summary = 5203531 in  31.3s =
> > 166486.4/s Avg: 0 Min: 0 Max:67 Err: 0 (0.00%)
> > summary + 5207210 in30s = 173573.7/s Avg: 0 Min: 0 Max:
> > 26 Err: 0 (0.00%) Active: 24 Started: 24 Finished: 0 summary =
> > 10410741 in  61.3s = 169957.4/s Avg: 0 Min: 0 Max:67
> > Err: 0 (0.00%) summary + 5039715 in30s = 167990.5/s Avg:
> > 0 Min: 0 Max:13 Err: 0 (0.00%) Active: 24 Started: 24
> > Finished: 0 summary = 15450456 in  91.3s = 169310.8/s Avg: 0
> > Min: 0 Max:67 Err: 0 (0.00%) summary + 5024196 in
> > 30s = 167473.2/s Avg: 0 Min: 0 Max:22 Err: 0
> > (0.00%) Active: 24 Started: 24 Finished: 0 summary = 20474652 in
> > 121s = 168856.

RE: performance of tomcat 8 is less than tomcat 6

2016-04-20 Thread Igor Cicimov
On 20 Apr 2016 1:30 pm, "Ravi Chandra Suryavanshi" <
ravi.chandra.suryavan...@ericsson.com> wrote:
>
> Hi Christopher,
> PFA, the requested XMLs. Just want to highlight that tomcat 8  is not
able to use the CPU usage. I have tried maxThread 200,300,400 but result is
same sometimes even less TPS.
> Regards,
> Ravi
>
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Tuesday, April 19, 2016 7:38 PM
> To: Tomcat Users List
> Subject: Re: performance of tomcat 8 is less than tomcat 6
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Ravi,
>
> On 4/19/16 1:04 AM, Ravi Chandra Suryavanshi wrote:
> > Hi, I am using tomcat 6 in my product. I am planning to upgrade to
> > tomcat 8 as tomcat is going to EoS in Dec-2016. I have just taken the
> > performance of Tomcat 8 and found the 70% less performance compared to
> > tomcat 6. See the below results Tomcat 6 is giving 167473.2/s whereas
> > tomcat 8 is giving 100436.6/s I have just compared with two standalone
> > tomcat which is just hitting the HelloWorld servlet available in
> > example.
> >
> > Kindly let me know what need to configure to boost the performance.
> >
> > Following are my setup: Java=Java 8 HttpClient=HttpClient4 Benchmark
> > tool=jmeter
> >
> > testserver:~# uname -a Linux testserver 3.10.0-229.el7.x86_64 #1 SMP
> > Thu Jan 29 18:37:38 EST 2015 x86_64 x86_64 x86_64 GNU/Linux
> >
> >
> >
> > testserver:~# lscpu Architecture:  x86_64 CPU op-mode(s):
> > 32-bit, 64-bit Byte Order:Little Endian CPU(s):
> > 32 On-line CPU(s) list:   0-31 Thread(s) per core:2 Core(s) per
> > socket:8 Socket(s): 2 NUMA node(s):  2
> > Vendor ID: GenuineIntel CPU family:6 Model:
> > 63 Model name:Intel(R) Xeon(R) CPU E5-2640 v3 @
> > 2.60GHz Stepping:  2 CPU MHz:   2600.000
> > BogoMIPS:  5210.53 Virtualization:VT-x L1d
> > cache: 32K L1i cache: 32K L2 cache:
> > 256K L3 cache:  20480K NUMA node0 CPU(s):
> > 0-7,16-23 NUMA node1 CPU(s): 8-15,24-31
> >
> > testserver:~# vmstat -s 131730840 K total memory 5931052 K used memory
> > 7126352 K active memory 5511616 K inactive memory 116069376 K free
> > memory 20888 K buffer memory 9709520 K swap cache 11681788 K total
> > swap 0 K used swap 11681788 K free swap 54069797 non-nice user cpu
> > ticks 997 nice user cpu ticks 9712353 system cpu ticks
> > 15112937897 idle cpu ticks 37101 IO-wait cpu ticks 73 IRQ cpu ticks
> > 21245 softirq cpu ticks 0 stolen cpu ticks 8918100 pages paged in
> > 267868897 pages paged out 0 pages swapped in 0 pages swapped out
> > 4281536287 interrupts 4185543972 CPU context switches
> > 1456296771 boot time 84815522 forks
> >
> >
> >
> > Tomcat 6 performance
> >
> > Linux 3.10.0-229.el7.x86_64 (testserver) 04/19/2016
> > _x86_64_(32 CPU) 05:36:33 PM CPU %user %nice
> > %system   %iowait%steal %idle 05:36:38 PM all 37.66
> > 0.00 14.69  0.10  0.00 47.55 05:36:43 PM all
> > 37.61  0.00 14.50  0.01  0.00 47.89 05:36:48 PM
> > all 38.31  0.00 14.48  0.03  0.00 47.19
> > 05:36:53 PM all 37.45  0.00 14.53  0.01
> > 0.00 48.01 05:36:58 PM all 37.97  0.00 14.67
> > 0.02  0.00 47.34 05:37:03 PM all 37.68  0.00
> > 14.62  0.01  0.00 47.69
> >
> > Created the tree successfully using HTTPRequest.jmx Starting the test
> > @ Wed Apr 13 17:34:58 CEST 2016 (1460561698701) Waiting for
> > possible shutdown message on port 4445 summary +  16181 in   1.3s =
> > 12893.2/s Avg: 0 Min: 0 Max:67 Err: 0 (0.00%)
> > Active: 3 Started: 3 Finished: 0 summary + 5187350 in30s =
> > 172911.7/s Avg: 0 Min: 0 Max:31 Err: 0 (0.00%)
> > Active: 24 Started: 24 Finished: 0 summary = 5203531 in  31.3s =
> > 166486.4/s Avg: 0 Min: 0 Max:67 Err: 0 (0.00%)
> > summary + 5207210 in30s = 173573.7/s Avg: 0 Min: 0 Max:
> > 26 Err: 0 (0.00%) Active: 24 Started: 24 Finished: 0 summary =
> > 10410741 in  61.3s = 169957.4/s Avg: 0 Min: 0 Max:67
> > Err: 0 (0.00%) summary + 5039715 in30s = 167990.5/s Avg:
> > 0 Min: 0 Max:13 Err: 0 (0.00%) Active: 24 Started: 24
> > Finished: 0 summary = 15450456 in  91.3s = 169310.8/s Avg: 0
> > Min: 0 Max:67 Err: 0 (0.00%) summary + 5024196 in
> > 30s = 167473.2/s Avg: 0 Min: 0 Max:22 Err: 0
> > (0.00%) Active: 24 Started: 24 Finished: 0 summary = 20474652 in
> > 121s = 168856.1/s Avg: 0 Min: 0 Max:67 Err: 0
> > (0.00%)
> >
> >
> > --
> - 
> - 
> >
> >
> tomcat 8
> >
> > Linux 3.10.0-229.el7.x86_64 (testserver) 04

Re: [ANN] Apache Tomcat 7.0.69 released

2016-04-20 Thread Utkarsh Dave
Thanks again. That helped and all good with compilation now.

On Wed, Apr 20, 2016 at 12:50 PM, Violeta Georgieva 
wrote:

> Hi,
>
> 2016-04-20 10:11 GMT+03:00 Utkarsh Dave :
> >
> > Hi Violeta,
> > I receive a compilation error with new tomcat
> > java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/UriUtil
> >
>
> This class is located in tomcat-coyote.jar file
>
> Regards,
> Violeta
>
> > When i compared 7.0.69\lib\tomcat-util\org\apache\tomcat\util
> > I found buf package and all its classes missing.
> > Do i have to add something to my class path to resolve this error
> >
> > On Tue, Apr 19, 2016 at 11:47 AM, Utkarsh Dave 
> > wrote:
> >
> > > Thank You
> > >
> > > On Mon, Apr 18, 2016 at 5:45 PM, Violeta Georgieva <
> violet...@apache.org
> >
> > > wrote:
> > >
> > >> The Apache Tomcat team announces the immediate availability of Apache
> > >> Tomcat 7.0.69.
> > >>
> > >> Apache Tomcat is an open source software implementation of the Java
> > >> Servlet, JavaServer Pages, Java Expression Language and Java
> > >> WebSocket technologies.
> > >>
> > >> This release contains a number of bug fixes and improvements compared
> to
> > >> version 7.0.68. The notable changes since 7.0.68 include:
> > >>
> > >>
> > >> - Correct a false positive warning for ThreadLocal related memory
> leaks
> > >>   when the key class but not the value class has been loaded by the
> web
> > >>   application class loader.
> > >>
> > >>
> > >> Please refer to the change log for the complete list of changes:
> > >> http://tomcat.apache.org/tomcat-7.0-doc/changelog.html
> > >>
> > >> Note: This version has 4 zip binaries: a generic one and
> > >>   three bundled with Tomcat native binaries for Windows
> operating
> > >>   systems running on different CPU architectures.
> > >>
> > >> Note: Use of the Java WebSocket 1.1 implementation requires Java 7.
> > >>
> > >> Note: If you use the APR/native AJP or HTTP connector you *must*
> upgrade
> > >>   to version 1.1.33 or later of the APR/native library.
> > >>
> > >> Downloads:
> > >> http://tomcat.apache.org/download-70.cgi
> > >>
> > >> Migration guides from Apache Tomcat 5.5.x and 6.0.x:
> > >> http://tomcat.apache.org/migration.html
> > >>
> > >> Enjoy
> > >>
> > >> The Apache Tomcat team
> > >>
> > >
> > >
>


Re: sadfasdf

2016-04-20 Thread Mark Thomas
On 20/04/2016 04:14, George Stanchev wrote:
> It could be someone’s kids. I know mine has done similar damage. With tablets 
> and iphones hosting parent’s work pluce junior’s entertainment it could have 
> happened. Let us be gentle :)

A quick check of the archives and the moderator logs shows:
- this address subscribed a year ago
- there was a handful of pointless posts shortly afterwards
- then nothing until this mornings flurry of e-mail

Given the above, I am going to unsubscribe them. If they really want to
be on this list they will read this message and are free to re-subscribe.

Mark

> 
> From: Nick Childs [mailto:nchi...@ramsoft.com]
> Sent: Tuesday, April 19, 2016 8:55 PM
> To: Tomcat Users List 
> Subject: RE: sadfasdf
> 
> LOL, really!?
> 
> 
> Regards,
> 
> Nick Childs
> Information Technology Manager
> [logo]
> 9480 Utica Avenue, Suite 612
> Rancho Cucamonga, CA 91730
> Phone: 909.481.5800 x115
> Cell: 909.717.4078
> Skype: nchilds.ramsoft
> Email: nchi...@ramsoft.com
> 
> DISCLAIMER:
> In order to comply with HIPAA regulations we ask that provide just the 
> patient ID or accession number. Please keep in mind that communications via 
> email over the internet are not secure, so we ask not include personal 
> identifying information such as patient name, birth date, or personal medical 
> information in any case updates or emails you send us.
> 
> From: l...@bsoft.com.cn [mailto:l...@bsoft.com.cn]
> Sent: Tuesday, April 19, 2016 7:45 PM
> To: Tomcat Users List 
> mailto:users@tomcat.apache.org>>
> Subject: sadfasdf
> 
> asdfasdfasdfasf
> 
> 
> -
> 力瓦依丁·库尔班
> Mobile:18130819208
> qq:895791034
> WeChat:lee_vayi
> Email:l...@bsoft.com.cn
> Company:Bsoft software Company
> 
> 


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



Re: Fwd: bug

2016-04-20 Thread tomcat

On 20.04.2016 09:31, Cristian Lorenzetto wrote:

i sincronized the method for sending message but error is the same when
ubuntu is suspended. The connections are not restored correctly when tomcat
websocket process is wakeup



Ach so ..
You are talking about running Tomcat on an Ubuntu laptop, which goes to sleep after a 
while.  That was not clear from your initial explanation, where it seemed that you were 
talking about a *client* PC that goes to sleep.


My personal opinion, is that this case is not really part of the specification : it is 
generally assumed that Tomcat is a server-based process, running on a server with the 
purpose of serving multiple clients.  It is not really expected generally that a server 
would "go to sleep" in the middle of doing something.





Hi I m using tomcat in ubuntu system. When i leave my pc for 10 mins
  system is suspended. When i return to work i have this exception

java.lang.IllegalStateException: The remote endpoint was in state
[BINARY_PARTIAL_WRITING] which is an invalid state for called method
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase$StateMachine.checkState(WsRemoteEndpointImplBase.java:1213)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase$StateMachine.binaryPartialStart(WsRemoteEndpointImplBase.java:1160)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendPartialBytes(WsRemoteEndpointImplBase.java:158)
at
org.apache.tomcat.websocket.WsRemoteEndpointBasic.sendBinary(WsRemoteEndpointBasic.java:56)
at
org.springframework.web.socket.adapter.standard.StandardWebSocketSession.sendBinaryMessage(StandardWebSocketSession.java:202)
at
org.springframework.web.socket.adapter.AbstractWebSocketSession.sendMessage(AbstractWebSocketSession.java:108)
at
com.itiboss.utils.FragmentationOutputStream.close(FragmentationOutputStream.java:39)
at com.itiboss.utils.Utils.send(Utils.java:80)
... 21 more




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



Fwd: bug

2016-04-20 Thread Cristian Lorenzetto
i sincronized the method for sending message but error is the same when
ubuntu is suspended. The connections are not restored correctly when tomcat
websocket process is wakeup


Hi I m using tomcat in ubuntu system. When i leave my pc for 10 mins
 system is suspended. When i return to work i have this exception

java.lang.IllegalStateException: The remote endpoint was in state
[BINARY_PARTIAL_WRITING] which is an invalid state for called method
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase$StateMachine.checkState(WsRemoteEndpointImplBase.java:1213)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase$StateMachine.binaryPartialStart(WsRemoteEndpointImplBase.java:1160)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendPartialBytes(WsRemoteEndpointImplBase.java:158)
at
org.apache.tomcat.websocket.WsRemoteEndpointBasic.sendBinary(WsRemoteEndpointBasic.java:56)
at
org.springframework.web.socket.adapter.standard.StandardWebSocketSession.sendBinaryMessage(StandardWebSocketSession.java:202)
at
org.springframework.web.socket.adapter.AbstractWebSocketSession.sendMessage(AbstractWebSocketSession.java:108)
at
com.itiboss.utils.FragmentationOutputStream.close(FragmentationOutputStream.java:39)
at com.itiboss.utils.Utils.send(Utils.java:80)
... 21 more


Re: pgp-keys jsp taglibs

2016-04-20 Thread Martijn Bos
Hi Konstantin,

On 2016-04-20 01:25:25, Konstantin Kolinko wrote:
> 2016-04-19 23:00 GMT+03:00 Martijn Bos :
> > Hi all,
> >
> > (I post in this list since I downloaded from tomcat.apache.org. If there is 
> > a more appropriate list, off course I will try overthere)
> >
> > 1 - Downloaded the taglibs from 
> > http://tomcat.apache.org/download-taglibs.cgi#Standard-1.2.5
> 
> The "verify" word on above page links to a detailed instruction,
> https://www.apache.org/info/verification.html
> 
> > 2 - Downloaded the PGP signatures for the files
> > 2 - Downloaded KEYS. (The pgp public keys from the releaser(s)  of the 
> > files)
> > 3 - Imported the keys into gpg:
> > martijn@radijs:~/external_documents/Downloads$ gpg --import KEYS
> > gpg: sleutel A7A0233C: publieke sleutel "Jeremy Boynes 
> > " geïmporteerd
> > gpg:   Totaal aantal verwerkt: 1
> > gpg: geïmporteerd: 1  (RSA: 1)
> > martijn@radijs:~/external_documents/Downloads$
> >
> > 4 - checked the signature of the downloaded files:
> > martijn@radijs:~/external_documents/Downloads$ gpg 
> > taglibs-standard-impl-1.2.5.jar.asc
> 
> The above verification command is wrong. You must specify 2 file
> arguments to gpg --verify.  See the verification.html page that I
> mentioned above.
> 

Thank you. I didn't read the page in the first place, because I thought I know 
it all :-(
(Once again I'm proven wrong)

However (call me stuborn), as far as I understand, in this case my way is not 
wrong per se.
The verify is with a detached signature. gpg can deduct (and find) the name of 
the file, which was signed, from the name of the detached signature.

Below I copy/pasted the same verification with 1 and with 2 arguments. To me 
the results looks the same

(If the signature and the file name do not match, then my approach will not 
work at all, ofcourse)

> > gpg: gegevens in `taglibs-standard-impl-1.2.5.jar' worden verondersteld 
> > ondertekend te zijn
> > gpg: Ondertekening gemaakt op di 10 mrt 2015 17:11:32 CET met RSA 
> > sleutel-ID A7A0233C
> > gpg: Goede handtekening van "Jeremy Boynes "
> > gpg: Noot: Deze sleutel is vervallen!
> > Vingerafdruk van de primaire sleutel: 8B46 CA49 EF48 37B8 C7F2  92DA A54A 
> > D08E A7A0 233C
> >
> > It's in dutch :-)
> 
> Executing the below command before the above one should switch it to English.
> LANG=C
> 
> Maybe it also needs  export LANG, I do not remember.
> 

The moment I read your comment I thought:"Could've done that myself"

So ... now in enlish, so everyone can read it:


martijn@radijs:~/external_documents/Downloads$ export LANG=C

martijn@radijs:~/external_documents/Downloads$ gpg --verify 
taglibs-standard-compat-1.2.5.jar.asc   
gpg: assuming signed data in `taglibs-standard-compat-1.2.5.jar'

gpg: Signature made Tue Mar 10 17:11:38 2015 CET using RSA key ID A7A0233C  

gpg: Good signature from "Jeremy Boynes "   

gpg: Note: This key has expired!

Primary key fingerprint: 8B46 CA49 EF48 37B8 C7F2  92DA A54A D08E A7A0 233C 

martijn@radijs:~/external_documents/Downloads$


And with the signed file as a second argument:

martijn@radijs:~/external_documents/Downloads$ gpg --verify 
taglibs-standard-compat-1.2.5.jar.asc taglibs-standard-compat-1.2.5.jar
gpg: Signature made Tue Mar 10 17:11:38 2015 CET using RSA key ID A7A0233C  

gpg: Good signature from "Jeremy Boynes "   

gpg: Note: This key has expired!

 
Primary key fingerprint: 8B46 CA49 EF48 37B8 C7F2  92DA A54A D08E A7A0 233C 

 
martijn@radijs:~/external_documents/Downloads$

> > The message is telling me that the file is signed by key A7A0233C
> > (I never did sign this key myself..there is no trust..so gpg also tells me 
> > that)
> > Then gpg tells me "This key is expired"!!!
> >
> > I'm not sure what to think of this...Is this a problem, or am I just to 
> > paranoid?
> >
> > Can anyone shine his/her light on this.
> 
> 
> $ gpg --list-keys A7A0233C
> 
> pub   2048R/A7A0233C 2012-02-25 [expired: 2016-02-25]
> uid  Jeremy Boynes 
> 
> 
> 1. Binaries released and signed before February 2016 are OK.
> 

Thanks, ultimately, that is what I wanted to know :-)


> 2. Jeremy needs to do something with his key before signing a nex

Re: [ANN] Apache Tomcat 7.0.69 released

2016-04-20 Thread Violeta Georgieva
Hi,

2016-04-20 10:11 GMT+03:00 Utkarsh Dave :
>
> Hi Violeta,
> I receive a compilation error with new tomcat
> java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/UriUtil
>

This class is located in tomcat-coyote.jar file

Regards,
Violeta

> When i compared 7.0.69\lib\tomcat-util\org\apache\tomcat\util
> I found buf package and all its classes missing.
> Do i have to add something to my class path to resolve this error
>
> On Tue, Apr 19, 2016 at 11:47 AM, Utkarsh Dave 
> wrote:
>
> > Thank You
> >
> > On Mon, Apr 18, 2016 at 5:45 PM, Violeta Georgieva 
> > wrote:
> >
> >> The Apache Tomcat team announces the immediate availability of Apache
> >> Tomcat 7.0.69.
> >>
> >> Apache Tomcat is an open source software implementation of the Java
> >> Servlet, JavaServer Pages, Java Expression Language and Java
> >> WebSocket technologies.
> >>
> >> This release contains a number of bug fixes and improvements compared
to
> >> version 7.0.68. The notable changes since 7.0.68 include:
> >>
> >>
> >> - Correct a false positive warning for ThreadLocal related memory leaks
> >>   when the key class but not the value class has been loaded by the web
> >>   application class loader.
> >>
> >>
> >> Please refer to the change log for the complete list of changes:
> >> http://tomcat.apache.org/tomcat-7.0-doc/changelog.html
> >>
> >> Note: This version has 4 zip binaries: a generic one and
> >>   three bundled with Tomcat native binaries for Windows
operating
> >>   systems running on different CPU architectures.
> >>
> >> Note: Use of the Java WebSocket 1.1 implementation requires Java 7.
> >>
> >> Note: If you use the APR/native AJP or HTTP connector you *must*
upgrade
> >>   to version 1.1.33 or later of the APR/native library.
> >>
> >> Downloads:
> >> http://tomcat.apache.org/download-70.cgi
> >>
> >> Migration guides from Apache Tomcat 5.5.x and 6.0.x:
> >> http://tomcat.apache.org/migration.html
> >>
> >> Enjoy
> >>
> >> The Apache Tomcat team
> >>
> >
> >


Re: [ANN] Apache Tomcat 7.0.69 released

2016-04-20 Thread Utkarsh Dave
Hi Violeta,
I receive a compilation error with new tomcat
java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/UriUtil

When i compared 7.0.69\lib\tomcat-util\org\apache\tomcat\util
I found buf package and all its classes missing.
Do i have to add something to my class path to resolve this error

On Tue, Apr 19, 2016 at 11:47 AM, Utkarsh Dave 
wrote:

> Thank You
>
> On Mon, Apr 18, 2016 at 5:45 PM, Violeta Georgieva 
> wrote:
>
>> The Apache Tomcat team announces the immediate availability of Apache
>> Tomcat 7.0.69.
>>
>> Apache Tomcat is an open source software implementation of the Java
>> Servlet, JavaServer Pages, Java Expression Language and Java
>> WebSocket technologies.
>>
>> This release contains a number of bug fixes and improvements compared to
>> version 7.0.68. The notable changes since 7.0.68 include:
>>
>>
>> - Correct a false positive warning for ThreadLocal related memory leaks
>>   when the key class but not the value class has been loaded by the web
>>   application class loader.
>>
>>
>> Please refer to the change log for the complete list of changes:
>> http://tomcat.apache.org/tomcat-7.0-doc/changelog.html
>>
>> Note: This version has 4 zip binaries: a generic one and
>>   three bundled with Tomcat native binaries for Windows operating
>>   systems running on different CPU architectures.
>>
>> Note: Use of the Java WebSocket 1.1 implementation requires Java 7.
>>
>> Note: If you use the APR/native AJP or HTTP connector you *must* upgrade
>>   to version 1.1.33 or later of the APR/native library.
>>
>> Downloads:
>> http://tomcat.apache.org/download-70.cgi
>>
>> Migration guides from Apache Tomcat 5.5.x and 6.0.x:
>> http://tomcat.apache.org/migration.html
>>
>> Enjoy
>>
>> The Apache Tomcat team
>>
>
>