Tomcat behind Apache web server ProxyPass settings for WebSocket

2018-12-04 Thread richard
I'm trying to see the WebSocket examples that ship with Tomcat 9 in 
action.


If I point my browser directly at tomcat on 8080, they work.

However, Tomcat is behind an Apache2 webserver and I can't seem to get 
the ProxyPass settings right. Other Tomcat applications work if I access 
them via Apache, but WebSocket applications don't. The snake demo for 
example, gives a 'Info: WebSocket closed' message.


Apache is on the same server as Tomcat and has the proxy_wstunnel mod 
loaded.


The relevant (I think) part of my  VirtualHost in the Apache2 conf file 
is like this:


  ProxyPass/http://127.0.0.1:8080/  #works ok
  ProxyPassReverse /http://127.0.0.1:8080/  #works ok
  ProxyPass/ws://127.0.0.1:8080/
  ProxyPassReverse /ws://127.0.0.1:8080/

Could anyone tell me what's wrong here?


Thanks.
Richard




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



Re: Using tomcat manager to deploy to several services

2018-12-04 Thread tomcat

On 04.12.2018 17:55, Frank Schullerer wrote:

Hello @all,

After searching the web many many times and reading all this here, it seems
that there is no real good
solution for this. In my example server.xml are 4 services but we have 25
and more to come. So we need maybe a
management solution like the Tcat server or I don't know . That's a little
frustrating because I thought it'd be easier.

But many thanks for all the answers!!!


You may be interested also in this :
https://stackoverflow.com/questions/45927603/multiple-tomcat-instances-vs-multiple-tomcat-services

There were also several discussions on the same theme in the past on this same list, of 
which searchable archives are available, as per :

http://tomcat.apache.org/lists.html
for example : 
https://markmail.org/search/?q=multiple%20instances%20list%3Aorg.apache.tomcat.user%2F






Am Di., 4. Dez. 2018 um 17:45 Uhr schrieb Christopher Schultz <
ch...@christopherschultz.net>:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Frank,

On 12/4/18 06:09, Frank Schullerer wrote:

Thanks!

Ok let me know if I can achive things in a better way. Now I have
a server.xml like this:



  
  
  

Please note that we need different ports and different
configurations (like clientAuth or keyAlias) for the applications.
If there is a better way and have a tomcat manager to deploy all
applications, please let me know!

Thank you in advance!


As Mark said, you will need to deploy the Tomcat manager 4 times for
the above configuration.

- -chris


Am Di., 4. Dez. 2018 um 11:53 Uhr schrieb Mark Thomas
:


On 04/12/2018 10:19, Frank Schullerer wrote:

Hello,

I think this question is independent from the tomcat version
but I tried

it

with Tomcat 9.0.13 on Windows. We have several "service" tags
in our server.xml because we have several applications running
in one tomcat with several ports and different configuration
(clientAuth etc). I tried to use the tomcat manager to deploy
to different services but it failed. It seems that the tomcat
manager can only deploy within the same service because when I
deploy the tomcat manager itself to a different service than it
works. I can deploy to that service.

Is this correct or can I configure the tomcat manager to deploy
to other services? I also tried to achive that with a
configuration with "context.xml" but failed.

Please help!


TL;DR you can't deploy services that way.

The Tomcat Manager application only works with the Host to which
it has been deployed.

In Tomcat: - There is exactly one Server - A Server may contain 0
or more Services - A Service may contain 0 or more Connectors and
no more than one Engine - An Engine may contain 0 or more Hosts -
A host may contain 0 or more Contexts (Context == web
application)

(I left a few things like Valves and Executors out to keep it
simple)


The Tomcat Host Manager application only works with the Engine
associated with the Host to which it has been deployed.

Mark

-



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

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





