jahaziel17 / wro4j

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

RequestHandler ReadOnlyContext NullPointerException initialization #852

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

we are facing a NullPointerException with the first request proceeded.

As you can see from the logs files, the context in ReloadCacheRequestHandler 
class is null : 
{{{ 
java.lang.NullPointerException
    at ro.isdc.wro.http.handler.ReloadCacheRequestHandler.isEnabled(ReloadCacheRequestHandler.java:57)
}}}

We are using the simple DefaultRequestHandlerFactory.
This problem can also be duplicated with another RequestHandler like 
ReloadModelRequestHandler and we were able to reproduce in debug mode or not.

Finally, to avoid this problem we encapsulated the instatiation like this :
{{{
public class MyRequestHandlerFactory implements RequestHandlerFactory {

    private Collection<RequestHandler> handlers = Collections.emptyList();

    @Override
    public Collection<RequestHandler> create() {
        if (CollectionUtils.isEmpty(handlers)) {
            handlers = new DefaultRequestHandlerFactory().create();
        }
        return handlers;
    }
}
}}}

Original issue reported on code.google.com by vgal...@tennaxia.com on 24 Feb 2014 at 9:14

Attachments:

GoogleCodeExporter commented 8 years ago
What version are you using?

Original comment by alex.obj...@gmail.com on 24 Feb 2014 at 9:16

GoogleCodeExporter commented 8 years ago
Hi, all our configuration is available in the file attached.

It's wro4j 1.7.3

Original comment by vgal...@tennaxia.com on 24 Feb 2014 at 9:17

GoogleCodeExporter commented 8 years ago
Could you try with latest snapshot version (build from branch 1.7.x)? I think 
one of the fixed issues is similar to this one.

Original comment by alex.obj...@gmail.com on 24 Feb 2014 at 9:21

GoogleCodeExporter commented 8 years ago
Thank you for your reactivity.

I will try it and let you know

Original comment by vgal...@tennaxia.com on 24 Feb 2014 at 9:23

GoogleCodeExporter commented 8 years ago
Yes, it fixed the problem. By the way, can you show the similar fixed issues ?
Thank you.

Original comment by vgal...@tennaxia.com on 24 Feb 2014 at 10:18

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
You can see all the issues currently in scope for 1.7.4 release here: 
http://code.google.com/p/wro4j/issues/list?can=1&q=Milestone%3DRelease-1.7.4&col
spec=ID+Type+Status+Priority+Milestone+Owner+Summary&cells=tiles

You can also sort by status to find the fixed issues. I think the simlar issues 
are:
 issue715  and issue830.

Closing this issue as duplicate of one of the above.

Original comment by alex.obj...@gmail.com on 24 Feb 2014 at 10:23