尝试使用 JSF 在 IFrame 中加载 JSP 时的 NPE
我正在尝试将 JSP 加载到 JSF 页面中的 IFrame 中,但我遇到了一个奇怪的 Weblogic 异常,我正在尝试调试:
`####<Nov 15, 2011 1:59:58 PM EST> <Error> <HTTP> <MACHINE_NAME> <node1> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1321383598271> <BEA-101020> <[ServletContext@14841636[app:dist module:/APP_NAME path:/APP_NAME spec-version:2.5]] Servlet failed with Exception
java.lang.NullPointerException 在 jsp_servlet._jsf.报告。_reportlist.jspService(_reportlist.java:149) 在 weblogic.servlet.jsp.JspBase.service(JspBase.java:34) 在 weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) 在 weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) 在 weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300) 在 weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:416) 在 weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:326) 在 weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) 在 weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)` 就
应用程序而言,应用程序中的其他所有内容都运行良好,除了这个似乎来自 Weblogic Server 本身的错误。有其他人看到此错误吗?您的问题的解决方案是什么?
更新
我在 Windows 上运行 Weblogic 11g,并使用 Weblogic 2.0 规范中包含的 JSF jar。
I'm trying to load a JSP into an IFrame in a JSF page, but I'm getting a weird Weblogic Exception that I'm trying to debug:
`####<Nov 15, 2011 1:59:58 PM EST> <Error> <HTTP> <MACHINE_NAME> <node1> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1321383598271> <BEA-101020> <[ServletContext@14841636[app:dist module:/APP_NAME path:/APP_NAME spec-version:2.5]] Servlet failed with Exception
java.lang.NullPointerException
at jsp_servlet._jsf.reports._reportlist.jspService(_reportlist.java:149)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:416)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:326)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)`
Everything else in the app is running great as far as the app is concerned, except for this error which appears to be coming from the Weblogic Server itself. Has any one else seen this error, and what was the resolution to your issue?
UPDATE
I'm running Weblogic 11g on Windows, and using the JSF jar that is included with Weblogic, 2.0 spec I believe.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该错误不是来自 weblogic 本身。它来自您的
reportlist.jsp
。您使用老式的 scriptlet 在该 JSP 文件中而不是在普通(更容易调试/可测试)Java 类中编写 Java 代码。当代码尝试访问某些对象时,该对象为null
。该错误也与 JSF 无关。当您将 iframe 的 URL 直接复制到浏览器的地址栏中时,您会遇到完全相同的问题。
查看Weblogic工作文件夹的
/jsp_servlet/_jsf/_reports
文件夹中的_reportlist.java
文件的第149行,追踪到reportlist的源代码.jsp
文件添加到您的公共 web 内容中并进行相应的修复。That error is not coming from weblogic itself. That is coming from your
reportlist.jsp
. You were using old fashioned scriptlets to write Java code in that JSP file instead of in a normal (and more easy debuggable/testable) Java class. Some object isnull
while the code is trying to access it.That error is also not related to JSF. You would have exactly the same problem when you copy the iframe's URL straight into the browser's address bar.
Look at line 149 of the
_reportlist.java
file in/jsp_servlet/_jsf/_reports
folder of Weblogic's work folder, track this back to the source code of thereportlist.jsp
file in your public webcontent and fix it accordingly.