Archive

Archive for the ‘Web Services’ Category

OpenPortal WSRP: ContainerException

December 10, 2010 Leave a comment

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>

wldeploy: versioning of WebServices is not supported

November 18, 2010 1 comment

Following error is thrown when running wldeploy with redeploy flag.


<Nov 18, 2010 9:46:13 AM EST> <Error> <HTTP> <BEA-101355> <[weblogic.webservice.server.servlet.WebServiceServlet@2fe9b2e] Version b1 is specified for WebServices CampaignWS,PropertySetWS, but versioning of WebServices is not supported.> 
<Nov 18, 2010 9:46:13 AM EST> <Error> <HTTP> <BEA-101216> <Servlet: "WebServiceServlet" failed to preload on startup in Web application: "MyProducerEARToolSupport".
javax.servlet.ServletException: [HTTP:101355][weblogic.webservice.server.servlet.WebServiceServlet@2fe9b2e] Version b1 is specified for WebServices CampaignWS,PropertySetWS, but versioning of WebServices is not supported.
        at weblogic.webservice.server.servlet.WebServiceServlet.checkAppVersion(WebServiceServlet.java:173)
        at weblogic.webservice.server.servlet.WebServiceServlet.initLocal(WebServiceServlet.java:113)
        at weblogic.webservice.server.servlet.WebServiceServlet.init(WebServiceServlet.java:97)
        at javax.servlet.GenericServlet.init(GenericServlet.java:241)
        at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
        Truncated. see log file for complete stacktrace
> 
<Nov 18, 2010 9:46:13 AM EST> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application 'MyProducer [Version=b1]'.
weblogic.application.ModuleException: [HTTP:101216]Servlet: "WebServiceServlet" failed to preload on startup in Web application: "MyProducerEARToolSupport".
javax.servlet.ServletException: [HTTP:101355][weblogic.webservice.server.servlet.WebServiceServlet@2fe9b2e] Version b1 is specified for WebServices CampaignWS,PropertySetWS, but versioning of WebServices is not supported.
        at weblogic.webservice.server.servlet.WebServiceServlet.checkAppVersion(WebServiceServlet.java:173)
        at weblogic.webservice.server.servlet.WebServiceServlet.initLocal(WebServiceServlet.java:113)
        at weblogic.webservice.server.servlet.WebServiceServlet.init(WebServiceServlet.java:97)
        at javax.servlet.GenericServlet.init(GenericServlet.java:241)
        at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
        at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
        at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
        at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:531)
        at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1915)
        at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1889)
        at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1807)
        at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3045)
        at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1397)
        at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:460)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
        at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
        at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
        at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
        at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:1267)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
        at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
        at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:54)
        at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
        at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
        at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
        at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
        at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:196)
        at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
        at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
        at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
        at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
        at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
        at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
        at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

        at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1399)
        at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:460)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
        Truncated. see log file for complete stacktrace

Caused By: javax.servlet.ServletException: [HTTP:101355][weblogic.webservice.server.servlet.WebServiceServlet@2fe9b2e] Version b1 is specified for WebServices CampaignWS,PropertySetWS, but versioning of WebServices is not supported.
        at weblogic.webservice.server.servlet.WebServiceServlet.checkAppVersion(WebServiceServlet.java:173)
        at weblogic.webservice.server.servlet.WebServiceServlet.initLocal(WebServiceServlet.java:113)
        at weblogic.webservice.server.servlet.WebServiceServlet.init(WebServiceServlet.java:97)
        at javax.servlet.GenericServlet.init(GenericServlet.java:241)
        at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
        Truncated. see log file for complete stacktrace
> 

As suggested in [1], the solution is to comment out following section in weblogic-application.xml

weblogic-application.xml

<wls:library-ref>
<wls:library-name>wlp-tools-support-app-lib</wls:library-name>
<wls:specification-version>10.3.2</wls:specification-version>
<wls:implementation-version>10.3.2</wls:implementation-version>
</wls:library-ref>

References
[1]. http://kr.forums.oracle.com/forums/thread.jspa?threadID=804617

SSL handshake failure in Weblogic Server

November 15, 2010 Leave a comment

Following error appears on the Weblogic console when consuming a remote resource (for eg. https Webservice) which is SSL enabled. To get rid of the problem, the server certificate needs to be imported by following below instructions


<Nov 15, 2010 3:19:12 PM EST> <Notice> <Security> <BEA-090171> <Loading the identity certificate and private key stored under the alias demoidentity from the jks keystore file /home/vbandaru/bea/10.3.2/user_projects/domains/WSRPProducer_domain/DemoIdentity.jks.>
<Nov 15, 2010 3:19:13 PM EST> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /home/vbandaru/bea/10.3.2/user_projects/domains/WSRPProducer_domain/DemoTrust.jks.>
<Nov 15, 2010 3:20:29 PM EST> <Warning> <Security> <BEA-090477> <Certificate chain received from <hostname> – <ip> was not trusted causing SSL handshake failure.>
<Nov 15, 2010 3:20:29 PM EST> <Warning> <Security> <BEA-090477> <Certificate chain received from <hostname> – <ip> was not trusted causing SSL handshake failure.>
<Nov 15, 2010 3:20:30 PM EST> <Warning> <Security> <BEA-090477> <Certificate chain received from <hostname> – <ip> was not trusted causing SSL handshake failure.>
 

To consume https (secure) webservice, you need to import the Server certificate into Client keystore (either default .keystore or /jre/lib/security/cacerts) . In WebLogic Server/Portal scenario only cacerts works [ Confirm me if I am wrong 🙂 ]

Access the https URL from web browser and EXPORT the certificate to a location with .cer extension or any other extension. Following links would help in exporting the certificate

After this, you should be having a .der or (any extension) file with you. Use the import command below to import the certificate into weblogic keystore.Restart the server to check, if the error is resolved

Import into the keystore
keytool -import -keystore /home/user/jrockit/jre/lib/security/cacerts -alias myCertAlias -file /absolute/path/to/cert/myCert.cer
To delete Certificate
keytool -delete -keystore /home/user/jrockit/jre/lib/security/cacerts  -alias myCertAlias
To list certificate
keytool -list -keystore /home/user/jrockit/jre/lib/security/cacerts

Note: -keystore is to add it to the custom keystore, not the default one. Omitting this option will add the the cert to the default keystore at User home directory.

How to Import SSL Certificates

September 1, 2010 Leave a comment

To consume https (secure) webservice, you need to import the Server certificate into Client keystore (either default .keystore or /jre/lib/security/cacerts) . In WebLogic Server/Portal scenario only cacerts works.

Access the https URL from browser and EXPORT the certificate to a location with .cer extension or any other extension. Following links would help in exporting the certificate

Import into the keystore
keytool -import -keystore /home/user/jrockit/jre/lib/security/cacerts -alias myCertAlias -file myCert.cer
To delete Certificate
keytool -delete -keystore /home/user/jrockit/jre/lib/security/cacerts  -alias myCertAlias
To list certificate
keytool -list -keystore /home/user/jrockit/jre/lib/security/cacerts

Note: -keystore is to add it to the custom keystore, not the default one. Omitting this option will add the the cert to the default keystore at User home directory.