JSF Faces Bridge get java.lang.NullPointerException when deploying to oc4j container - oracle

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.

you should move to jdev 11g which uses wls which is much better than oc4j

Related

Deploy Spring boot Freemarker application to cpanel Tomcat server

I am trying to deploy Freemarker Spring boot application to cpanel but I didn't manage to do it this is my htaccess file in public_html folder:
SetHandler jakarta-servlet
SetEnv JK_WORKER_NAME ajp13
I upload the war file int public_html folder and create a folder same name as a war file:
this is the log of tomcat:
-Nov-2022 10:10:06.074 INFO [user.host-startStop-6] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/home/user/public_html/platform] has finished in [14] ms
10-Nov-2022 10:24:26.127 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.undeploy Undeploying context [/platform]
10-Nov-2022 10:24:26.134 INFO [user.host-startStop-7] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/home/user/public_html/platform.war]
10-Nov-2022 10:24:26.221 INFO [user.host-startStop-7] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/home/user/public_html/platform.war] has finished in [87] ms
And this is the server.xml file :
<Host name="user.host" appBase="/home/user/public_html" unpackWARs="true"
deployXML="true" autoDeploay="true">
<Alias>www.user.host</Alias>
<Alias>user.host</Alias>
<Context path="" reloadable="true" docBase="/home/user/public_html" debug="1"/>
Where I am wrong how to deploy on cpanel tomcat server and how to access the application.

OpenAM with OpenDJ - NameNotFoundException: ldap/idp/userDN - when starting up JBoss

I'm using OpenAM, with its embedded OpenDJ as the LDAP service, to protect my web application running on JBoss 7.
When I start my JBoss I get this error:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldapUserDN'
...
Caused by: javax.naming.NameNotFoundException: ldap/idp/userDN -- service jboss.naming.context.java.ldap.idp.userDN
So apparently Spring is looking for the JNDI node ldap/idp/userDN. But the jboss configuration file that I got with the project has these entries:
<simple name="ldap/opendj/url" value="ldap://localhost:50389"/>
<simple name="ldap/opendj/userDN" value="cn=Directory Manager"/>
<simple name="ldap/opendj/password" value="mypassword"/>
<simple name="ldap/opendj/baseDN" value="dc=opensso,dc=java,dc=net"/>
And these properties are added to my JNDI tree on JBoss.
If I change these to "ldap/idp/userDN", for instance, then I get rid of the error, but I was wondering if there's anywhere, where "ldap/opendj/userDN" should be mapped to "ldap/idp/userDN", that I've missed.
If you're using Spring LDAP, the actual configuration of the ldap-context-source goes in the a spring config file, and might look like this:
<jee:jndi-lookup jndi-name="ldap/idp/url" id="ldapUrl"/>
<jee:jndi-lookup jndi-name="ldap/idp/userDN" id="ldapUserDN"/>
<jee:jndi-lookup jndi-name="ldap/idp/password" id="ldapPassword"/>
<jee:jndi-lookup jndi-name="ldap/idp/baseDN" id="ldapBaseDN"/>
<ldap:context-source url="#{ldapUrl}"
username="#{ldapUserDN}"
password="#{ldapPassword}"
base="#{ldapBaseDN}"
native-pooling="true"/>
So the jndi entries in your jboss config file should match the ones above.

Class Not Found For MDSBackingStore in OCJ4

I deploy an ear application in ocj4 server.
When i try to access the application, the exception is occured :
500 Internal Server Error
Servlet error: An exception occurred. The current application deployment descriptors do not allow for including it in this response. Please consult the application log for details.
I open the application.log :
12/12/11 13:47:54.76 ViewArchive: Servlet error
java.lang.NoClassDefFoundError: oracle/adf/share/jndi/MDSBackingStore
at oracle.jbo.client.Configuration.loadFromClassPath(Configuration.java:446)
at oracle.jbo.common.ampool.PoolMgr.loadConfiguration(PoolMgr.java:600)
at oracle.jbo.common.ampool.PoolMgr.findPool(PoolMgr.java:526)
at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1513)
at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1490)
at LoginModule.view.utils.LoginValidateDB.checkUserExist(LoginValidateDB.java:24)
at LoginModule.view.utils.LoginValidateServlet.doPost(LoginValidateServlet.java:44)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:734)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:226)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:127)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:116)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
at java.lang.Thread.run(Thread.java:722)
Caused by: oracle.classloader.util.AnnotatedClassNotFoundException:
Missing class: oracle.adf.share.jndi.MDSBackingStore
Dependent class: oracle.jbo.client.Configuration
Loader: JAS.web.ViewArchive:0.0.0
Code-Source: /C:/Users/iswanto/Desktop/oc4j_extended_101350/j2ee/home/applications/JAS/ViewArchive/WEB-INF/lib/adfm.jar
I try to search JAR files that contain MDSBackingStore but not found.
The question is : how can i get that jar ?
Thanks.

Adding Web App to WebSphere Liberty Profile via Eclipse plugin tools