-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlwGrywACgkQHPApP6U8
pFjwZhAAkXowqbvU3WteyhR+Zv2UkNcYhQ5XQH9Z/0kw0GF53+We2Tb4VH6dtXMK
CF/JEIRRLGaRW60HO2V5vXi3dP57+eZm2gpUIH4bpNfE5w7yCl0CdbSwgSzC5+IR
4++CqvGRSQO1fMzIWQG+aYopvo1UDgfBl8mL5mcBcUrzkL1jeEledWDv63kI6MFQ
3FlXjl6qgF1eV9EYUw2BUtQyRlgWVLmmMu9p/7PY90WupBMzFAIWcxas3YwITGTY
Ul2/ClxdfQdOU179l5YRD2nB5mgZNPZ1kIL6WNy9AJtzq8fHUrdj4CfTC4uy9FqL
BLw66Huj0AADMJn5RBH7WyH+hyVNbf8JSGjLyF6PLYvot6ZR6iRidzftpwT42kya
JZgpALSRBGIKOAPbNWEPRtrgTp5TjX1cMol23v86+jv6DEzLLptv4wa8jJyLbZ4w
UU5NW7RQ/oJoWY3IQ1fdsYmwsqYj08JkzN9ZEEWa0DlA150dJvMxrizSY5C3QGeo
S7WN2mWsbvppZRVg6qAlFlOyFjmJIKWWg4YBp1OybUzgAFb1w8E/xH521T5Zz1Rj
uV0xit65jvYZucSUsA13q/vEGESOc5VIex/rKCaDOJhtiTHLTtGzkbA7kYgJVAJS
NqKpbb7Zr+K7PS4i5pjIlAZjv6oqF40M9xwbTjEi6QyLyxQiYho=
=LeCR
-END PGP SIGNATURE-

-
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: Connector protocol and request handling in Tomcat 8

2018-12-04 Thread Saurav Sarkar
Thanks a lot Mark again.

Actually i made mistake in getting the correct thread dump from my server
when it was not accepting any further requests.

We make blocking network I/O calls which blocks the threads . I see that
the current threads go to park state when expecting to read from the input
stream. The system stops responding when 200 concurrent requests have been
fired.

This situation obviously improves after some time when request processing
finishes.

I think this situation can be improved by implementing non blocking
asynchronous calls in my java servlet code. This should free up my threads.

Please provide your further inputs.

Best Regards,
Saurav

On Mon, Dec 3, 2018 at 10:26 PM Mark Thomas  wrote:

> On 03/12/2018 15:26, Saurav Sarkar wrote:
> > Thanks a lot Mark for the reply.
> >
> > Please bear with me for my follow up questions :)
> >
> > Does the park state (in visual vm) depicts the connection is idle and
> > waiting for requests ?
>
> There is no direct correlation between thread and connection. A thread
> is only assigned to a connection when there is a request on that
> connection to process. Once the request has been processed the thread
> returns to the pool.
>
> The park state (as shown below) means the thread is idle in the pool
> waiting to be assigned to a connection with a request to process.
>
> > I see all threads reaching to this stage and my tomcat stops accepting
> any
> > further requests
>
> Then there is something wrong in your system but it isn't related to the
> size of Tomcat's thread pool.
>
> > "http-nio-0.0.0.0-8080-exec-1357" - Thread t@80536
> >java.lang.Thread.State: WAITING
> > at jdk.internal.misc.Unsafe.park(Native Method)
> > - parking to wait for  (a
> > java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
> > at sun.misc.Unsafe.park(Unsafe.java:1079)
> > at
> java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
> > at
> >
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
> > at
> >
> java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
> > at
> org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
> > at
> org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
> > at
> >
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
> > at
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
> > at
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> > at
> >
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> > at java.lang.Thread.run(Thread.java:836)
> >
> > Also one general question : Isn't the persistent connection mechanism
> > counter productive with nio handling ?
>
> No.
>
> > Because i will be never able to achieve high throughput if persistent
> > connections are established.
>
> Also incorrect.
>
> > Only way for me to achieve is to increase the number of threads.
>
> Given you have a large number of idle threads, that statement does not
> seem logical.
>
> > We have 8G instances for 200 threads. I don't know how many threads we
> can
> > scale up to.
>
> That is highly application dependent. I've seen apps that can choke a
> server with 8G RAM and just 5 concurrent requests and apps that are
> barely loading a server with 1G RAM and over 1500 concurrent requests.
>
> There is something else going wrong in your system if the system freezes
> with Tomcat threads in the idle state.
>
> What other components are there between the clients and Tomcat (proxies,
> firewalls, etc.)?
>
> If you provide a complete thread dump for when the system is hung we can
> try and provide additional pointers.
>
> Mark
>
>
> >
> > Best Regards,
> > Saurav
> >
> >
> > On Mon, Dec 3, 2018 at 4:14 PM Mark Thomas  wrote:
> >
> >> On 03/12/2018 09:24, Saurav Sarkar wrote:
> >>> Hi All,
> >>>
> >>> I want to know the connector's protocol which is being used in my
> tomcat
> >> 8
> >>> container and clear the  behaviour of request handling
> >>>
> >>> We have a cloud foundry based application running on java build pack.
> >>>
> >>> Below is the connector settings in server.xml
> >>>
> >>>>>>
> >>>bindOnInit="false"
> >>>
> >>>compression="on"
> >>>
> >>>
> >>>
> >>
> compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json"
> >>>
> >>>allowTrace="false"
> >>>
> >>>address="${connector.address}"
> >>>
> >>>maxHttpHeaderSize="8192"
> >>>
> >>>maxThreads="200"
> >>>
> >>>server="tomcat" />
> >>>
> >>>
> >>> It does not show any connector details.
> >>>
> >>>
> >>> My thread dumps shows http-nio-exec threads and 

Re: manager app, Complete Server Status, not shown list of NIO threads

2018-12-04 Thread Mark Thomas
On 04/12/2018 15:10, Jan Vávra wrote:
> Hello,
>  I'm using Apache Tomcat/8.5.35, jvm 1.8.0_192-b12, Windows Server 2012
> R2 and at Complete Server Status page I can see list of all http-nio
> threads and I can see a header of ajp-nio threads. But there is
> displayed only a label Max threads:
> and nothing more.

That matches this:
https://bz.apache.org/bugzilla/show_bug.cgi?id=62918


> In the localhost.log is an exception:
> 04-Dec-2018 10:31:38.109 SEVERE [96]
> org.apache.catalina.core.StandardHostValve.invoke Exception Processing null
>  java.lang.NullPointerException
>     at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:236)

