Weblogic WSRP Keystore
wsrpKeystore.jks found in domain root password:password
Goto myrealm –> Providers –> Credential Mapping –> PKICredentialMapper –> Provider Specific –> you should see details for wsrpKeystore.jks
Now list keystore entires:
$keytool -list -v -keystore DOMAIN_HOME/wsrpKeystore.jks
pasword: password
should list the alias name wsrpconsumer
Goto myrealm –> Credential Mappings –> PKI tab you should see PKI Credential Mappings. Click on wsrpconsumer__81_COMPAT, you will notice it will use alias from above keystore ‘wsrpconsumer’
OpenPortal WSRP: ContainerException
I built few JSR 286 Portlets using OpenPortal container with OpenPortal WSRP Implementation. The portlets were working fine in our DEV enviroment but when moved to QA, whenever the portlet is requested it throws below exception in the logs leaving no clue of what’s happening behind the scenes.
catalina.log
Dec 10, 2010 1:36:56 PM com.sun.portal.portletcontainer.invoker.WindowInvoker getPortletContent WARNING: PSPL_PCCTXCSPPCI0006 com.sun.portal.container.ContainerException: PortletContainer.getMarkup(): javax.servlet.ServletException: Servlet.init() for servlet PortletAppEngineServlet threw exception at com.sun.portal.portletcontainer.impl.PortletContainer.getMarkup(PortletContainer.java:280) at com.sun.portal.portletcontainer.invoker.WindowInvoker.getPortletContent(WindowInvoker.java:378) at com.sun.portal.portletcontainer.invoker.WindowInvoker.render(WindowInvoker.java:252) at com.sun.portal.portletcontainer.driver.PortletContent.getContent(PortletContent.java:71) at com.sun.portal.portletcontainer.driver.DesktopServlet.getPortletContents(DesktopServlet.java:320) at com.sun.portal.portletcontainer.driver.DesktopServlet.getAllPortletContents(DesktopServlet.java:263) at com.sun.portal.portletcontainer.driver.DesktopServlet.doGetPost(DesktopServlet.java:123) at com.sun.portal.portletcontainer.driver.DesktopServlet.doGet(DesktopServlet.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:595) javax.servlet.ServletException: Servlet.init() for servlet PortletAppEngineServlet threw exception at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1180) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:648) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497) at com.sun.portal.portletcontainer.impl.PortletContainer.invokePAE(PortletContainer.java:883) at com.sun.portal.portletcontainer.impl.PortletContainer.invokePAE(PortletContainer.java:734) at com.sun.portal.portletcontainer.impl.PortletContainer.getMarkup(PortletContainer.java:221) at com.sun.portal.portletcontainer.invoker.WindowInvoker.getPortletContent(WindowInvoker.java:378) at com.sun.portal.portletcontainer.invoker.WindowInvoker.render(WindowInvoker.java:252) at com.sun.portal.portletcontainer.driver.PortletContent.getContent(PortletContent.java:71) at com.sun.portal.portletcontainer.driver.DesktopServlet.getPortletContents(DesktopServlet.java:320) at com.sun.portal.portletcontainer.driver.DesktopServlet.getAllPortletContents(DesktopServlet.java:263) at com.sun.portal.portletcontainer.driver.DesktopServlet.doGetPost(DesktopServlet.java:123) at com.sun.portal.portletcontainer.driver.DesktopServlet.doGet(DesktopServlet.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:595)
Our App is hosted on Tomcat 5.5.26 in both QA and DEV environments and it turns out that each of the installation varies in configuration settings in server.xml. This seems to be causing the issue. As shown in below snippet, change unpackWARs=”true” to resolves the issue. Another alternative to making server.xml changes is to deploy the WAR file in exploded format
${TOMCAT_HOME}/conf/server.xml
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> </Host>
Open Portal WSRP: CSS class name collision
We have a Open Portal 2.1.2 Producer running on Tomcat 5.5.26.The producer hosts JSR 286 portlets. The consumer is Weblogic 10.3.2 Portal based.
Issue : On the consumer, the CSS style class collide with styles of other portlets. One solution to prevent this collision is to use unque CSS class names but on consumer side federated portal there is no guarantee that the it does not have the style that producer has.
There is a nice article on SDN (see [3]), discussing the javascript namespace collision, suggests prefixing JavaScript variables and functions with <portlet:namespace/>.This is a great solution but,for an external CSS file, there is no way we can use <portlet:namespace/>. For internal CSS in JSP, we can prefix the CSS class with <portlet:namespace/>_someClass.
Rest of the article explains how this can be achieved for External CSS.
original external css file : sample.css
#_someClass { width:300px; word-spacing:12px; font-size:90%; padding-left:12px; padding-right:10px; white-space:nowrap } : : :
Orginal sample.jsp
<%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@ page import="javax.portlet.*"%> <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%> <portlet:defineObjects /> <%PortletPreferences prefs = renderRequest.getPreferences();%> <link rel="stylesheet" type="text/css" href="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/sample.css")%>"/> <div id="someClass"> <p>some portlet content goes here</p> </div>
Now, the approach is to generate the CSS dynamically by prefixing the namespace for each class. The namespace is passed from the sample.jsp to the dynamic CSS generating page as a request paramter as shown below.
Modified CSS file: sample.css.jsp
<% String namespace = request.getParamter("namespace"); <style type="text/css"> .<%=namespace %>_someClass { width:300px; word-spacing:12px; font-size:90%; padding-left:12px; padding-right:10px; white-space:nowrap } : : : </style>
Modified sample.jsp
<%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@ page import="javax.portlet.*"%> <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%> <portlet:defineObjects /> <%PortletPreferences prefs = renderRequest.getPreferences();%> <%-- removed link tag and added dynamic CSS page using <jsp:include .../>--%> <jsp:include page="/sample.css.jsp"> <jsp:param name="namespace" value="<portlet:namespace/>"/> </jsp:include> <%-- prefix css class with namespace --%> <div id="<portlet:namespace/>_someClass"> <p>some portlet content goes here</p> </div>
This should resolve the namespace collision issue on the consumer.
References
[1]. My original post on this issue at OpenPortal forums