JSF Faces Bridge 在部署到 oc4j 容器时出现 java.lang.NullPointerException
我正在运行 JDeveloper 10.1.3.4 和 webcenter 预配置的 oc4j。 我正在尝试 portletize 一个普通的 JSF Webcenter 项目。
- 我使用 webcenter 应用程序模板创建一个应用程序。
- 添加一个 JSF JSP,简单地将其称为具有所有默认值的索引。
- 添加部署配置文件并部署到本地 oc4j
- 导航到 jsf 页面,一切正常。
- 右键单击 ViewController 并添加库 Portlet Faces Bridge
- 右键单击 ViewController 并添加 Portlet 部署描述符。
使用 链接文本
在 portlet.xml 中,我用我的 /index.jspx 替换默认页面视图
当我尝试部署到本地 oc4j 时,我在 portlet.xml 中得到以下内容
---- 部署开始。 ---- 2009年5月1日 2:29:37 PM 目标平台是 独立 OC4J 10g 10.1.3 (本地应用程序服务器)。 将 WAR 文件写入 C:\jdevstudio10134\jdev\mywork\test\ViewController\deploy\webapp2.war 将 EAR 文件写入 C:\jdevstudio10134\jdev\mywork\test\ViewController\deploy\webapp2.ear 备份通用存档文件 :/C:/jdevstudio10134/jdev/mywork/test/ViewController/deploy/webapp2_generic.ear 为 WSRP 创建 WSDL WSRP 的应用程序 WSDL 应用程序已创建 正在上传文件 webapp2.ear ... 正在上传文件 webapp2.ear ... webapp2 的应用程序部署器 开始。 将存档复制到 C:\jdevstudio10134\j2ee\home\applications\webapp2.ear 初始化 C:\jdevstudio10134\j2ee\home\applications\webapp2.ear 开始...解压 webapp2.ear 完成 解压 webapp2.ear 解压 webapp2.war 完成解压 webapp2.war 初始化 C:\jdevstudio10134\j2ee\home\applications\webapp2.ear 结束...启动应用程序:webapp2 初始化类加载器 应用程序:webapp2 失败 状态 操作失败并出现错误: java.lang.NullPointerException
部署失败已用时间 部署:3秒
部署不完整。 #### 2009 年 5 月 1 日下午 2:29:40
如果我手动部署 WAR 文件并导航到页面,则需要 3 秒,我会收到 500 内部服务器错误。
01/09/05 14:49:21.984 webapp2:Servlet 错误 java.lang.NullPointerException 在 com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346) 在 com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152) 在 oracle.portlet.server.bridges.jsf.PortletViewHandlerImpl.renderView(PortletViewHandlerImpl.java:73) 在 com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107) 在 com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:268) 在 com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137) 在 javax.faces.webapp.FacesServlet.service(FacesServlet.java:214) 在 com.evermind[J2EE 10g 的 Oracle 容器 (10.1.3.4.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher .java:713) 在 com.evermind[J2EE 10g 的 Oracle 容器 (10.1.3.4.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher .java:370) 在 com.evermind[J2EE 10g 的 Oracle 容器 (10.1.3.4.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler .java:871) 在 com.evermind[J2EE 10g 的 Oracle 容器 (10.1.3.4.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler .java:453) 在 com.evermind[J2EE 10g 的 Oracle 容器 (10.1.3.4.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler .java:221) 在 com.evermind[J2EE 10g 的 Oracle 容器 (10.1.3.4.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:122) 在 com.evermind[J2EE 10g 的 Oracle 容器 (10.1.3.4.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:111) 在 oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) 在 com.evermind[J2EE 10g 的 Oracle 容器 (10.1.3.4.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor .java:303) 在 java.lang.Thread.run(Thread.java:595)
我的 portlet.xml 文件看起来像
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<portlet-app version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
<portlet>
<description>myapp</description>
<portlet-name>test</portlet-name>
<display-name>myapp</display-name>
<portlet-class>oracle.portlet.server.bridges.jsf.FacesPortlet
</portlet-class>
<init-param>
<name>DefaultPage.view</name>
<value>/index.jspx</value>
</init-param>
<init-param>
<name>BridgeLifecycleListeners</name>
<value>
oracle.portlet.server.bridges.jsf.adf.ADFFacesBridgeLifecycleListener,
oracle.portlet.server.bridges.jsf.adf.BindingFacesBridgeLifecycleListener
</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>myapp</title>
<short-title>test</short-title>
</portlet-info>
</portlet>
</portlet-app>
...如果我删除该文件并重新部署 jspx 页面工作正常。
I am running JDeveloper 10.1.3.4 with the webcenter pre-configured oc4j.
I'm trying to portletize a vanilla JSF webcenter project.
- I create a application using the webcenter application template.
- Add a JSF JSP, simple called it index with all the default values.
- Add a deployment profile and deploy to local oc4j
- navigate to the jsf page and everything works.
- right click on ViewController and add the library Portlet Faces Bridge
- right click on ViewController and add a Portlet Deployment descriptor.
Edit portlet.xml with the values from link text
in portlet.xml i replace the Default page view with my /index.jspx
when i try to deploy to local oc4j i get the follow
---- Deployment started. ---- May 1, 2009 2:29:37 PM Target platform is
Standalone OC4J 10g 10.1.3
(localAppServer). Wrote WAR file to
C:\jdevstudio10134\jdev\mywork\test\ViewController\deploy\webapp2.war
Wrote EAR file to
C:\jdevstudio10134\jdev\mywork\test\ViewController\deploy\webapp2.ear
Backing up generic archive file
:/C:/jdevstudio10134/jdev/mywork/test/ViewController/deploy/webapp2_generic.ear
Creating WSDLs for the WSRP
Application WSDLs for the WSRP
Application have been created
Uploading file webapp2.ear ...
Uploading file webapp2.ear ...
Application Deployer for webapp2
STARTS. Copy the archive to
C:\jdevstudio10134\j2ee\home\applications\webapp2.ear
Initialize
C:\jdevstudio10134\j2ee\home\applications\webapp2.ear
begins... Unpacking webapp2.ear Done
unpacking webapp2.ear Unpacking
webapp2.war Done unpacking webapp2.war
Initialize
C:\jdevstudio10134\j2ee\home\applications\webapp2.ear
ends... Starting application : webapp2
Initializing ClassLoader(s)
application : webapp2 is in failed
state Operation failed with error:
java.lang.NullPointerExceptionDeployment failed Elapsed time for
deployment: 3 secondsDeployment incomplete. #### May 1, 2009 2:29:40 PM
if i deploy the WAR file by hand and navigate to the page i get 500 internal server error.
09/05/01 14:49:21.984 webapp2: Servlet
error java.lang.NullPointerException
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
at oracle.portlet.server.bridges.jsf.PortletViewHandlerImpl.renderView(PortletViewHandlerImpl.java:73)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:268)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)
].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher
.java:713)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)
].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher
.java:370)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)
].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler
.java:871)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)
].server.http.HttpRequestHandler.processRequest(HttpRequestHandler
.java:453)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)
].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler
.java:221)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)
].server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)
].server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0)
].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor
.java:303)
at java.lang.Thread.run(Thread.java:595)
My portlet.xml file looks like
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<portlet-app version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
<portlet>
<description>myapp</description>
<portlet-name>test</portlet-name>
<display-name>myapp</display-name>
<portlet-class>oracle.portlet.server.bridges.jsf.FacesPortlet
</portlet-class>
<init-param>
<name>DefaultPage.view</name>
<value>/index.jspx</value>
</init-param>
<init-param>
<name>BridgeLifecycleListeners</name>
<value>
oracle.portlet.server.bridges.jsf.adf.ADFFacesBridgeLifecycleListener,
oracle.portlet.server.bridges.jsf.adf.BindingFacesBridgeLifecycleListener
</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>myapp</title>
<short-title>test</short-title>
</portlet-info>
</portlet>
</portlet-app>
...if i delete the file and redeploy the jspx page works fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你应该迁移到 jdev 11g,它使用 wls,它比 oc4j 好得多
you should move to jdev 11g which uses wls which is much better than oc4j