although the exception is different. Odd.

I'll echo Chris's comments about the exception.

Mark


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



RE: Help debugging stream error

2018-12-04 Thread Eduardo Quintanilla
Thanks Mark, I will keep the changelog in mind for future references.

Eduardo Quintanilla
Software Developer 
Block Networks 

-Original Message-
From: Mark Thomas  
Sent: martes, 4 de diciembre de 2018 11:00 a. m.
To: users@tomcat.apache.org
Subject: Re: Help debugging stream error

On 04/12/2018 15:24, Eduardo Quintanilla wrote:
> Hi,
> 
> I am having an sporadic error with our app that slows  a lot the responses of 
> the server.
> Any suggestions about how to find the cause of the error will be appreciated.
> 
> Tomcat version: Apache Tomcat/8.5.20
> Java: JDK 1.8.0_191-b12
> VM Options: -Xms200m -Xmx7g -XX:PermSize=256m -XX:MaxPermSize=512m 
> -Drebel.always.rerun.clinit=true 
> -Dxwork.loggerFactory=com.opensymphony.xwork2.util.logging.slf4j.Slf4jLoggerFactory
>  -Dfile.encoding=UTF8 
> -javaagent:"C:\equintanilla\Software\glowroot\glowroot.jar"
> 
> Logs:
> 04-Dec-2018 09:13:15.295 GRAVE [https-openssl-apr-9380-exec-123] 
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process Error 
> reading request, ignored java.lang.StackOverflowError


http://svn.apache.org/repos/asf/tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml

Search for "HTTP/2" or "StackOverflowError"

The do the obvious to resolve the issue.

Mark


>  at 
> java.util.Collections$SetFromMap.contains(Collections.java:5459)
>  at 
> org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:67)
>  at 
> org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
>  at 
> org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
>  at 
> org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
>  at 
> org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
>  at 
> org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
>  at 
> org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
>  at 
> org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
>  at 
> org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
>  at 
> org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
>  at 
> org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
>  at 
> org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
>  at 
> org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.jav
> a:71)
> 
> Connector:
>   protocol="org.apache.coyote.http11.Http11AprProtocol"
> URIEncoding="UTF-8" maxThreads="150" 
> SSLEnabled="true" >
>  
>  
> certificateFile="conf/localhost.cer"
>   type="RSA" />
>  
>  
> 
> 
> Eduardo Quintanilla
> Software Developer
> Block Networks
> 
> 

-
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: Help debugging stream error

2018-12-04 Thread Mark Thomas

On 04/12/2018 15:24, Eduardo Quintanilla wrote:

Hi,

I am having an sporadic error with our app that slows  a lot the responses of 
the server.
Any suggestions about how to find the cause of the error will be appreciated.

Tomcat version: Apache Tomcat/8.5.20
Java: JDK 1.8.0_191-b12
VM Options: -Xms200m -Xmx7g -XX:PermSize=256m -XX:MaxPermSize=512m 
-Drebel.always.rerun.clinit=true 
-Dxwork.loggerFactory=com.opensymphony.xwork2.util.logging.slf4j.Slf4jLoggerFactory 
-Dfile.encoding=UTF8 -javaagent:"C:\equintanilla\Software\glowroot\glowroot.jar"

