Grails应用程序在Websphere 6.1上抛出NPE

时间:2012-06-15 19:17:05

标签: grails grails-plugin websphere-6.1

我已将Grails 1.3.7应用程序部署到websphere 6.1.0.25。该应用程序抛出NPE

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

并且它不显示图像。它们似乎有关但不确定。

可能相关的事情:

1-这些是我正在使用的一些相关插件

    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-我根据Grails deployment document设置了Websphere 意思是我已经设定了 “通用JVM参数”到“-Xverify:none”和

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

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

我很感激有关如何调试此问题的任何建议。

这里:是完整的堆栈跟踪:

[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)

我为Resources Plugin添加了这个JIRA here

1 个答案:

答案 0 :(得分:1)

对于版本7.x及更低版本的WAS环境,这是一个问题。

当在WAS(default_host)中未设置静态资源的MIME类型时,通常会出现此异常,因此您看不到图像。如果您要查找视图中缺少的.jpg或.png图像,则必须在服务器中添加相应的MIME类型。 WAS Admin -> Environments -> Virtual Host -> default_host -> MIME Types

此问题在Websphere 7.x中也是持久的。