I'm attempting to get an existing web application working with 'WebSphere Application Server Liberty Profile v8.5 Beta' using the 'IBM WebSphere Liberty Profile Tools for Eclipse'.
I have installed the developer tools for Eclipse as well as the liberty profile runtime by following instructions here:
https://www.ibm.com/developerworks/mydeveloperworks/blogs/wasdev/entry/download?lang=en#comment-1321558450546
I then proceed to create the Liberty Profile Server by following the instructions here:
http://publib.boulder.ibm.com/infocenter/wasinfo/beta/index.jsp?topic=%2Fcom.ibm.websphere.w4d.nd.doc%2Ftopics%2Frw4d_dirs.html
I add my web app to the server and start it with the following console output:
Launching TEST (was4d-1.0.0.20111202-0614/websphere-kernel_1.0.0) on Java HotSpot(TM) 64-Bit Server VM, version 1.6.0_26-b03
Boot properties: file:/home/tbuckley/work/WAS/was4d/usr/servers/TEST/bootstrap.properties
Config document: file:/home/tbuckley/work/WAS/was4d/usr/servers/TEST/server.xml
[AUDIT ] CWWKE0001I: The kernel was launched.
[AUDIT ] CWWKE0002I: The kernel started after 0.91
[AUDIT ] CWWKF0007I: A feature update is starting after 0.92 seconds.
[AUDIT ] CWWKZ0058I: Application monitor started after 1.218 seconds.
[AUDIT ] CWWKO0219I: TCP Channel http-default has been started and is now listening for requests on host localhost (IPv4: 127.0.0.1) port 9080.
[AUDIT ] SRVE9998A: Application myWebApp added to web container.
[AUDIT ] CWWKZ0001I: The application myWebApp has started successfully.
[AUDIT ] CWWKF0008I: The feature update is complete after 2.141 seconds.
When I hit the web app url http://localhost:9080/myWebApp/ via a browser I get a blank page and the following console info:
[ERROR ] SRVE0015E: Failure to initialize Web application myWebApp
If I reload the page I get the following:
[WARNING ] SRVE0274W: Error while adding servlet mapping for path-->/login/*, wrapper-->ServletWrapper[Application Servlet:[/login/*]], application-->myWebApp.
[ERROR ] SRVE0015E: Failure to initialize Web application myWebApp
I also have the following servlets/mappings under my web.xml:
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Application Servlet</servlet-name>
<url-pattern>/login/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
Any ideas what could be wrong here or how I could get more detailed debug info?
UPDATE
I just created a skeleton 'dynamic web project' there and put an index.html file in it. I added it to the liberty server and it worked by going to localhost:9080/simpleApp/index.html.
The exisiting dynamic web app I am trying to add is very large and complex.
I found the following under was4d/usr/servers/TEST/logs/ffdc/ffdc_12.02.16_16.40.33.0.log:
------Start of DE processing------ = 16/02/12 16:36:06:170 GMT, key = java.lang.NullPointerException com.ibm.ws.webcontainer.osgi.WebContainer 131
Exception = java.lang.NullPointerException
Source = com.ibm.ws.webcontainer.osgi.WebContainer
probeid = 131
S tack Dump = java.lang.NullPointerException
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:142)
at com.ibm.ws.webcontainer.webapp.WebApp.initializeServletContainerInitializers(WebApp.java:1860)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:499)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:5437)
at com.ibm.ws.webcontainer.osgi.WebContainer.discriminate(WebContainer.java:1095)
at com.ibm.ws.webcontainer.osgi.WebContainer.discriminate(WebContainer.java:1009)
at com.ibm.ws.dispatcher.http.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:143)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:444)
a t com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:378)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:278)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:249)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:174)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:83)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:502)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:550)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:899)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:981)
at com.ibm.ws.threading.internal.Worker.executeWork(Worker.java:398)
at com.ibm.ws.threading.internal.Worker.run(Worker.java:380)
at java.lang.Thread.run(Thread.java:662)
The spring setup in the web app appears to be causing some issue?
Thanks
Turns out it is an issue with Spring on certain platforms (WebSphere liberty 8.5 in my case).
Upgrading from Spring 3.1.0 M2 to Spring 3.1.1 fixes the issue:
https://jira.springsource.org/browse/SPR-8496

Exception when deploying a JSR 286 portlet into WebLogic+WebCenter 11g

I get the following exception when deploying a JSR 286 portlet into Oracle WebLogic Server 11g (to deploy it later in Oracle WebCenter 11g):
<19-ene-2010 13H32' CET> <Error> <oracle.portlet.server.containerimpl.PortletApplicationImpl> <BEA-000000> <Error al procesar el archivo "/WEB-INF/portlet.xml" en la lÝnea 6 columna 68.
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'portlet-app'
The error message is in spanish. It means:
"Error processing the file "/WEB-INF/portlet.xml at line 6 column 68"
The portlet.xml of my portlet seems to be correct and I've deployed it in other portal servers. So I don't understand the error message.
This is the portlet.xml of my portlet (eclipse XML validator said it was a valid XML)
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app version="2.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:dnd="http://www.denodo.com/widget/portlet/portletjsr286">
<portlet>
<description>Test Inter Portlet Communication (JSR286)</description>
<portlet-name>Test IPC</portlet-name>
<display-name>Test IPC</display-name>
<portlet-class>com.denodo.ipc.TestIPCPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<resource-bundle>PortletMessages</resource-bundle>
<portlet-info>
<title>Test IPC</title>
<short-title>Test IPC</short-title>
<keywords>Test IPC,Denodo</keywords>
</portlet-info>
</portlet>
</portlet-app>
How do I deploy my portlet
I convert my portlet into to a WSRP portlet by executing
java -jar wsrp-predeploy.jar source EAR target EAR
as explained in http://download.oracle.com/docs/cd/E12839_01/webcenter.1111/e12405/wcadm_portlet_prod.htm#CHDECJHI)
I try to deploy it into WebLogic with the WebLogic Console and I get this exception.
My Environment
WebCenter Suite (11.1.1.2.0) + WebLogic Server (10.3.2) downloaded from the oracle.com. Default configuration
S.O: Windows XP SP3
Thanks in advance for your time.
Have you tried using the openPortal portlet-container? The doc says it will install onto weblogic: https://portlet-container.dev.java.net/public/Download.html
Update: I just installed the portlet-container into the weblogic container and successfully deployed one of the sample portlets from this page: \http://portlet-container.dev.java.net/public/Samples.html

Resources