Logs:
04-Dec-2018 09:13:15.295 GRAVE [https-openssl-apr-9380-exec-123] 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process Error reading 
request, ignored
java.lang.StackOverflowError



http://svn.apache.org/repos/asf/tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml

Search for "HTTP/2" or "StackOverflowError"

The do the obvious to resolve the issue.

Mark



 at 
java.util.Collections$SetFromMap.contains(Collections.java:5459)
 at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:67)
 at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
 at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
 at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
 at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
 at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
 at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
 at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
 at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
 at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
 at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
 at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
 at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)

Connector:
 
 
 
 
 
 


Eduardo Quintanilla
Software Developer
Block Networks




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



Re: Using tomcat manager to deploy to several services

2018-12-04 Thread Frank Schullerer
Hello @all,

After searching the web many many times and reading all this here, it seems
that there is no real good
solution for this. In my example server.xml are 4 services but we have 25
and more to come. So we need maybe a
management solution like the Tcat server or I don't know . That's a little
frustrating because I thought it'd be easier.

But many thanks for all the answers!!!


Am Di., 4. Dez. 2018 um 17:45 Uhr schrieb Christopher Schultz <
ch...@christopherschultz.net>:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Frank,
>
> On 12/4/18 06:09, Frank Schullerer wrote:
> > Thanks!
> >
> > Ok let me know if I can achive things in a better way. Now I have
> > a server.xml like this:
> >
> >   > name="Catalina">  > defaultHost="localhost">  >
> >  
> >
> >   > keyAlias=""  />   > name="host1" appBase="services/a" >   
> >   > keyAlias=""  />   > name="host2" appBase="services/b" >   
> >   > keyAlias="ccc"  />   > name="host3" appBase="services/c" >   
> >
> > Please note that we need different ports and different
> > configurations (like clientAuth or keyAlias) for the applications.
> > If there is a better way and have a tomcat manager to deploy all
> > applications, please let me know!
> >
> > Thank you in advance!
>
> As Mark said, you will need to deploy the Tomcat manager 4 times for
> the above configuration.
>
> - -chris
>
> > Am Di., 4. Dez. 2018 um 11:53 Uhr schrieb Mark Thomas
> > :
> >
> >> On 04/12/2018 10:19, Frank Schullerer wrote:
> >>> Hello,
> >>>
> >>> I think this question is independent from the tomcat version
> >>> but I tried
> >> it
> >>> with Tomcat 9.0.13 on Windows. We have several "service" tags
> >>> in our server.xml because we have several applications running
> >>> in one tomcat with several ports and different configuration
> >>> (clientAuth etc). I tried to use the tomcat manager to deploy
> >>> to different services but it failed. It seems that the tomcat
> >>> manager can only deploy within the same service because when I
> >>> deploy the tomcat manager itself to a different service than it
> >>> works. I can deploy to that service.
> >>>
> >>> Is this correct or can I configure the tomcat manager to deploy
> >>> to other services? I also tried to achive that with a
> >>> configuration with "context.xml" but failed.
> >>>
> >>> Please help!
> >>
> >> TL;DR you can't deploy services that way.
> >>
> >> The Tomcat Manager application only works with the Host to which
> >> it has been deployed.
> >>
> >> In Tomcat: - There is exactly one Server - A Server may contain 0
> >> or more Services - A Service may contain 0 or more Connectors and
> >> no more than one Engine - An Engine may contain 0 or more Hosts -
> >> A host may contain 0 or more Contexts (Context == web
> >> application)
> >>
> >> (I left a few things like Valves and Executors out to keep it
> >> simple)
> >>
> >>
> >> The Tomcat Host Manager application only works with the Engine
> >> associated with the Host to which it has been deployed.
> >>
> >> Mark
> >>
> >> -
> >>
> >>
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
> >
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlwGrywACgkQHPApP6U8
> pFjwZhAAkXowqbvU3WteyhR+Zv2UkNcYhQ5XQH9Z/0kw0GF53+We2Tb4VH6dtXMK
> CF/JEIRRLGaRW60HO2V5vXi3dP57+eZm2gpUIH4bpNfE5w7yCl0CdbSwgSzC5+IR
> 4++CqvGRSQO1fMzIWQG+aYopvo1UDgfBl8mL5mcBcUrzkL1jeEledWDv63kI6MFQ
> 3FlXjl6qgF1eV9EYUw2BUtQyRlgWVLmmMu9p/7PY90WupBMzFAIWcxas3YwITGTY
> Ul2/ClxdfQdOU179l5YRD2nB5mgZNPZ1kIL6WNy9AJtzq8fHUrdj4CfTC4uy9FqL
> BLw66Huj0AADMJn5RBH7WyH+hyVNbf8JSGjLyF6PLYvot6ZR6iRidzftpwT42kya
> JZgpALSRBGIKOAPbNWEPRtrgTp5TjX1cMol23v86+jv6DEzLLptv4wa8jJyLbZ4w
> UU5NW7RQ/oJoWY3IQ1fdsYmwsqYj08JkzN9ZEEWa0DlA150dJvMxrizSY5C3QGeo
> S7WN2mWsbvppZRVg6qAlFlOyFjmJIKWWg4YBp1OybUzgAFb1w8E/xH521T5Zz1Rj
> uV0xit65jvYZucSUsA13q/vEGESOc5VIex/rKCaDOJhtiTHLTtGzkbA7kYgJVAJS
> NqKpbb7Zr+K7PS4i5pjIlAZjv6oqF40M9xwbTjEi6QyLyxQiYho=
> =LeCR
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: manager app, Complete Server Status, not shown list of NIO threads

