google-code-export / wro4j

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

NPE at at ro.isdc.wro.extensions.http.handler.ModelAsJsonRequestHandler.isEnabled #831

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Here's the logged output:
java.lang.NullPointerException
    at ro.isdc.wro.extensions.http.handler.ModelAsJsonRequestHandler.isEnabled(ModelAsJsonRequestHandler.java:91)
    at ro.isdc.wro.http.handler.LazyRequestHandlerDecorator.isEnabled(LazyRequestHandlerDecorator.java:50)
    at ro.isdc.wro.http.WroFilter.handledWithRequestHandler(WroFilter.java:329)
    at ro.isdc.wro.http.WroFilter.doFilter(WroFilter.java:289)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

I'm attaching the full log, too.

To reproduce this issue, clone https://github.com/wro4j/wro4j-grails-plugin and 
run it. Then hit http://localhost:8080/wro4j-grails-plugin/

This only happens sometimes, it appears to be a race condition in how the 
context is set/injected. I've also seen this stack trace (doing the same 
reproduction steps):

java.lang.NullPointerException
    at ro.isdc.wro.http.handler.ReloadCacheRequestHandler.isEnabled(ReloadCacheRequestHandler.java:66)
    at ro.isdc.wro.http.handler.LazyRequestHandlerDecorator.isEnabled(LazyRequestHandlerDecorator.java:50)
    at ro.isdc.wro.http.WroFilter.handledWithRequestHandler(WroFilter.java:329)
    at ro.isdc.wro.http.WroFilter.doFilter(WroFilter.java:289)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

Note that I don't have resourceWatcherAsync=true or anything exotic.

The page at http://localhost:8080/wro4j-grails-plugin/ just gets the WRO URL 
using wroManager.encodeVersionIntoGroupPath. You can see exactly how that works 
here: 
https://github.com/wro4j/wro4j-grails-plugin/blob/master/grails-app/taglib/wro4j
/grails/plugin/WroTagLib.groovy It doesn't seem exotic, and I believe follows 
the intent of how one should use WRO.

Original issue reported on code.google.com by candrews...@gmail.com on 17 Jan 2014 at 9:33

Attachments:

GoogleCodeExporter commented 9 years ago
Note that this error only occurs with 1.7.3-SNAPSHOT.

I tried repeatedly with 1.7.2, and I cannot get it to happen.

Original comment by candrews...@gmail.com on 17 Jan 2014 at 9:39

GoogleCodeExporter commented 9 years ago
Marking as duplicate of issue822, since it can be reproduced only on 
1.7.3-SNAPSHOT.

Original comment by alex.obj...@gmail.com on 18 Jan 2014 at 4:55