tjg184 / urlrewritefilter

Automatically exported from code.google.com/p/urlrewritefilter
Other
0 stars 0 forks source link

Context forwarding requires contexts to be available on start of .war with filter #153

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Make a simple .war with only one dependency of urlrewritefilter; configure 
rules to forward between different contexts
2. Upload above one .war, with some other that the request is to be forwarded 
to, under Tomcat
3. Try to ask the server for a response

What is the expected output? What do you see instead?

The expectation is that the request is correctly forwarded to provided context 
and sample data correctly returned. It works sometimes but sometimes does not. 
The point is that the filter is validating it's rules against existing 
contexts. Unfortunately it may happen that these contexts are not yet being 
started. But, as far as I know, there is no possibility to guarantee the start 
order of contexts...

What version of the product are you using? On what operating system?
Tomcat 7, windows

Please provide any additional information below.
Maybe the validation can be postponed till first request ? or be configured to 
be disabled ?
Till now we have to redploy the .war file with filter after all contexts have 
been already started...

Original issue reported on code.google.com by michal.a...@schibsted.pl on 5 Dec 2013 at 1:17

GoogleCodeExporter commented 9 years ago
Is this issue fixed? I still see this issue in 4.0.3 build

Original comment by lor...@gmail.com on 3 Jun 2014 at 9:03

GoogleCodeExporter commented 9 years ago
Same behaviour under JBoss EAP 6.4. Context forwarding sometimes happens 
sometimes not, depending on deployment order. Is there any way to work around 
this issue? Can someone give a hint where in the code this validation is taking 
place?

Original comment by Wolfgang...@googlemail.com on 10 Jun 2015 at 12:37

GoogleCodeExporter commented 9 years ago
The workaround that I've applied is to have separate .war containing only rules 
for context forwarding and to ensure while deploying that the one is touched 
(re-deployed) after all apps started

Wysłane z iPhone'a

Dnia 10 cze 2015 o godz. 14:38 urlrewritefilter@googlecode.com napisał(a):

Original comment by michal.a...@schibsted.pl on 22 Jun 2015 at 6:58

GoogleCodeExporter commented 9 years ago
Just to be clear - the .war with rules is the root context (ROOT.war)

Wysłane z iPhone'a

Dnia 10 cze 2015 o godz. 14:38 urlrewritefilter@googlecode.com napisał(a):

Original comment by michal.a...@schibsted.pl on 22 Jun 2015 at 7:16

GoogleCodeExporter commented 9 years ago
re-deployment wasn't easy to do in JBoss EAP, since my EAR file contains > 300 
sub-modules. 
The way I worked around this issue was by subclassing UrlRewriteFilter and 
performing a lazy-init of the filter on first access.

See implementation attached in LazyInitUrlRewriteFilter.java

Original comment by Wolfgang...@googlemail.com on 23 Jun 2015 at 10:18

Attachments: