gpt4 book ai didi

java - ZipInputStream 中的 NullPointerException

转载 作者:太空宇宙 更新时间:2023-11-04 07:33:20 25 4
gpt4 key购买 nike

我有一个 JSF 应用程序(Majorra 2.1.20、PrimeFaces 4.0-SNAPSHOT、OmniFaces 1.4.1,在 Glassfish 3.1.2 上运行),可以在 Firefox、Chrome 中正常运行。仅当在 Internet Explorer 中运行时,我才会收到此错误:

java.lang.NullPointerException: in is null
at java.util.zip.ZipInputStream.<init>(ZipInputStream.java:100)
at java.util.zip.ZipInputStream.<init>(ZipInputStream.java:79)
at com.sun.faces.application.resource.ZipDirectoryEntryScanner.<init>(ZipDirectoryEntryScanner.java:76)
at com.sun.faces.application.resource.ClasspathResourceHelper.findLibraryWithZipDirectoryEntryScan(ClasspathResourceHelper.java:204)
at com.sun.faces.application.resource.ResourceManager.findLibraryOnClasspathWithZipDirectoryEntryScan(ResourceManager.java:409)
at com.sun.faces.application.resource.ResourceManager.doLookup(ResourceManager.java:247)
at com.sun.faces.application.resource.ResourceManager.findResource(ResourceManager.java:197)
at com.sun.faces.application.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:143)
at com.sun.faces.application.resource.ResourceHandlerImpl.createResource(ResourceHandlerImpl.java:123)
at javax.faces.application.ResourceHandlerWrapper.createResource(ResourceHandlerWrapper.java:96)
at javax.faces.application.ResourceHandlerWrapper.createResource(ResourceHandlerWrapper.java:96)
at org.omnifaces.resourcehandler.UnmappedResourceHandler.createResource(UnmappedResourceHandler.java:118)
at com.sun.faces.el.ResourceELResolver.getValue(ResourceELResolver.java:136)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstValue.getValue(AstValue.java:138)
at com.sun.el.parser.AstValue.getValue(AstValue.java:183)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:224)
at com.sun.faces.application.resource.ResourceHelper$ELEvaluatingInputStream.evaluateExpressionIntoBuffer(ResourceHelper.java:791)
at com.sun.faces.application.resource.ResourceHelper$ELEvaluatingInputStream.readExpressionIntoBufferAndEvaluateIntoBuffer(ResourceHelper.java:722)
at com.sun.faces.application.resource.ResourceHelper$ELEvaluatingInputStream.read(ResourceHelper.java:690)
at java.io.InputStream.read(InputStream.java:179)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at java.nio.channels.Channels$ReadableByteChannelImpl.read(Channels.java:385)
at org.omnifaces.util.Utils.stream(Utils.java:215)
at org.omnifaces.resourcehandler.UnmappedResourceHandler.handleResourceRequest(UnmappedResourceHandler.java:196)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:591)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:131)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:328)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)

我迷路了。我似乎无法理解为什么这只发生在 IE 中而不是其他浏览器中。

任何解决此问题的帮助将不胜感激。也非常欢迎帮助理解这一点的解释(您知道的越多!)

更新:

我现在在 Chrome 中也遇到此错误。仍在研究这个问题。

更新 2:

<罢工>我找到了这个问题的根源(不是原因,而是错误的代码)。这在我的 css 表中:

a.map_sms:hover {
background: #3E9945 url("#{resource['templateImages/map:map_sms.png']}")
no-repeat;
}

导致了错误。删除这个就可以解决。升级到 PrimeFaces 4.0 后,此错误开始出现,以前从未出现过。幸运的是,这是我刚刚删除的遗留代码,错误不再出现。

更新3

我认为修复此错误的解决方案绝对不是它。仍然得到它,回到绘图板。

更新 4

看来更新 2 是正确的。发现另一个有问题的CSS。花了很多时间在这里找到这个。仍然不确定错误的原因 - 在升级到 PrimeFaces 4 之前该错误是不存在的。

更新5

在我以为我已经彻底解决了这个问题之后,当在 Eclipse 中我喜欢同时使用 2 个项目(在构建路径上添加第二个项目)时,它又回来了。不确定这是否会指向任何线索。

最佳答案

当您的容器扫描 WEB-INF/lib 文件夹中的 jar 文件时,您似乎遇到了此问题。

ZipDirectoryEntryScanner 是一个 mojarra 类。我建议您获取源代码并在该类中添加一条日志语句以查看哪个文件有问题。

我遇到了类似的问题,就我而言,WEB-INF/lib 文件夹包含另一个名为 logs 的文件夹,该文件夹导致了异常。

关于java - ZipInputStream 中的 NullPointerException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17352544/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com