Re: URI Templates

2015-08-20 Thread Mark Thomas
On 20/08/2015 16:58, Steffen Heil (Mailinglisten) wrote:
> Hi
> 
> 
> I have several servlets with mappings such as
>   /a/*
>   /b/*
>   /c/*
> And so on.
> 
> One of these mappings was for the old Tomcat 7.0.27 websocket implementation:
>   /ws/*
> 
> That worked.
> 
> Now, with the new JSR version in Tomcat 8, I cannot get this to work.
> The problem is, that all of the following paths shall match:
> 
> /ws/a/b
> /ws/a/c
> /ws/d/e
> 
> While these would work using /ws/{one}/{two}, the folloing won't:
> 
> /ws/a/b/c
> /ws/x/Y/z/a
> 
> And I cannot know in advance, how many slashed there are.
> (This is for a framework, not a specific application.)
> 
> Is there any way to match those? Or to add a usual servlet mapping instead of 
> an URI Template?
> (Prefered prorgrammatically, not per web.xml, not per annotations.)
> 
> While I would prefer a clean solution, I am also fine with one that works in 
> tomcat only (using tomcat private functions).

I see three options.

Option 1

Using ServerContainer.addEndpoint to add the same endpoint multiple
times with different configurations mapped to:
/ws
/ws/{a}
/ws/{a}/{b}
/ws/{a}/{b}/{c}

etc.

If there is a maximum depth that should work. If there isn't then it
will break at the maximum depth you configure +1.


Option 2

Look at the WsFilter implementation [1] and write an alternative filter
of your own that does custom mapping to endpoints and calls
UpgradeUtil.doUpgrade with the right parameters


Option 3
Write a filter that looks at the request and if it should use web socket
redirects to the correct URL and converts the additional pathInfo into
query parameters, puts the values into the session, or something else
along those lines.

HTH,

Mark


[1]
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java?view=annotate


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



Re: HTTP Authenticate ignored by Tomcat 7 (Windows)

2015-08-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Gerald,

On 8/20/15 3:28 PM, Miller, Gerald wrote:
> Follow-up:

(Weird... I never got the first message. Thanks for including it. I'm
going to re-arrange the message so it's not in top-posting form.)

> I had previously set up Tomcat 8 on an Ubuntu VM, communicating
> over localhost, and was able to authenticate to the server by
> intercepting calls to soap_put_header() and inserting
> Authorization: Basic dG9tY2F0OnRvbWNhdAo=

Where were you intercepting those calls to soap_put_header()? That's
not a Tomcat thing.

> After setting up Tomcat 7 in Windows and running tcpdump in Ubuntu 
> (no longer using localhost, obviously) to diagnose the HTTP/1.1
> 401, I find that although my request header field is still intact,
> it's apparently being ignored, and I get a WWW-Authenticate in the 
> response header.  Why this apparently inconsistent behavior?

So you are making an HTTP request that includes an Authorization:
header and you get a 401 with a WWW-Authenticate: header in the
response? Silly question... are you using valid credentials? Is this
HTTP BASIC or HTTP DIGEST?

> I chose Tomcat 8 initially, because it was the most current
> version, but after rereading the README for the projects to be
> supported

What README file with "projects to be supported"?

> and seeing all kinds of Java errors

Like what?

Any web application that can be deployed on Tomcat 7 should be able to
be deployed on Tomcat 8 as well.

> I switched to version 7, so apparently there are issues with war
> file support through the Metro library as well.

I'm completely and totally lost at this point. Metro supports WAR
files? Metro is a library? I thought Metro was an attempt to get
desktop users to run applications full-screen as if they were tablets...

> * Follow-up * I reviewed the logs and saw a number of requests
> coming from localhost, where I had run experimental queries to the
> exact same service.  I also confirmed through Rawcap that they were
> using the same Authorization header field.  The only one receiving
> the 401 status was the one coming from the VM, using the host IP
> address and port in place of localhost and port.

So where is the VM?

Are you saying that if you run a unit test from localhost it always
works (regardless of which localhost that is... the Windows host or
the Linux host) and when you make the request remotely (non-localhost)
it never works?

Tomcat usually doesn't care whence the request comes. Are there any
other components that we don't know about?

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

iQIcBAEBCAAGBQJV1kksAAoJEBzwKT+lPKRYn7kQAL47l1Z1iTWh1MZvgYXpBqkH
KbF6syxbu6t7ujc7mj0XT5IdX8u2mj3jZ+MoYdrqgr+/tmEKRwwiOpOeNN5d9hmx
yfFE6ksTODLNpI517GWqTGlb7zFSlzqFHIePHXhYvJCjPW+S1+V4RL7iGMh7/HVy
GDk2wEQv0olBV3WxJkViXwa6Ro7g8ZpmCR6XvNCjpYvrBT7rBu88JlrN3M70iHjw
Vw26CqmPrSCjrpONGfKikUtiSpILWqJ9afOK0sVSC8Gay/eyaYX10eShHUoUkWSq
rIsdm3cFMwx0DTT/rVSEfm04n0kidb4fRkifqSm0ODxx4prEVd/EQg8KmMcveaXh
4jYc37gnm7mWf//IwJSz0tUUNm3j53TIrfFCiIdazTHcUkp4Eda3wT0zsYkqN/fn
ivOthYNuejF1DHvsub7WAREvRXN7ZkrER62G/Lm6EjC3m3rMuoLNLZa17+iH0A6y
LZ5jy3/JXuWEX97BBK9mV93bUAPGhxs9wBV+vzYzfjwF/z2rc41+71qnrcRauXzs
kD8hvA2eqexgf1E9g6yaYShBstBLFgmXluPjwZEYfW1KK/pAey6+TCJFTyOXf0eG
0rH8Zw8xGV6BMke/Ng4r1XQ87h2NozR46gzxXZWkkgTQNZAXpzkuDlPBUkr+70FJ
ITA6nPraksC0LxWCcfss
=IW2n
-END PGP SIGNATURE-

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



Re: URI Templates

2015-08-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Steffen,

On 8/20/15 11:58 AM, Steffen Heil (Mailinglisten) wrote:
> I have several servlets with mappings such as /a/* /b/* /c/* And so
> on.
> 
> One of these mappings was for the old Tomcat 7.0.27 websocket
> implementation: /ws/*
> 
> That worked.
> 
> Now, with the new JSR version in Tomcat 8, I cannot get this to
> work. The problem is, that all of the following paths shall match:
> 
> /ws/a/b /ws/a/c /ws/d/e
> 
> While these would work using /ws/{one}/{two}, the folloing won't:
> 
> /ws/a/b/c /ws/x/Y/z/a

So you have a servlet mapping for the uri-pattern of "/a/*", and the
context path is "/ws"?

I'm not sure why it would have worked in the past but not now. Can you
be very clear about what used to work and is no longer working?

> And I cannot know in advance, how many slashed there are. (This is
> for a framework, not a specific application.)
> 
> Is there any way to match those? Or to add a usual servlet mapping
> instead of an URI Template? (Preferred programmatically, not per
> web.xml, not per annotations.)

I think you have two possibilities:

1. Manually set-up the uri-patterns so that they do not overlap
2. Write a Servlet (or Filter) that inspects the URL and makes its own
decisions
3. Use something like url-rewrite as a config-only alternative for #2

I think due to your "not in web.xml" requirement, #1 cannot be done.

> While I would prefer a clean solution, I am also fine with one
> that works in tomcat only (using tomcat private functions).

I'm still not sure I understand the use case. There should be a way to
achieve what you want... I just don't yet understand the requirements.

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

iQIcBAEBCAAGBQJV1kcMAAoJEBzwKT+lPKRYSaYP/0AhpDeSPCzk6dCPgYhrOzxU
GUpM3vBz7w64Scy0gDqln74QJjCRadVvVNkw25i/HrIEv/85wFj6RlKskoizjoan
m8XiS1MsVNmQQqAMcWV39Qu7vaq/X84uJ9T0EDxksLg1yo6BfRAmfdCciSr8mGQn
JuI4smp9PV7S/MkJdn9p/ZbXVH9aOWqk/gcbV4/hvNLzqaL1hbR3KSE+DhAjDkDD
WuVKKsO350jTfNue5xPRtPmAHrm9cIBCx+RPIUmICkbEAN9L3hT/nIOWxCA2ncaq
EMuNO4d/YLXZ7X3/Bcp9fzzgdPjtwrNYJ3lJJ5vV6q1X5MldkjRhyVfiYcLsSLQO
Fn8XBlnGEpMU94LHt6xGLDXwXE/3gAU7wePbX9X72GNVNLry1iMdd2Hqu3NzZ7gF
hWj9IMJWGgcKV6K+YzKJJJSc9LzGw/jiRwBO3xPb22yHv47TDxecDkbS+Z1AuUKb
5k1gnsdPa/5Eh9TCrFBYGGXBjvLkCnZOQKtfAjoG2pFxvYIZZ1+6p0And/C5lNao
QucJtiAxVt8vr7zHWuyDKi5BHqIwvD/DqMd/AfctiALJd766QKxol/8aDAOEdLN1
leGWvOgpn/Tl0flN16J6ZHsq3hcfgqzfWA66+uODhTVR6yxb0N/XpjNt3I1x6ZeV
/9CdBewDPIC+aaH9RrO1
=1p52
-END PGP SIGNATURE-

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



RE: HTTP Authenticate ignored by Tomcat 7 (Windows)

2015-08-20 Thread Miller, Gerald
Note also: RemoteAddrValve is still commented out.

From: Miller, Gerald
Sent: Thursday, August 20, 2015 3:28 PM
To: 'users@tomcat.apache.org' 
Subject: RE: HTTP Authenticate ignored by Tomcat 7 (Windows)

Follow-up: I reviewed the logs and saw a number of requests coming from 
localhost, where I had run experimental queries to the exact same service.  I 
also confirmed through Rawcap that they were using the same Authorization 
header field.  The only one receiving the 401 status was the one coming from 
the VM, using the host IP address and port in place of localhost and port.

From: Miller, Gerald
Sent: Thursday, August 20, 2015 2:27 PM
To: 'users@tomcat.apache.org' 
mailto:users@tomcat.apache.org>>
Subject: HTTP Authenticate ignored by Tomcat 7 (Windows)

I had previously set up Tomcat 8 on an Ubuntu VM, communicating over localhost, 
and was able to authenticate to the server by intercepting calls to 
soap_put_header() and inserting
Authorization: Basic dG9tY2F0OnRvbWNhdAo=

After setting up Tomcat 7 in Windows and running tcpdump in Ubuntu (no longer 
using localhost, obviously) to diagnose the HTTP/1.1 401, I find that although 
my request header field is still intact, it's apparently being ignored, and I 
get a WWW-Authenticate in the response header.  Why this apparently 
inconsistent behavior?

I chose Tomcat 8 initially, because it was the most current version, but after 
rereading the README for the projects to be supported and seeing all kinds of 
Java errors, I switched to version 7, so apparently there are issues with war 
file support through the Metro library as well.


RE: HTTP Authenticate ignored by Tomcat 7 (Windows)

2015-08-20 Thread Miller, Gerald
Follow-up: I reviewed the logs and saw a number of requests coming from 
localhost, where I had run experimental queries to the exact same service.  I 
also confirmed through Rawcap that they were using the same Authorization 
header field.  The only one receiving the 401 status was the one coming from 
the VM, using the host IP address and port in place of localhost and port.

From: Miller, Gerald
Sent: Thursday, August 20, 2015 2:27 PM
To: 'users@tomcat.apache.org' 
Subject: HTTP Authenticate ignored by Tomcat 7 (Windows)

I had previously set up Tomcat 8 on an Ubuntu VM, communicating over localhost, 
and was able to authenticate to the server by intercepting calls to 
soap_put_header() and inserting
Authorization: Basic dG9tY2F0OnRvbWNhdAo=

After setting up Tomcat 7 in Windows and running tcpdump in Ubuntu (no longer 
using localhost, obviously) to diagnose the HTTP/1.1 401, I find that although 
my request header field is still intact, it's apparently being ignored, and I 
get a WWW-Authenticate in the response header.  Why this apparently 
inconsistent behavior?

I chose Tomcat 8 initially, because it was the most current version, but after 
rereading the README for the projects to be supported and seeing all kinds of 
Java errors, I switched to version 7, so apparently there are issues with war 
file support through the Metro library as well.


Re: Tomcat-7.0.61 and SFlow_Valve.jar issue

2015-08-20 Thread Sergey

I added logging to this module and found that there is a problem with 
System.getProperty("sflow.dsindex”) call.
It was resolved by adding to startup.sh :

export CATALINA_OPTS="$CATALINA_OPTS -Dsflow.dsindex=1234 
-Dsflow.hostname=app_1"

Now SflowValve,jar is working.

Thanks!
Sergey

> On Aug 11, 2015, at 10:40 PM, Felix Schumacher 
>  wrote:
> 
> 
> 
> Am 11. August 2015 23:32:12 MESZ, schrieb Sergey :
>> I recompiled SFlow_Valve.jar with Tomcat-7.0.61.
>> Now it doesn’t give any errors in the log, but also doesn’t send any
>> metrics to port 6343. 
>> Is there any way to debug this valve?
> 
> I assume it is this valve 
> https://code.google.com/p/tomcat-sflow-valve/source/browse/trunk/com/sflow/catalina/SFlowValve.java.
> 
> That valve has no logging whatsoever and silently drops any exception it 
> catches. So your only chance to see more is to debug or add logging to the 
> valve. 
> 
> Debugging should be the same as debugging anything you run in tomcat. You can 
> find more information at http://wiki.apache.org/tomcat/FAQ/Developing.
> 
> The entry point for your quest is probably the invoke method in the valve. 
> 
> Logging could be done by adding println's to those points in the valve, you 
> want to be seen visited. Using a logging framework (java.util logging might 
> be a good choice) is even better and not that much harder to do. 
> 
> Regards, 
> Felix 
> 
>> 
>> 
>> Thanks!Sergey
>> 
>> 
>> 
>>> 
 On Jul 23, 2015, at 11:52 AM, Violeta Georgieva > > wrote:
 
 Hi,
 
 2015-07-23 21:36 GMT+03:00 Sergey > >:
> 
> We updated Tomcat from 7.0.10 to 7.0.61.
> In previous version we collected Tomcat metrics using
>> Sflow_Valve.jar
 module.
> Now it looks like Coyote Connector can't call
>> Request.getBytesRead()
 method.
> Here is the Catalina log error:
> 
> org.apache.coyote.http11.AbstractHttp11Processor process
> SEVERE: Error processing request
> java.lang.NoSuchMethodError:
>> org.apache.coyote.Request.getBytesRead()I
> at com.sflow.catalina.SFlowValve.xdrFlowSample(SFlowValve.java:341)
> at com.sflow.catalina.SFlowValve.sampleRequest(SFlowValve.java:438)
> at com.sflow.catalina.SFlowValve.invoke(SFlowValve.java:320)
> at
 
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
> at
 
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
> at
 
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
> at
 
>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
> at
 
>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
> at
 
>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
>> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>> Source)
> at
 
>> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> at java.lang.Thread.run(Unknown Source)
> 
> Did anybody have this issue?
 
 Check the change log [1].
 The signature of the method was changed as part of the fix for bug
>> 57581
 
 Regards,
 Violeta
 
 [1] http://tomcat.apache.org/tomcat-7.0-doc/changelog.html#Tomcat
>>  7.0.60
 (violetagg)
 
> 
> Thanks!
> Sergey
> 
> 
> 
>> -
> 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
> 



URI Templates

2015-08-20 Thread Steffen Heil (Mailinglisten)
Hi


I have several servlets with mappings such as
  /a/*
  /b/*
  /c/*
And so on.

One of these mappings was for the old Tomcat 7.0.27 websocket implementation:
  /ws/*

That worked.

Now, with the new JSR version in Tomcat 8, I cannot get this to work.
The problem is, that all of the following paths shall match:

/ws/a/b
/ws/a/c
/ws/d/e

While these would work using /ws/{one}/{two}, the folloing won't:

/ws/a/b/c
/ws/x/Y/z/a

And I cannot know in advance, how many slashed there are.
(This is for a framework, not a specific application.)

Is there any way to match those? Or to add a usual servlet mapping instead of 
an URI Template?
(Prefered prorgrammatically, not per web.xml, not per annotations.)

While I would prefer a clean solution, I am also fine with one that works in 
tomcat only (using tomcat private functions).


Best regards,
   Steffen



smime.p7s
Description: S/MIME cryptographic signature


Re: Errors at INFO level despite "Note: further occurrences of ... errors will be logged at DEBUG level."

2015-08-20 Thread Robert Tupelo-Schneck
Thanks.  I will investigate the logging and cookie processor configuration.

The SEVERE cookie error does come with a stack trace:

17-Aug-2015 01:13:23.051 SEVERE [catalina-exec-942] 
org.apache.coyote.http11.AbstractHttp11Processor.process Error processing 
request
 java.lang.IllegalArgumentException: Control character in cookie value or 
attribute.
at 
org.apache.tomcat.util.http.LegacyCookieProcessor.isHttpSeparator(LegacyCookieProcessor.java:732)
at 
org.apache.tomcat.util.http.LegacyCookieProcessor.getTokenEndPosition(LegacyCookieProcessor.java:714)
at 
org.apache.tomcat.util.http.LegacyCookieProcessor.processCookieHeader(LegacyCookieProcessor.java:554)
at 
org.apache.tomcat.util.http.LegacyCookieProcessor.parseCookieHeader(LegacyCookieProcessor.java:273)
at org.apache.catalina.connector.Request.parseCookies(Request.java:2949)
at 
org.apache.catalina.connector.Request.getServerCookies(Request.java:2004)
at 
org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1205)
at 
org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:916)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:513)
at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527)
at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

I use an HTTP connector with default configuration (which I think for Tomcat 8 
means NIO).

Robert

> On 2015-08-20, at 06:03, Konstantin Kolinko  wrote:
> 
> 2015-08-19 18:21 GMT+03:00 Robert Tupelo-Schneck :
>> I'm running Tomcat 8.0.24.  I see lots of errors in catalina.out with lines 
>> like
>> 
>> Note: further occurrences of Cookie errors will be logged at DEBUG level.
>> Note: further occurrences of Parameter errors will be logged at DEBUG level.
>> Note: further occurrences of HTTP header parsing errors will be logged at 
>> DEBUG level.
>> 
>> But, the errors keep showing up at INFO level!
>> 
>> I get these many many times a day, but I do not get user complaints, and I 
>> have not been able to cause the errors myself.
>> 
>> I would like to either
>> (1) Make these errors go away (such as by really having them logged at DEBUG 
>> level), or
>> (2) Get detailed information on the client request that caused the error so 
>> I can figure out how to make them less frequent.
> 
> 1. Both logging level and silencing interval are configurable with
> system properties. See properties with "UserDataHelper" in their name
> on the following page:
> 
> http://tomcat.apache.org/tomcat-8.0-doc/config/systemprops.html#Logging
> 
> By default suppression period is one day. For performance reasons,
> suppression period may be not effective immediately (so that several
> simultaneous messages can be logged at info level).
> 
> 2. There is a way to match log message to a line in access log, by
> using id of the current thread.
> 
> At the event logging side, org.apache.juli.OneLineFormatter does
> include thread name in its log message.
> 
> At access logging side the AccessLogValve can be configured to log
> thread name (as well as some other detailed information).
> 
> 3. If some more detailed information is needed, one need to change
> specific error messages (it is doable, if there is an interest in it,
> but it depends on whether additional information is available in those
> places).
> 
>> Can anyone advise on how I could accomplish either of those goals?
>> 
>> For completeness, here are the kinds of errors:
>> 
>> org.apache.tomcat.util.http.LegacyCookieProcessor.processCookieHeader 
>> Cookies: Invalid cookie. Value not a token or quoted value
> 
> Some client has a broken cookie, uses a broken browser.  E.g. if a
> client is sending 8-bit characters where only 7-bit (aka US-ASCII) are
> allowed.
> 
> It is possible to change cookie handling by configuring a different
> CookieProcessor,
> http://tomcat.apache.org/tomcat-8.0-doc/config/cookie-processor.html
> 
> 
> If client browser has a broken cookie, it will continue sending it
> until the cookie expires or cookies are cleared by user, or server
> sends set-cookie header that clears that cookie.
> 
>> org.apache.coyote.http11.AbstractHttp11Processor.process Error parsing HTTP 
>> request header
>> org.apache.tomcat.util.http.Parameters.processParameters Invalid chunk 
>> starting at byte [242] and en

Re: Tomcat hanged on window server 2012

2015-08-20 Thread dkumar
From:   Christopher Schultz 
To: Tomcat Users List 
Date:   17-08-2015 18:32
Subject:Re: Tomcat hanged  on window server 2012



-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Dear Chris,

Thanks for the reply, our response to ur questions are highlighted in 
blue.

Any help is greatly appreciated.


On 8/17/15 7:13 AM, dku...@ccilindia.co.in wrote:
> Our application worked fine on tomcat 8.0.22 on windows server 2003
>  server. The tomcat server is restarted daily using a scheduler on
>  shutdown.bat (at night) and startup.bat files (in the morning).

I'm curious, why do you take-down your service overnight?

1.We have downtime for our website. 

> We have now upgraded our machine to windows server 2012 64 bit and
> now facing some serious issues like the tomcat remains in hanged
> stage( not responding state.).Once we restart the tomcat server,
> everything works fine.And this happens only once in a day. After
> the restart of tomcat,(manually by double click on shutdown.bat
> file and startup.bat file)  it never repeats.

When you manually run shutown.bat/startup.bat, what is the effective
user? When the scheduler runs, what is the effective user? Perhaps the
environment is not configured correctly for one or the other of those.

2. Manually clicking on the shutdown.bat file and letting it happen 
through a scheduler is done by the same user credentials.

> We have not found any error in all the relevant log files.
> 
> We have made the below changes while migration. 1. java upgrade
> from 1.7.0_40 to 1.8.0_25 2.Removed the tomcat-native.dll file from
> the bin folder.

Why did you remove tomcat-native.dll? You could use the 64-bit version
instead of the 32-bit version if you'd like.

3. We have removed tomcat-native.dll file , because we were getting "
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR 
based Apache Tomcat Native library 1.1.32 using APR version 1.5.1." which 
was indicated as vullnerability by our security team. Also we are using 
NIO connector and not APR.


> The configuration of new windows server 2012 is as follows: OS
> Name:   Windows Server 2012-64 bit OS Version:
> 6.2 java   1.8.0_25 (32 bit)
> 
> However, we have observed the below error in the windows event
> viewer log
> 
> "A fatal alert was generated and sent to the remote endpoint. This
> may result in termination of the connection. The TLS protocol
> defined fatal error code is 10. The Windows SChannel error state is
> 10."

Check
https://msdn.microsoft.com/en-us/library/windows/desktop/dd721886%28v=vs
.85%29.aspx

Error 10 is "unexpected message", which might happen if your client
was trying to connect using SSLv3 or some other unsupported protocol.
What does your  look like?

4. Our connector tag is as shown below.



> Is this error responsible for the hanging of tomcat server or Is it
> due to absence of tomcat-native.dll file ??? or is there any other
> reason why the tomcat server goes into hanging state ???

A thread dump or two would be helpful:
http://wiki.apache.org/tomcat/HowTo#If_you_are_running_on_Microsoft_Wind
ows

What you say that Tomcat has "hung" what do you mean? Will it respond
to HTTP requests? If you run shutdown.bat, will it shutdown cleanly,
or do you have to kill the process?

5. Tomcat has "hung" means,the web page was not available and not 
responding for the end users .We had to kill it from the task manager as 
it was not shutting down using shutdown.bat file.

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

iQIcBAEBCAAGBQJV0ds2AAoJEBzwKT+lPKRYBtAQAIyPltQAUPX/ybDt63qTCiSb
CRr9vSKJzyYkLbP2RM3AUsXbEZ40sJumNtkcAa8nNRPUDdNhijYUTRiFPpxtBYzD
lKgafbOPLxh+oCeOmTTM1yIHYxAQI+4Ajy0cRR64YTVdtQ6uM0T/v2qbaidii0zX
Y8yCMSCdZ4YFYG2j5Ix6ezN4O/ixNNV+iiQCnKVJgC/WKSJBlnrUkQLHLR80fHvE
MCAncgiHMXPEUwOE297aw/7zBwlXeMe9T+aOAOIMFqhirCwf9KLYqn68Nk77gxfT
uwuDZLFgIh6DEBfkLSbOFoJai4IneHjdy+voJXZw58VStj2IBbwGWuc6uOv6XAke
zsqhnJpBlClncjXol4VgJKvivF0RM070RvISRPNh6HfCF3staaom/Luv2v5NQDFB
mInXhPEH/GgruY0z3KPmX/il1uRZAxNVVZ6RRtK+IgxE1GsX6OR8sgLs5OZG8Ncv
InPFe+3e04ZWjJOvfWdBilC34soH8b4VNwlZpyOWad9HTxLnzzYecwJo3On2vbtO
eKyMT0lS0aUZYcXwnkyBXPdd5OoHoxCs4g/C3/GBCBtqqwHkarkC2QKD5EkwzmHn
NqPeUjQln36tA39KCXt7K0vmsh7Ne7VUSOBv+ZsDqfNcaYgYo94vFQwtNLbGP+DH
2Zs6zTaZOaiR++PgkAgz
=Hqri
-END PGP SIGNATURE-

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



"Disclaimer and confidentiality clause -
 This message and any attachments relating to official business of CCIL OR ANY 
OF IT'S SUBSIDIARIES is proprietary to CCIL and intended for the original 
addressee only.
The message may contain information that is confidential and subject to legal 
privilege. 
Any views expressed in this message are those of the individual sender. 
If you have received this message in error, please notify the

Re: Errors at INFO level despite "Note: further occurrences of ... errors will be logged at DEBUG level."

2015-08-20 Thread Konstantin Kolinko
2015-08-19 18:21 GMT+03:00 Robert Tupelo-Schneck :
> I'm running Tomcat 8.0.24.  I see lots of errors in catalina.out with lines 
> like
>
>  Note: further occurrences of Cookie errors will be logged at DEBUG level.
>  Note: further occurrences of Parameter errors will be logged at DEBUG level.
>  Note: further occurrences of HTTP header parsing errors will be logged at 
> DEBUG level.
>
> But, the errors keep showing up at INFO level!
>
> I get these many many times a day, but I do not get user complaints, and I 
> have not been able to cause the errors myself.
>
> I would like to either
> (1) Make these errors go away (such as by really having them logged at DEBUG 
> level), or
> (2) Get detailed information on the client request that caused the error so I 
> can figure out how to make them less frequent.

1. Both logging level and silencing interval are configurable with
system properties. See properties with "UserDataHelper" in their name
on the following page:

http://tomcat.apache.org/tomcat-8.0-doc/config/systemprops.html#Logging

By default suppression period is one day. For performance reasons,
suppression period may be not effective immediately (so that several
simultaneous messages can be logged at info level).

2. There is a way to match log message to a line in access log, by
using id of the current thread.

At the event logging side, org.apache.juli.OneLineFormatter does
include thread name in its log message.

At access logging side the AccessLogValve can be configured to log
thread name (as well as some other detailed information).

3. If some more detailed information is needed, one need to change
specific error messages (it is doable, if there is an interest in it,
but it depends on whether additional information is available in those
places).

> Can anyone advise on how I could accomplish either of those goals?
>
> For completeness, here are the kinds of errors:
>
> org.apache.tomcat.util.http.LegacyCookieProcessor.processCookieHeader 
> Cookies: Invalid cookie. Value not a token or quoted value

Some client has a broken cookie, uses a broken browser.  E.g. if a
client is sending 8-bit characters where only 7-bit (aka US-ASCII) are
allowed.

It is possible to change cookie handling by configuring a different
CookieProcessor,
http://tomcat.apache.org/tomcat-8.0-doc/config/cookie-processor.html


If client browser has a broken cookie, it will continue sending it
until the cookie expires or cookies are cleared by user, or server
sends set-cookie header that clears that cookie.

> org.apache.coyote.http11.AbstractHttp11Processor.process Error parsing HTTP 
> request header
> org.apache.tomcat.util.http.Parameters.processParameters Invalid chunk 
> starting at byte [242] and ending at byte [244] with a value of [=1] ignored
>
> I also see a lot of this one, at SEVERE level; I'd like to deal with it the 
> same way as the others:
>
> org.apache.coyote.http11.AbstractHttp11Processor.process Error processing 
> request
>  java.lang.IllegalArgumentException: Control character in cookie value or 
> attribute.


No stacktrace here?  It is odd for a cookie error to be popping up to
a request processor.

What is your connector configuration:
 protocol (HTTP / AJP),
 implementation (BIO / NIO / NIO2 / APR) ?


BTW, Tomcat 8.0.26 is currently being tested and voted. You would like
to test it, you can find details on dev@ mailing list.

Best regards,
Konstantin Kolinko

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



Re: [ANN] Apache Tomcat Connectors 1.2.41 released

2015-08-20 Thread John Byrne
Unsubscibe



On 19 August 2015 at 13:30, jean-frederic clere  wrote:

> On 08/17/2015 01:10 PM, Mark Thomas wrote:
>
>> The Apache Tomcat Project is proud to announce the release of version
>> 1.2.41 of the Apache Tomcat Connectors.
>> This version fixes one security issue (CVE-2014-8111) and a number of
>> bugs found in previous releases.
>>
>
> Many thanks for the release and sorry for all the troubles around
> CVE-2014-8111.
>
> Cheers
>
> Jean-Frederic
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Mult-i-tel better by design.

http://www.multitel.co.uk

tel: 44(0)151 548 8122
fax: 44(0)709 210 1464
skype jcbyrne


Re: Is Container Managed Transactions possible in case of Tomcat ?

2015-08-20 Thread Alex Soto
Yes since Apache TomEE is Java EE 6 certified it can runs with any JPA
provider. As suggested you can use previous links for this. It is really
simple. Also briefly Apache TomEE 7 M1 (Java EE 7 compatible) will be
released.

As mentioned subscribe to TomEE mailing list or you can contact myself
without any problem.

Alex.

El dc., 19 ag. 2015 a les 22:26, Howard W. Smith, Jr. (<
smithh032...@gmail.com>) va escriure:

> On Aug 19, 2015 3:56 PM, "Sreyan Chakravarty" 
> wrote:
> >
> > TomEE supports Apache OpenJPA. What if I wanted to use Hibernate as my
> JPA
> > provider ?
> >
>
> I searched Google for
>
> tomee hibernate tutorial
>
> And found
>
> http://tomee.apache.org/examples-trunk/jpa-hibernate/README.html
>
> https://rmannibucau.wordpress.com/2012/07/01/hibernate-tomee/
>
> And many more. Please subscribe to the Apache TomEE user list, download
> latest version, and ask any further questions on the tomee user list.
>
> > On Wed, Aug 19, 2015 at 9:53 PM, Alex Soto  wrote:
> >
> > > Yeah in this case you should take a look at Apache TomEE which is
> Apache
> > > Tomcat + Java EE and you will get all of these for free :).
> > >
> > > El dc., 19 ag. 2015 a les 18:18, Daniel Mikusa ()
> va
> > > escriure:
> > >
> > > > On Wed, Aug 19, 2015 at 12:03 PM, Sreyan Chakravarty <
> > > > sreyan.mail...@gmail.com> wrote:
> > > >
> > > > > I planning to use JPA (Hibernate) in a small project that I am
> > > > developing.
> > > > > Now I have heard a lot about the benefits of using Container
> Managed
> > > > > Transactions(CMT) for JPA in web apps. But most of the tutorials on
> the
> > > > web
> > > > > use either GlassFish or JBoss, so I was wondering is CMT supported
> by
> > > > > Tomcat. Send me a link to the documentation for this if there is
> any.
> > > > > Please note that I am going to use a datasource to connect to my
> > > database
> > > > > and I am using persistence.xml(JPA style) to use Hibernate.
> > > > >
> > > >
> > > > If you're referring to JTA, then no.  Tomcat doesn't implement that.
> > > > Tomcat only implements a subset of the JEE spec.
> > > >
> > > > http://tomcat.apache.org/whichversion.html
> > > >
> > > > However most of the parts of the spec that Tomcat does not implement
> can
> > > be
> > > > pulled in via libraries.  For JTA you can use a third party
> > > implementation
> > > > with Tomcat.  Atomikos, JOTM and Bitronix are ones that come to mind.
> > > >
> > > > These docs are a little dated, but should get you started.
> > > >
> > > > http://www.atomikos.com/Documentation/TomcatIntegration
> > > > http://jotm.objectweb.org/current/jotm/doc/howto-tomcat-jotm.html
> > > >
> > > > Dan
> > > >
> > >
>