2018-12-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jan,

On 12/4/18 10:10, Jan Vávra wrote:
> Hello, I'm using Apache Tomcat/8.5.35, jvm 1.8.0_192-b12, Windows
> Server 2012 R2 and at Complete Server Status page I can see list of
> all http-nio threads and I can see a header of ajp-nio threads. But
> there is displayed only a label Max threads: and nothing more.
> 
> In the localhost.log is an exception: 04-Dec-2018 10:31:38.109
> SEVERE [96] org.apache.catalina.core.StandardHostValve.invoke
> Exception Processing null java.lang.NullPointerException at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa
lve.java:236)
>
>  at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa
lve.java:96)
>
>  at 
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticat
orBase.java:493)
>
>  at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja
va:140)
>
>  at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja
va:81)
>
>  at 
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAcces
sLogValve.java:650)
>
>  at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv
e.java:87)
>
>  at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
:342)
>
> 
at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:479)
> at 
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLigh
t.java:66)
>
>  at 
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractP
rotocol.java:806)
>
>  at 
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoi
nt.java:1498)
>
>  at 
> org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase
.java:49)
>
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.j
ava:1149)
>
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
java:624)
>
>  at 
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThr
ead.java:61)
>
>  at java.lang.Thread.run(Thread.java:748)
> 
> At the version Apache Tomcat/8.5.34 this problem doesn't occur. Did
> I found a bug?

Something looks seriously broken if you got an NPE on that line of
code. Either the Valve doesn't have a Container or the Container
doesn't have a logger, neither of which should ever happen.

What's your use-case? Is this embedded, or using Tomcat "normally"
like starting-up from a script/service and deploying web applications
to it?

Did you upgrade from 8.5.34 and then it broke? How did you perform the
upgrade?

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlwGsBUACgkQHPApP6U8
pFg7RxAAvmaaNGfOSGut8l5xHktCpf7B8Uy4/nChr/gAeGuY6Vk0vKcB88cdecGU
q70+atyU6r03sUWuIbfM9OQc7DhPS5mZHifCOM8Yn77ZK6pJERYg+tz4m/f7M979
Cj7QUIHl8/i21qULL6Y5OQyV/N5U9lAnKzGRJrVcDghcl+pYrEBE3P+VyOXduTvr
rOjYxNq2NP+D0B4JTy1D+Wa7+BFsqrAwm3TjQ7vxCg3wW4OWwDUM7SKYCCDMCYHV
kLHIgJFRSwoZIGhDI4HYGjssY1H1q4DCTJPduQi0RZI/IcvrHNjRff3S9HXnzs5n
86efvPHh8SUmp42dFwWzlXq6E7O9tzoCOTbAn+SEr3EQG8H2m2cQ8Y66zaoXZGMY
hN+cPtMfimwCpI3bO46yEB6YipZbf4fjn6MXIbJk+GWEafuviEg0t/uIUGRslBpl
CpzJb1lgZZUIdmn3xvdPsCzo1Ot5saC2lEJbzCnBjjR8d9RqlrGZKBn5L6h43zxV
QlEK8YfF11YckXKSM/Kr8/AorYzmifcd6aAQJJtCPkQWE49YDzbCOIAqy6ooR7Br
fCpfs1cUsemNn0nfUYWMN/4X/NDfrsFhdxLveI8/bjMCFfYCxyH0V5wYN69oZaWL
N8Vt74TrJ4gqukQTwvq85xdgVdLj9zQgTtVci5+AamjDe6ydTjI=
=Wtha
-END PGP SIGNATURE-

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



