pvdung / urlrewritefilter

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

urlrewrite.xml cannot be found by filter class and through static ClassLoader #125

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Use filter in web.xml 
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
 and deploy by Eclipse WST on Tomcat. The ERROR is shown in log that file/resource hasn't been found. Changing 'configPath' or default configuration with '/WEB-INF/urlrewrite.xml' don't work, both cases. URLs are not rewrited.

What is the expected output? What do you see instead?
URLs are rewrited due to the rules.

What version of the product are you using? On what operating system?
4.0.4

Please provide any additional information below.
Tested on Oracle Java 7 and Tomcat 6
It seams to be a wrong ClassLoader that cannot find the resource. I try to make 
a simple test to use different way of getting ClassLoader and it works. So I 
used getClass().getClassLoader() to find the real class loader, that knows the 
application instead of a ClassLoader given by a static way that possibly could 
be a parent classloader (is there a better explanation?).

I attached the simple example, that override the filter class and it works if 
it used as servlet filter.

Original issue reported on code.google.com by martin.s...@etnetera.cz on 25 Nov 2012 at 1:20

Attachments: