문제

I have deployed my Grails 1.3.7 app to websphere 6.1.0.25. The app throws NPE

ERROR webapp.WebApp  - [Servlet Error]-[Filter [DeclaredResourcesPluginFilter]: filter is unavailable.]: java.lang.NullPointerException

and it does not display the images. It seems they are related but not sure.

Things that might be related:

1- These are some of the related plugins I'm using

    runtime ":resources:1.1.6"
    runtime ":zipped-resources:1.0"
    runtime ":cached-resources:1.0"
    compile ":cache-headers:1.1.5"
    compile ":lesscss-resources:1.3.0"

2- I have setup Websphere according to Grails deployment document meaning I have set "Generic JVM arguments" to "-Xverify:none" and

com.ibm.ws.classloader.getInputStream.enableIOException value: true and

com.ibm.ws.webcontainer.invokeFiltersCompatibility value: true

I appreciate any suggestion on how to debug this issue.

Here: is the full stacktrace:

[WebContainer : 0] ERROR webapp.WebApp  - [Servlet Error]-[Filter [DeclaredResourcesPluginFilter]: filter is unavailable.]: java.lang.NullPointerException
    at com.ibm.ws.webcontainer.srt.SRTServletResponse.setContentType(SRTServletResponse.java:1141)
    at sun.reflect.GeneratedMethodAccessor635.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:618)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2395)
    at groovy.lang.ExpandoMetaClass.setProperty(ExpandoMetaClass.java:1129)
    at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3315)
    at org.codehaus.groovy.runtime.InvokerHelper.setProperty(InvokerHelper.java:183)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setProperty(ScriptBytecodeAdapter.java:483)
    at org.grails.plugin.resource.ResourceProcessor.processModernResource(ResourceProcessor.groovy:293)
    at org.grails.plugin.resource.ResourceProcessor$processModernResource.call(Unknown Source)
    at org.grails.plugin.resource.ProcessingFilter.doFilter(ProcessingFilter.groovy:39)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:837)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:747)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:700)
    at com.ibm.ws.wswebcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:115)
    at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:849)
    at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:785)
    at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3507)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:269)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
    at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:122)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)

I added this JIRA for the Resources Plugin here

도움이 되었습니까?

해결책

This is a problem with WAS environment for versions 7.x and below.

This exception is generally seen when MIME types of the static resources are not set in WAS (default_host), hence you do not see the images. If you are looking for the .jpg or .png images which missing in the view then the corresponding MIME types has to be added in the server. WAS Admin -> Environments -> Virtual Host -> default_host -> MIME Types.

This issue is persistent in Websphere 7.x as well.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top