context destroy method only be called once

2019-01-21 Thread Aryeh Friedman
Platform / tomcat version:  Tomcat 9.0.13 / FreeBSD 11.2-RELEASE (amd64)
[from ports collection without modification]

I have 3 ServletContextListener concrete classes and on tomcat start all 3
contextInitalized() methods are called, and complete,but on tomcat stop
only one of the three contextDestroyed() methods completes though all are
called.  Is this normal?  If so what is the right way to work around only
one being able to complete?  If not where and how should I start debugging
this?

-- 
Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org


rewritevalve logging

2019-01-21 Thread Chris Cheshire
I am trying to convert some url rewriting rules from tuckey rewrite
filter to tomcat's rewrite valve.

In my context.xml I have



In my WEB-INF directory I have a rewrite.config file with a couple of rules.

In tomcat's logging.properties I have

org.apache.catalina.core.ContainerBase.[Catalina].[hostname].level = FINEST

in catalina.out I see

21-Jan-2019 19:28:36.969 FINE [main]
org.apache.catalina.valves.rewrite.RewriteValve.startInternal Read
configuration from: /WEB-INF/rewrite.config
21-Jan-2019 19:28:36.971 FINE [main]
org.apache.catalina.valves.rewrite.RewriteValve.parse Add rule with
pattern ^(.*)\.[0-9]{13}\.(css|js)$ and substitution $1.$

(plus other lines for other rules)

on startup but this is all I see.

The few rules I have in there work, but I would like to debug as I go
when adding more rules. Does the valve not log anything as it is
processing rules?

Chris

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



Re: Tomcat 8.5 Error related to Encoding Detector

2019-01-21 Thread Phumelela Mdluli
Hi there,

Your rosehosting source seems legit, may even try going straight to
Apache website. The http status code 500 is "an internal server
error". Please share your tomcat log files i.e. Catalina.out. Seems
clear that your tomcat server/container download is not playing well
with something. Double check your Java and Server versions, plus their
(your downloads) compatibility with each other. Having downloaded
Tomcat several times (for Linux), I think you should know that it
typically works right right off the net.

Regards,

Phumelela

On 1/15/19, prasoon sharma  wrote:
> Hi
> I used the tutorial at
> https://www.rosehosting.com/blog/how-to-install-tomcat-8-on-a-centos-6-vps/
> and
> some tips from
> https://www.openprogrammer.info/2015/06/14/how-to-install-java-8-and-tomcat-8-on-centos-6-as-service/
> I have configured it at 8081 port
>
>
> On Tue, Jan 15, 2019 at 4:14 PM Mark Thomas  wrote:
>
>> On 15/01/2019 10:33, prasoon sharma wrote:
>> > Hi
>> > I am facing issue with Tomcat 8.5 on my Centos Server.
>> >
>> > I am getting HTTP 500 error as
>> >
>> > javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could
>> > not initialize class org.apache.jasper.compiler.EncodingDetector
>> >
>> >
>> > Check the detailed description at
>> >
>> https://stackoverflow.com/questions/54076418/java-lang-noclassdeffounderror-could-not-initialize-class-org-apache-jasper-com
>>
>> What steps did you take to install Apache Tomcat?
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>


-- 
Yours Sincerely,

Phumelela Mdluli
Lake Forest College '15
Waterford Kamhlaba '10 '08

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



Re: Tomcat 9 : How to access Http/2 pseudoHeaders info from Request

2019-01-21 Thread Mark Thomas
On 21/01/2019 08:36, Abhishek kumar srivastava wrote:
> Hi All ,
> 
> I want to access the value of "host" header at the Back-End in
> servlet-filter , Before Http/2.0 Host information was available in the
> Headers .
> After switching to Http/2 I am able to send the request and receive the
> response but information about the "host" header is not accessible on
> calling request.getHeader("host")  or request.getHeader(":authority") I am
> getting null .
> 
> Is there any standarad API or workaround to get the Host information .

ServletRequest.getServerName()

This works irrespective of the underlying protocol.

Mark

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



Tomcat 9 : How to access Http/2 pseudoHeaders info from Request

2019-01-21 Thread Abhishek kumar srivastava
Hi All ,

I want to access the value of "host" header at the Back-End in
servlet-filter , Before Http/2.0 Host information was available in the
Headers .
After switching to Http/2 I am able to send the request and receive the
response but information about the "host" header is not accessible on
calling request.getHeader("host")  or request.getHeader(":authority") I am
getting null .

Is there any standarad API or workaround to get the Host information .

Tomcat : 9.0.12
java : jdk 8

Thank and Regards :
Rudra