Re: SEVERE: A child container failed during start

2019-11-30 Thread Karen Goh



Sent from Yahoo Mail for iPhone


On Saturday, November 30, 2019, 8:09 PM, M. Manna  wrote:

Karen,

On Sat, 30 Nov 2019 at 00:58, Karen Goh 
wrote:

>
>
>
> Sent from Yahoo Mail for iPhone
>
>
> On Saturday, November 30, 2019, 6:18 AM, Mark Thomas 
> wrote:
>
> On 29/11/2019 21:28, Karen Goh wrote:
> > I have done so but it is no use. I have deleted the Tomcat and add an
> new instance before run the server again.
> > caused by java.lang.IllegalArgumentException : Filter mapping specifies
> an unknown filter name[SessionValidator]
> > Sorry I am having problem with writing here using Yahoo mail n I have to
> type things out in iPhone so I can’t copy n paste the entire error
> message. Should you need more info in order to help me I hope I can just
> write above the reply message.
>
> You seem to be missing the point. The problematic filter is named:
>
> httpHeaderSecurity
>
> You need to find where that is referenced in your code and/or
> configuration.
> I can’t find this filter at all, even though I am playing with something
> along the line of httpHeaderSecurity (JWT/JSSE etc to be precise) but my
> project is done intermittently cos most of the time I am meshing up the
> code from various sources and use it...
> What do I do in this case?  Re-start a fresh project?
>
> Mark
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
>
>
>
As I replied before, your best option would be:

1) remove all your custom filters from filter mappings so that there is no
filter (only for this test).
2) Start tomcat and confirm that startup is normal without issues
3) Now put back your filters 1-by-1 and repeat step 1-2 to see what breaks.

It's appears a big effort at first glance, but it's a good way to sift
through the problem.
Hi Manna,
Thanks very much for your response.
After I changed the tomcat server to 9.0.29, all the error disappeared. I have 
also changed the servlet api to 4.0.1 in maven n added the @WebFilter without 
incurring any error.
Once again, thank you. 

Thanks,




Re: Double Slash Support in Tomcat 9.0.27

2019-11-30 Thread Kushagra Bindal
Hi Manna/Mark,

Below are the sample URL which we are passing to Tomcat.

http://backend_tomcat:8080//sdm/restcall)(.*)/file_uploads
http://backend_tomcat:8080/sdm/restcall/v1/platform//healthCheck

As from the above example you can see that // location may vary case by
case.

So, you guys have a probable solution to handle such situation, then please
do let me know.

Looking forward to hearing from you.

Regards
Kushagra

On Fri, Nov 29, 2019 at 6:23 PM M. Manna  wrote:

