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.NullPointerException
Deployment failed Elapsed time for deployment: 3 seconds
Deployment 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.