Hi,

Well I am stuck. I sure hope that someone on here can help.

I thought I was almost on the home stretch for a minute there, but it
appears I was very sadly mistaken. This has been a very frustrating
experience so far. Of course this is mostly due to lack of
documentation. Some of the higher-level articles on places on
server-side.com etc gave great overviews, but I don't seem to be able
translate this to the a working embedded portlet container. 
What is actually required to get just the portlet tags working outside
of the portal installation!?. I just don't see the functional connection
between all the pieces - of course the theory is trivial. (i.e. base
portlet container -> portal driver == implementations of interfaces ->
pluto portal 

Not sure if my experiences mirrors the path of any other "portlet
explorers", but I would appreciate ANY help anyone might give. I imagine
that the results might even form some sort of "getting started" guide
for 1.1 beta. Anyways, this is the mess I am currently in...

WHAT I AM TRYING TO ACHIEVE:
I want to embed portlets into my jsp pages. I have a web app that should
render JSR-168 portlets by calling the <pluto:portlet> tag. I am
assuming this is not a completely stupid idea and not actually
possible?? :)

WHAT I HAVE SO FAR:
I have added the listener "PortalStartupListener" and the servlet
"PortalDriverServlet". I have added the spring beans xml and the portal
config xml also, with values I think are appropriate. I have built Pluto
from scratch (in both eclipse and from maven) and even have made patches
to the code to make it work(?) with Spring 2.0M3.
I have deployed the full pluto package to my tomcat 5.5 installation and
have tested the portlets in question with the default pluto portal.
Everything runs fine UNTIL I attempt to use my own, pluto-embedded
webapp.

My current understanding about each of these classes is:

PortalStartupListener:
Sets up the portlet container and adds a bunch of things (e.g.
portletConfig) to the application context. 
I am using spring 2.0M3. Of course when I tried to install the listener
it gave an InputStream IllegalStateException because the resource was
being read twice and this is not allowed in 2.0. The accepted fix is to
use the ServletContextResource instead and once I had changed the source
code, the listener now appears to work. (PS: spring is not the problem,
it fails when I use the old one also...)

PortletTag: 
Takes properties from the app and page context, locates and then renders
the portlet. 
My second hurdle was that, for some reason, there was no
PortletEnvironment object added to the page context. I added this
manually by simply constructing it in the jsp page. (quite the hack)
Still does not work - details below. I think perhaps the fact I had to
do this is a warning sign.

PortalDriverServlet: 
This servlet is an alternative to the portlet tag or possibly used for
something else. I have installed it anyways for good measure.

I have listed various config details at the end of the mail...

WHAT IS GOING WRONG at the moment:
When I use the pluto:portlet tag by itself, nothing happens. I used to
get a variety of errors before I configured a few things, but now
nothing.

When I throw in the pluto:render tag I get:
org.apache.pluto.PortletContainerRuntimeException:
error.config.context.null
at
org.apache.pluto.internal.impl.PortletWindowImpl.(PortletWindowImpl.java
:74)
at
org.apache.pluto.core.PortletContainerImpl.doRender(PortletContainerImpl
.java:148)
at
org.apache.pluto.driver.tags.PortletTag.doStartTag(PortletTag.java:138)
...

This apparently means that the the ServletContext has been set to
null...

But, for no apparently reason it has changed to something else while
writing this email and tweaking a few things...
java.lang.NullPointerException
at
org.apache.pluto.driver.core.PortletWindowImpl.getContextPath(PortletWin
dowImpl.java:60)
at
org.apache.pluto.internal.impl.PortletWindowImpl.(PortletWindowImpl.java
:71)
at
org.apache.pluto.core.PortletContainerImpl.doRender(PortletContainerImpl
.java:147)
at
org.apache.pluto.driver.tags.PortletTag.doStartTag(PortletTag.java:138)

I have now tried removing all my own custom-built libraries and 2.0
spring and replacing them with the same ones that the working pluto
webapp has. Exactly the same problem.
If I try to run the portal directly (via my mapped PortalDriverServlet -
/mywebapp/portal/), same problem.


I am really not sure what is going on here, anyone have an idea???

Shane

PS: Config stuff to help
=============JSP tag================
<pluto:portlet portletId="TenderNotices.TenderNotices" >
        <pluto:render  />
</pluto:portlet>
========================
<pluto-portal-driver
 
xmlns="http://portals.apache.org/pluto/xsd/pluto-portal-driver-config.xs
d"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 
xsi:schemaLocation="http://portals.apache.org/pluto/xsd/pluto-portal-dri
ver-config.xsd
 
http://portals.apache.org/pluto/xsd/pluto-portal-driver-config.xsd";
    version="1.1">

  <portal-name>pluto-portal-driver</portal-name>
  <portal-version>1.1.0-ALPHA</portal-version>
  <container-name>Pluto Portal Driver</container-name>

  <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
      <portlet-mode>EDIT</portlet-mode>
      <portlet-mode>HELP</portlet-mode>

    <window-state>normal</window-state>
    <window-state>maximized</window-state>
    <window-state>minimized</window-state>
  </supports>
  
  <portlet-app>
    <context-path>/TenderNotices</context-path>
    <portlets>
      <portlet name="TenderNotices"/>
    </portlets>
  </portlet-app>

  
  <!-- Render configuration which defines the portal pages. -->
  <render-config default="TestPage">
    <page name="TestPage"
uri="/WEB-INF/jsp/supplier/staticContent/Supplier_myprofile.jsp?">
      <portlet context="/TenderNotices" name="TenderNotices"/>
    </page>
  </render-config>
  
</pluto-portal-driver>
================WEB.xml excerpts=================
        <servlet>
                <description>Pluto Portal Driver
Controller</description>
        <display-name>Pluto Portal Driver</display-name>
        <servlet-name>plutoPortalDriver</servlet-name>          
 
<servlet-class>org.apache.pluto.driver.PortalDriverServlet</servlet-clas
s>
        </servlet>
  <servlet>
                <description>Portlet Application Publisher
Service</description>
        <display-name>Portlet Application Publisher</display-name>
        <servlet-name>portletApplicationPublisher</servlet-name>
 
<servlet-class>org.apache.pluto.driver.PublishServlet</servlet-class>
        </servlet>
<!--*****************SERVLET MAPPINGS**************************   -->
        <servlet-mapping>
        <servlet-name>plutoPortalDriver</servlet-name>
        <url-pattern>/portal/*</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
        <servlet-name>portletApplicationPublisher</servlet-name>
        <url-pattern>/admin/Publish</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
        <listener>
 
<listener-class>org.apache.pluto.driver.PortalStartupListener</listener-
class>
        </listener>
=================tendernotices portlet mapping - works on normal
pluto==================
<web-app>
        <display-name>Tender Notices</display-name>
        <description>View Tenders Notices</description>
        <servlet>
                <servlet-name>TenderNotices</servlet-name>
        
<servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
                <init-param>
                        <param-name>portlet-name</param-name>
                        <param-value>TenderNotices</param-value>
                </init-param>
                <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>  
                <servlet-name>TenderNotices</servlet-name>
                <url-pattern>/PlutoInvoker/TenderNotices</url-pattern>
        </servlet-mapping>
</web-app>
===============excerpt==================
        <portlet>
        <description>View Tenders Notices</description>
        <portlet-name>TenderNotices</portlet-name>
        <display-name>Tender Notices</display-name>

 
<portlet-class>com.conexa.portlets.tendernotices.TenderNotices</portlet-
class>

Reply via email to