> Kushagra,
>
> On Fri, 29 Nov 2019 at 12:29, Kushagra Bindal 
> wrote:
>
> > Hi Mark,
> >
> > This astrik is because I highlighted it as BOLD. But I guess at your end
> it
> > is being received as plain text. Resending the content in context.xml
> >
> > 
> >
> > 
> > 
> > WEB-INF/web.xml
> > WEB-INF/tomcat-web.xml
> > ${catalina.base}/conf/web.xml
> >
> >  > type="javax.sql.DataSource"/>
> >
> >  > className="org.apache.tomcat.util.http.LegacyCookieProcessor" />
> >
> > 
> > 
> >
> > 
> > 
> > 
> >
> >
> >
> > On Fri, Nov 29, 2019 at 5:52 PM M. Manna  wrote:
> >
> > > Hi
> > >
> > > On Fri, 29 Nov 2019 at 11:43, Kushagra Bindal <
> bindal.kusha...@gmail.com
> > >
> > > wrote:
> > >
> > > > Hi Mark,
> > > >
> > > > We tried to put the changes as suggested by you. Below are the
> changes
> > > that
> > > > we have made in context.xml file.
> > > >
> > > > 
> > >
> > >
> > > Why this asterisk? *
> > >
> > > >
> > > >
> > > > 
> > > > 
> > > > WEB-INF/web.xml
> > > > WEB-INF/tomcat-web.xml
> > > > ${catalina.base}/conf/web.xml
> > > >
> > > >  global="jdbc/edbDataSource"
> > > > type="javax.sql.DataSource"/>
> > > >
> > > >  > > > className="org.apache.tomcat.util.http.LegacyCookieProcessor" />
> > > >
> > > > 
> > > > 
> > > >
> > > > 
> > > > 
> > > > 
> > > >
> > > > But after restart still I am getting below errors in tomcat's
> > > > *localhost_access_log.2019-11-29.txt* file.
> > > >
> > > > 172.18.0.3 - - [29/Nov/2019:11:27:45 +] "GET
> > > > /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> > > > 172.18.0.3 - - [29/Nov/2019:11:27:45 +] "GET
> > > > /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> > > > 172.18.0.3 - - [29/Nov/2019:11:27:46 +] "GET
> > > > /sdm/restcall/v1/platform//healthCheck HTTP/1.0" 404 -
> > > >
> > > > Please help me in correcting the syntax.
> > > >
> > > > Regards
> > > > Kushagra
> > > >
> > > > On Fri, Nov 29, 2019 at 4:02 PM Kushagra Bindal <
> > > bindal.kusha...@gmail.com
> > > > >
> > > > wrote:
> > > >
> > > > > Hi Mark,
> > > > >
> > > > > Thanks for providing the response.
> > > > >
> > > > > Yes, you are right that we should design our application to remove
> //
> > > > from
> > > > > being used.
> > > > >
> > > > > I will plan it accordingly, for the provided solution in below. Let
> > me
> > > > try
> > > > > the same and I will revert back to you in case of any further
> queries
> > > and
> > > > > concerns.
> > > > >
> > > > > On Fri, Nov 29, 2019 at 2:56 PM M. Manna 
> wrote:
> > > > >
> > > > >> HI,
> > > > >>
> > > > >>
> > > > >> On Fri, 29 Nov 2019 at 09:00, Kushagra Bindal <
> > > > bindal.kusha...@gmail.com>
> > > > >> wrote:
> > > > >>
> > > > >> > Hi,
> > > > >> >
> > > > >> > We are working on upgrading our enterprise application from
> 8.5.24
> > > to
> > > > >> > 9.0.27 version.
> > > > >> >
> > > > >> > What we have observed that in earlier version i.e. 8.5.24 we
> were
> > > able
> > > > >> to
> > > > >> > process process a REST URI have  double slash ("//") in it.
> > > > >> >
> > > > >> > But when we are upgrading it to 9.0.27 we found that now the
> same
> > > url
> > > > >> which
> > > > >> > was working earlier it is now throwing 404 status code.
> > > > >> >
> > > > >> > Now, the problem is that we can not remove these double slash
> (//)
> > > > >> manually
> > > > >> > as it is used widely.
> > > > >> >
> > > > >> > So, can someone please provide a possible solution of this
> issue?
> > > > >> >
> > > > >>
> > > > >>  Tomcat processes HTTP query and URL using RFC 7230 standards. But
> > > > >> multiple
> > > > >> leading forward slash support was disabled by default for good
> > > reasons.
> > > > >> This was done in 8.5.31 due to issues with Http Redirects
> involving
> > > > >> Servlets.
> > > > >>
> > > > >> If you must use this, you have to modify your application context
> to
> > > add
> > > > >> the override as true - the attribute is called
> > > > >> "allowMultipleLeadingForwardSlashInPath".
> > > > >>
> > > > >> https://tomcat.apache.org/tomcat-8.5-doc/config/context.html
> > > > >>
> > > > >> But I would sincerely recommend that you work on such designs and
> > > > correct
> > > > >> them in your application. There is always a "way". This is one of
> > the
> > > > >> reasons web applications become obsolete requires huge
> maintenance.
> > > > >>
> > > > >> Thanks,
> > > > >>
> > > > >> >
> > > > >> > --
> > > > >> > Regards,
> > > > >> > Kushagra 

Async file upload server has 33% less throughput compared to the sync version

2019-11-30 Thread Behrang Saeedzadeh
Source code with Gatling tests here (WIP):
https://github.com/turingg/file-server

I wanted to compare the performance/throughput of an async file upload
servlet to a sync version. To do that, I intentionally configured Tomcat to:

* Use at most 2 HTTP connector threads
* Accept up to 1000 connections
* With a queue length of 0



However despite that, my async servlet (
https://github.com/turingg/file-server/blob/master/src/main/java/xyz/behrang/fileserver/b/AsyncUploadServlet.java)
has 33% less throughput compared to the sync version ((
https://github.com/turingg/file-server/blob/master/src/main/java/xyz/behrang/fileserver/a/SyncUploadServlet.java
):

# Async

 Global Information

> request count   5000 (OK=5000   KO=0
)
> min response time218 (OK=218KO=-
)
> max response time   2234 (OK=2234   KO=-
)
> mean response time   674 (OK=674KO=-
)
> std deviation486 (OK=486KO=-
)
> response time 50th percentile464 (OK=464KO=-
)
> response time 75th percentile773 (OK=772KO=-
)
> response time 95th percentile   1890 (OK=1891   KO=-
)
> response time 99th percentile   2142 (OK=2142   KO=-
)
*> mean requests/sec555.556 (OK=555.556
KO=- )*
 Response Time Distribution

> t < 800 ms  3780 ( 76%)
> 800 ms < t < 1200 ms 525 ( 11%)
> t > 1200 ms  695 ( 14%)
> failed 0 (  0%)


# Sync


 Global Information

> request count   5000 (OK=5000   KO=0
)
> min response time  1 (OK=1  KO=-
)
> max response time   1617 (OK=1617   KO=-
)
> mean response time   207 (OK=207KO=-
)
> std deviation333 (OK=333KO=-
)
> response time 50th percentile 36 (OK=36 KO=-
)
> response time 75th percentile150 (OK=150KO=-
)
> response time 95th percentile992 (OK=992KO=-
)
> response time 99th percentile   1312 (OK=1312   KO=-
)
*> mean requests/sec833.333 (OK=833.333
KO=- )*
 Response Time Distribution

> t < 800 ms  4458 ( 89%)
> 800 ms < t < 1200 ms 479 ( 10%)
> t > 1200 ms   63 (  1%)
> failed 0 (  0%)


Any ideas what am I missing here?

Thanks in advance,
Behrang


Re: SEVERE: A child container failed during start

2019-11-30 Thread M. Manna
Karen,

On Sat, 30 Nov 2019 at 00:58, Karen Goh 
wrote:

>
>
>
> Sent from Yahoo Mail for iPhone
>
>
> On Saturday, November 30, 2019, 6:18 AM, Mark Thomas 
> wrote:
>
> On 29/11/2019 21:28, Karen Goh wrote:
> > I have done so but it is no use. I have deleted the Tomcat and add an
> new instance before run the server again.
> > caused by java.lang.IllegalArgumentException : Filter mapping specifies
> an unknown filter name[SessionValidator]
> > Sorry I am having problem with writing here using Yahoo mail n I have to
> type things out in iPhone so I can’t copy n paste the entire error
> message. Should you need more info in order to help me I hope I can just
> write above the reply message.
>
> You seem to be missing the point. The problematic filter is named:
>
> httpHeaderSecurity
>
> You need to find where that is referenced in your code and/or
> configuration.
> I can’t find this filter at all, even though I am playing with something
> along the line of httpHeaderSecurity (JWT/JSSE etc to be precise) but my
> project is done intermittently cos most of the time I am meshing up the
> code from various sources and use it...
> What do I do in this case?  Re-start a fresh project?
>
> Mark
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
>
>
>
As I replied before, your best option would be:

1) remove all your custom filters from filter mappings so that there is no
filter (only for this test).
2) Start tomcat and confirm that startup is normal without issues
3) Now put back your filters 1-by-1 and repeat step 1-2 to see what breaks.

It's appears a big effort at first glance, but it's a good way to sift
through the problem.

Thanks,