Closed GoogleCodeExporter closed 9 years ago
Could you provide more details (ideally a quick-start project)?
The dispatcherLocator is annotated with @Inject and is being injected during
instantiation of the ServletContextUriLocator. If it is null, there is probably
a test-case I'm not aware of.
Original comment by alex.obj...@gmail.com
on 28 Feb 2014 at 2:50
I'll see if I can make something up.
The use case is a JSP include inside a CSS file (cssImport preprocessor).
Perhaps that triggers something.
Original comment by martijn....@gmail.com
on 28 Feb 2014 at 3:07
I hacked up a test in my forked repository. You can find it here:
https://github.com/baaym/wro4j/commit/47c339d718a07ba192882013780ab898d78dc074
The test is kind of dirty, as it starts a real jetty context, and I had to
disable jsp/servlet dependencies to avoid conflicts with the jetty dependencies
(*sigh*). Anyway, it should give you an opportunity to see the problem. I'll
give it a shot to fix it too.
Original comment by martijn....@gmail.com
on 2 Mar 2014 at 3:19
Alright, so I did another hack
(https://github.com/baaym/wro4j/commit/8444e373969a68c5a7c705b4c0a347b433f8822b)
. I forced the injection of locators, which fixes the problem.
In my case, the locators come from the DefaultUriLocatorFactory, which in turn
loads all locators from DefaultConfigurableProvider, which holds an instance of
DefaultLocatorProvider;
Now I don't know where to 'neatly' fix this issue, as I'm not familiar with the
codebase. Hopefully someone can point that out to me?
Original comment by martijn....@gmail.com
on 2 Mar 2014 at 4:05
The fix is merged in branch 1.7.x.
Though I like the integration tests using jetty approach, I didn't integrate
your changes because these would require using a different version of
servlet-api which I would like to avoid for now. But I will try to find a
similar approach (using arquillian probably or something else) to use for
integration testing.
Thanks.
Original comment by alex.obj...@gmail.com
on 7 Mar 2014 at 11:24
Thanks for fixing! I didn't have the intention for the jetty tests to make it
back into the main code anyway, as they were quite hacked up just to give you a
use case of the bug. So I'm cool with that ;)
Original comment by martijn....@gmail.com
on 8 Mar 2014 at 8:06
Original issue reported on code.google.com by
martijn....@gmail.com
on 28 Feb 2014 at 2:44