Re: Using tomcat manager to deploy to several services

2018-12-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Frank,

On 12/4/18 06:09, Frank Schullerer wrote:
> Thanks!
> 
> Ok let me know if I can achive things in a better way. Now I have
> a server.xml like this:
> 
>   name="Catalina">  defaultHost="localhost">  
>  
> 
>   keyAlias=""  />   name="host1" appBase="services/a" >
>   keyAlias=""  />   name="host2" appBase="services/b" >
>   keyAlias="ccc"  />   name="host3" appBase="services/c" >   
> 
> Please note that we need different ports and different
> configurations (like clientAuth or keyAlias) for the applications. 
> If there is a better way and have a tomcat manager to deploy all 
> applications, please let me know!
> 
> Thank you in advance!

As Mark said, you will need to deploy the Tomcat manager 4 times for
the above configuration.

- -chris

> Am Di., 4. Dez. 2018 um 11:53 Uhr schrieb Mark Thomas
> :
> 
>> On 04/12/2018 10:19, Frank Schullerer wrote:
>>> Hello,
>>> 
>>> I think this question is independent from the tomcat version
>>> but I tried
>> it
>>> with Tomcat 9.0.13 on Windows. We have several "service" tags
>>> in our server.xml because we have several applications running
>>> in one tomcat with several ports and different configuration 
>>> (clientAuth etc). I tried to use the tomcat manager to deploy
>>> to different services but it failed. It seems that the tomcat
>>> manager can only deploy within the same service because when I
>>> deploy the tomcat manager itself to a different service than it
>>> works. I can deploy to that service.
>>> 
>>> Is this correct or can I configure the tomcat manager to deploy
>>> to other services? I also tried to achive that with a
>>> configuration with "context.xml" but failed.
>>> 
>>> Please help!
>> 
>> TL;DR you can't deploy services that way.
>> 
>> The Tomcat Manager application only works with the Host to which
>> it has been deployed.
>> 
>> In Tomcat: - There is exactly one Server - A Server may contain 0
>> or more Services - A Service may contain 0 or more Connectors and
>> no more than one Engine - An Engine may contain 0 or more Hosts -
>> A host may contain 0 or more Contexts (Context == web
>> application)
>> 
>> (I left a few things like Valves and Executors out to keep it
>> simple)
>> 
>> 
>> The Tomcat Host Manager application only works with the Engine 
>> associated with the Host to which it has been deployed.
>> 
>> Mark
>> 
>> -
>>
>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
>> 
> 
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlwGrywACgkQHPApP6U8
pFjwZhAAkXowqbvU3WteyhR+Zv2UkNcYhQ5XQH9Z/0kw0GF53+We2Tb4VH6dtXMK
CF/JEIRRLGaRW60HO2V5vXi3dP57+eZm2gpUIH4bpNfE5w7yCl0CdbSwgSzC5+IR
4++CqvGRSQO1fMzIWQG+aYopvo1UDgfBl8mL5mcBcUrzkL1jeEledWDv63kI6MFQ
3FlXjl6qgF1eV9EYUw2BUtQyRlgWVLmmMu9p/7PY90WupBMzFAIWcxas3YwITGTY
Ul2/ClxdfQdOU179l5YRD2nB5mgZNPZ1kIL6WNy9AJtzq8fHUrdj4CfTC4uy9FqL
BLw66Huj0AADMJn5RBH7WyH+hyVNbf8JSGjLyF6PLYvot6ZR6iRidzftpwT42kya
JZgpALSRBGIKOAPbNWEPRtrgTp5TjX1cMol23v86+jv6DEzLLptv4wa8jJyLbZ4w
UU5NW7RQ/oJoWY3IQ1fdsYmwsqYj08JkzN9ZEEWa0DlA150dJvMxrizSY5C3QGeo
S7WN2mWsbvppZRVg6qAlFlOyFjmJIKWWg4YBp1OybUzgAFb1w8E/xH521T5Zz1Rj
uV0xit65jvYZucSUsA13q/vEGESOc5VIex/rKCaDOJhtiTHLTtGzkbA7kYgJVAJS
NqKpbb7Zr+K7PS4i5pjIlAZjv6oqF40M9xwbTjEi6QyLyxQiYho=
=LeCR
-END PGP SIGNATURE-

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



Help debugging stream error

2018-12-04 Thread Eduardo Quintanilla
Hi,

I am having an sporadic error with our app that slows  a lot the responses of 
the server.
Any suggestions about how to find the cause of the error will be appreciated.

Tomcat version: Apache Tomcat/8.5.20
Java: JDK 1.8.0_191-b12
VM Options: -Xms200m -Xmx7g -XX:PermSize=256m -XX:MaxPermSize=512m 
-Drebel.always.rerun.clinit=true 
-Dxwork.loggerFactory=com.opensymphony.xwork2.util.logging.slf4j.Slf4jLoggerFactory
 -Dfile.encoding=UTF8 
-javaagent:"C:\equintanilla\Software\glowroot\glowroot.jar"

Logs:
04-Dec-2018 09:13:15.295 GRAVE [https-openssl-apr-9380-exec-123] 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process Error reading 
request, ignored
java.lang.StackOverflowError
at 
java.util.Collections$SetFromMap.contains(Collections.java:5459)
at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:67)
at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)
at 
org.apache.coyote.http2.AbstractStream.isDescendant(AbstractStream.java:71)

Connector:








Eduardo Quintanilla
Software Developer
Block Networks



manager app, Complete Server Status, not shown list of NIO threads

2018-12-04 Thread Jan Vávra

Hello,
 I'm using Apache Tomcat/8.5.35, jvm 1.8.0_192-b12, Windows Server 2012 
R2 and at Complete Server Status page I can see list of all http-nio 
threads and I can see a header of ajp-nio threads. But there is 
displayed only a label Max threads:

and nothing more.

In the localhost.log is an exception:
04-Dec-2018 10:31:38.109 SEVERE [96] 
org.apache.catalina.core.StandardHostValve.invoke Exception Processing null

 java.lang.NullPointerException
    at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:236)
    at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
    at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)

    at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:479)
    at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
    at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
    at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

    at java.lang.Thread.run(Thread.java:748)

At the version Apache Tomcat/8.5.34 this problem doesn't occur.
Did I found a bug?

Jan.


Re: Using tomcat manager to deploy to several services

2018-12-04 Thread Frank Schullerer
Hello,

thanks for the answer. That is exactly the way how we do this today (all
via a shell script and via Jenkins). But I thought the
"official" way to start/stop/deploy/reload applications via   e.g.  "curl
http://localhost:8080/manager/text/reload?... " is better

Greetings


Am Di., 4. Dez. 2018 um 15:40 Uhr schrieb Jäkel, Guido :

> Dear Frank,
>
> I guess you have configured autodeployment of the WARs. And it seems to me
> that you want to use a tree in a filesystem to place your deployments.
> Given that, you may use an arbitrary way to place the WARs to that
> location, because it's not the Tomcat Manager application that actually
> perform the deployment.
>
> You may trigger a restart of the application container by touching the WAR
> or (in case of an expanded deployment) touching a watched file (common
> WEB-INF/web.xml) and trigger undeploy by removing (or hiding by rename the
> extention) the WAR.
>
> >If there is a better way and have a tomcat manager to deploy all
> applications, please let me know!
>
>
> with greetings
>
> Guido
>


RE: Using tomcat manager to deploy to several services

2018-12-04 Thread Jäkel , Guido
Dear Frank,

I guess you have configured autodeployment of the WARs. And it seems to me that 
you want to use a tree in a filesystem to place your deployments. Given that, 
you may use an arbitrary way to place the WARs to that location, because it's 
not the Tomcat Manager application that actually perform the deployment.

You may trigger a restart of the application container by touching the WAR or 
(in case of an expanded deployment) touching a watched file (common 
WEB-INF/web.xml) and trigger undeploy by removing (or hiding by rename the 
extention) the WAR.

>If there is a better way and have a tomcat manager to deploy all applications, 
>please let me know!


with greetings

Guido


Re: Using tomcat manager to deploy to several services

2018-12-04 Thread Frank Schullerer
Thanks!

Ok let me know if I can achive things in a better way. Now I have a
server.xml like this:


  

  
  

  





















Please note that we need different ports and different configurations (like
clientAuth or keyAlias) for the applications.
If there is a better way and have a tomcat manager to deploy all
applications, please let me know!

Thank you in advance!



Am Di., 4. Dez. 2018 um 11:53 Uhr schrieb Mark Thomas :

> On 04/12/2018 10:19, Frank Schullerer wrote:
> > Hello,
> >
> > I think this question is independent from the tomcat version but I tried
> it
> > with Tomcat 9.0.13 on Windows.
> > We have several "service" tags in our server.xml because we have several
> > applications
> > running in one tomcat with several ports and different configuration
> > (clientAuth etc).
> > I tried to use the tomcat manager to deploy to different services but it
> > failed. It seems that the tomcat manager can only deploy within the same
> > service because when I deploy the tomcat manager itself to a different
> > service than it works. I can deploy to that service.
> >
> > Is this correct or can I configure the tomcat manager to deploy to other
> > services? I also tried to achive that with a configuration with
> > "context.xml" but failed.
> >
> > Please help!
>
> TL;DR you can't deploy services that way.
>
> The Tomcat Manager application only works with the Host to which it has
> been deployed.
>
> In Tomcat:
> - There is exactly one Server
> - A Server may contain 0 or more Services
> - A Service may contain 0 or more Connectors and no more than one Engine
> - An Engine may contain 0 or more Hosts
> - A host may contain 0 or more Contexts (Context == web application)
>
> (I left a few things like Valves and Executors out to keep it simple)
>
>
> The Tomcat Host Manager application only works with the Engine
> associated with the Host to which it has been deployed.
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Using tomcat manager to deploy to several services

2018-12-04 Thread Mark Thomas
On 04/12/2018 10:19, Frank Schullerer wrote:
> Hello,
> 
> I think this question is independent from the tomcat version but I tried it
> with Tomcat 9.0.13 on Windows.
> We have several "service" tags in our server.xml because we have several
> applications
> running in one tomcat with several ports and different configuration
> (clientAuth etc).
> I tried to use the tomcat manager to deploy to different services but it
> failed. It seems that the tomcat manager can only deploy within the same
> service because when I deploy the tomcat manager itself to a different
> service than it works. I can deploy to that service.
> 
> Is this correct or can I configure the tomcat manager to deploy to other
> services? I also tried to achive that with a configuration with
> "context.xml" but failed.
> 
> Please help!

TL;DR you can't deploy services that way.

The Tomcat Manager application only works with the Host to which it has
been deployed.

In Tomcat:
- There is exactly one Server
- A Server may contain 0 or more Services
- A Service may contain 0 or more Connectors and no more than one Engine
- An Engine may contain 0 or more Hosts
- A host may contain 0 or more Contexts (Context == web application)

(I left a few things like Valves and Executors out to keep it simple)


The Tomcat Host Manager application only works with the Engine
associated with the Host to which it has been deployed.

Mark

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



Re: Using tomcat manager to deploy to several services

2018-12-04 Thread tomcat

On 04.12.2018 11:19, Frank Schullerer wrote:

Hello,

I think this question is independent from the tomcat version but I tried it
with Tomcat 9.0.13 on Windows.
We have several "service" tags in our server.xml because we have several
applications
running in one tomcat with several ports and different configuration
(clientAuth etc).


I think that an important piece of information here, to allow someone to really recommend 
something, would be to give some details as to why you are using such a configuration, for 
example instead of several separate tomcat instances, or several separate VirtualHosts.
If you have different ports and/or authentication methods, does your configuration as a 
single instance bring any specific benefits in your case ?



I tried to use the tomcat manager to deploy to different services but it
failed. It seems that the tomcat manager can only deploy within the same
service because when I deploy the tomcat manager itself to a different
service than it works. I can deploy to that service.

Is this correct or can I configure the tomcat manager to deploy to other
services? I also tried to achive that with a configuration with
"context.xml" but failed.

Please help!




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



Using tomcat manager to deploy to several services

2018-12-04 Thread Frank Schullerer
Hello,

I think this question is independent from the tomcat version but I tried it
with Tomcat 9.0.13 on Windows.
We have several "service" tags in our server.xml because we have several
applications
running in one tomcat with several ports and different configuration
(clientAuth etc).
I tried to use the tomcat manager to deploy to different services but it
failed. It seems that the tomcat manager can only deploy within the same
service because when I deploy the tomcat manager itself to a different
service than it works. I can deploy to that service.

Is this correct or can I configure the tomcat manager to deploy to other
services? I also tried to achive that with a configuration with
"context.xml" but failed.

Please help!