Geronimo 3.0-beta-1: Pluto Portlet Deployment
Behrooz Nobakht <[email protected]> Thu, 29 Dec 2011 10:41:30 +0100
| Newsgroups | gmane.comp.jakarta.pluto.user |
|---|---|
| Message-ID | <CAEEKBgUzJtAuGxFWrasVv+JO==WLsgyJUjXdi0Tb-jZH_S77Gw@mail.gmail.com> |
--14dae9cdc49b06734804b537ed69
Content-Type: text/plain; charset=ISO-8859-1
Hello,
I originally posted the following
message<http://apache-geronimo.328035.n3.nabble.com/Geronimo-3-0-beta-1-Pluto-Portlet-Deployment-td3616167.html>at
Apache Geronimo user mailing list and they suggested posting it here,
too. So, I would be thankful for any idea or help on this.
I am trying to deploy a simple Pluto Portlet into Geronimo 3.0-beta-1:
- I have a simple class extending javax.portlet.GenericPortlet. The
class overrides method doRender or doView for a plain sample.
- The portlet.xml looks like:
<portlet>
<portlet-name>MyPortlet</portlet-name>
<portlet-class>MyPortletClassQualifiedPath</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
</supports>
<portlet-info>
<title>My Portlet</title>
</portlet-info>
</portlet>
- The geronimo-web.xml looks like:
<sys:environment>
<sys:moduleId>
<sys:groupId>my-project-group-id</sys:groupId>
<sys:artifactId>my-project-artifact</sys:artifactId>
<sys:version>1.0-SNAPSHOT</sys:version>
<sys:type>war</sys:type>
</sys:moduleId>
<sys:dependencies>
<sys:dependency>
<sys:groupId>org.apache.portals</sys:groupId>
<sys:artifactId>portlet-api_2.0_spec</sys:artifactId>
<sys:version>1.0</sys:version>
</sys:dependency>
<sys:dependency>
<sys:groupId>org.apache.portals.pluto</sys:groupId>
<sys:artifactId>pluto-container</sys:artifactId>
<sys:version>2.0.1</sys:version>
</sys:dependency>
<sys:dependency>
<sys:groupId>org.apache.portals.pluto</sys:groupId>
<sys:artifactId>pluto-container-api</sys:artifactId>
<sys:version>2.0.1</sys:version>
</sys:dependency>
<sys:dependency>
<sys:groupId>org.apache.portals.pluto</sys:groupId>
<sys:artifactId>pluto-container-driver-api</sys:artifactId>
<sys:version>2.0.1</sys:version>
</sys:dependency>
<sys:dependency>
<sys:groupId>org.apache.portals.pluto</sys:groupId>
<sys:artifactId>pluto-portal-driver</sys:artifactId>
<sys:version>2.0.1</sys:version>
</sys:dependency>
<sys:dependency>
<sys:groupId>org.apache.portals.pluto</sys:groupId>
<sys:artifactId>pluto-portal-driver-impl</sys:artifactId>
<sys:version>2.0.1</sys:version>
</sys:dependency>
<sys:dependency>
<sys:groupId>org.apache.geronimo.plugins</sys:groupId>
<sys:artifactId>pluto-support</sys:artifactId>
</sys:dependency>
<sys:dependency>
<sys:groupId>org.apache.geronimo.plugins</sys:groupId>
<sys:artifactId>geronimo-pluto</sys:artifactId>
<sys:version>3.0-beta-1</sys:version>
</sys:dependency>
</sys:dependencies>
<sys:hidden-classes />
<sys:non-overridable-classes />
</sys:environment>
<context-root>/control</context-root>
- In web.xml, I have:
<servlet>
<servlet-name>MyPortletServlet</servlet-name>
<servlet-class>org.apache.pluto.container.driver.PortletServlet</servlet-class>
<init-param>
<param-name>portlet-name</param-name>
<param-value>MyPortlet</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>MyPortletServlet</servlet-name>
<url-pattern>/PlutoInvoker/p/d</url-pattern>
</servlet-mapping>
- I use Maven geronimo:deploy to deploy the WAR into Geronimo. It
succeeds.
- The MyPortlet#init method is called to just verify that the portlet is
initialized.
- When I issue the address
http://localhost:8080/control/PlutoInvoker/p/dI receive an NPE having
a root cause in that there is not
METHOD_ID attached to the HTTP request attributes.
- I debugged the mixture of Apache Geronimo + Jetty + Pluto and I found
out that based on the life cycle, for each portlet request, the object
DefaultPortletInvokerService should be called in invoke method to
prepare the METHOD_ID and other attributes in the HTTP request. I debugged
this and the method gets called for other portlets in Geronimo. For my
portlet, this does *not* happen.
Can you please tell what I am doing wrongly?
Thanks,
Behrooz
--14dae9cdc49b06734804b537ed69
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hello,<div><br></div><div>I originally posted the following <a href=3D"http=
://apache-geronimo.328035.n3.nabble.com/Geronimo-3-0-beta-1-Pluto-Portlet-D=
eployment-td3616167.html">message</a> at Apache Geronimo user mailing list =
and they suggested posting it here, too. So, I would be thankful for any id=
ea or help on this.<br>
<br><div class=3D"gmail_quote"><div>I am trying to deploy a simple Pluto Po=
rtlet into Geronimo 3.0-beta-1:</div><div><ul><li>I have a simple class ext=
ending=A0<font face=3D"'courier new', monospace">javax.portlet.Gene=
ricPortlet</font><font face=3D"arial, helvetica, sans-serif">. The class ov=
errides method doRender or doView for a plain sample.</font></li>
<li><font face=3D"arial, helvetica, sans-serif">The </font><font face=3D"&#=
39;courier new', monospace">portlet.xml</font><font face=3D"arial, helv=
etica, sans-serif"> looks like:</font></li>
</ul><div><div><font face=3D"'courier new', monospace"><span style=
=3D"white-space:pre-wrap"> </span><portlet></font></div><div><font fa=
ce=3D"'courier new', monospace"><span style=3D"white-space:pre-wrap=
"> </span><portlet-name>MyPortlet</portlet-name></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><portlet-class>MyPortletClassQualifiedPath<=
;/portlet-class></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><supports></font></div><div><font face=3D"=
9;courier new', monospace"><span style=3D"white-space:pre-wrap"> </sp=
an><mime-type>text/html</mime-type></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><portlet-mode>view</portlet-mode></fon=
t></div><div><font face=3D"'courier new', monospace"><span style=3D=
"white-space:pre-wrap"> </span><portlet-mode>edit</portlet-mode&=
gt;</font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><portlet-mode>help</portlet-mode></fon=
t></div><div><font face=3D"'courier new', monospace"><span style=3D=
"white-space:pre-wrap"> </span></supports></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><portlet-info></font></div><div><font face=3D=
"'courier new', monospace"><span style=3D"white-space:pre-wrap"> =
</span><title>My Portlet</title></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span></portlet-info></font></div><div><font face=
=3D"'courier new', monospace"><span style=3D"white-space:pre-wrap">=
</span></portlet></font></div>
<div style=3D"font-family:arial,helvetica,sans-serif"><br></div><div><ul><l=
i><font face=3D"arial, helvetica, sans-serif">The </font><font face=3D"'=
;courier new', monospace">geronimo-web.xml</font><font face=3D"arial, h=
elvetica, sans-serif"> looks like:</font></li>
</ul><div><div><font face=3D"'courier new', monospace"><span style=
=3D"white-space:pre-wrap"> </span><sys:environment></font></div><div>=
<font face=3D"'courier new', monospace"><span style=3D"white-space:=
pre-wrap"> </span><sys:moduleId></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:groupId>my-project-group-id</sys:gro=
upId></font></div><div><font face=3D"'courier new', monospace"><=
span style=3D"white-space:pre-wrap"> </span><sys:artifactId>my-proj=
ect-artifact</sys:artifactId></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:version>1.0-SNAPSHOT</sys:version>=
;</font></div><div><font face=3D"'courier new', monospace"><span st=
yle=3D"white-space:pre-wrap"> </span><sys:type>war</sys:type>=
</font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span></sys:moduleId></font></div><div><font face=
=3D"'courier new', monospace"><span style=3D"white-space:pre-wrap">=
</span><sys:dependencies></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:dependency></font></div><div><font face=
=3D"'courier new', monospace"><span style=3D"white-space:pre-wrap">=
</span><sys:groupId>org.apache.portals</sys:groupId></font>=
</div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:artifactId>portlet-api_2.0_spec</sy=
s:artifactId></font></div><div>
<font face=3D"'courier new', monospace"><span style=3D"white-space:=
pre-wrap"> </span><sys:version>1.0</sys:version></font></div=
><div><font face=3D"'courier new', monospace"><span style=3D"white-=
space:pre-wrap"> </span></sys:dependency></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:dependency></font></div><div><font face=
=3D"'courier new', monospace"><span style=3D"white-space:pre-wrap">=
</span><sys:groupId>org.apache.portals.pluto</sys:groupId><=
/font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:artifactId>pluto-container</sys:art=
ifactId></font></div><div><font face=3D"'courier new', monospace=
"><span style=3D"white-space:pre-wrap"> </span><sys:version>2.0.1&=
lt;/sys:version></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span></sys:dependency></font></div><div><font fac=
e=3D"'courier new', monospace"><span style=3D"white-space:pre-wrap"=
> </span><sys:dependency></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:groupId>org.apache.portals.pluto</s=
ys:groupId></font></div><div>
<font face=3D"'courier new', monospace"><span style=3D"white-space:=
pre-wrap"> </span><sys:artifactId>pluto-container-api</sys:arti=
factId></font></div><div><font face=3D"'courier new', monospace"=
><span style=3D"white-space:pre-wrap"> </span><sys:version>2.0.1&l=
t;/sys:version></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span></sys:dependency></font></div><div><font fac=
e=3D"'courier new', monospace"><span style=3D"white-space:pre-wrap"=
> </span><sys:dependency></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:groupId>org.apache.portals.pluto</s=
ys:groupId></font></div><div>
<font face=3D"'courier new', monospace"><span style=3D"white-space:=
pre-wrap"> </span><sys:artifactId>pluto-container-driver-api</s=
ys:artifactId></font></div><div>
<font face=3D"'courier new', monospace"><span style=3D"white-space:=
pre-wrap"> </span><sys:version>2.0.1</sys:version></font></d=
iv><div><font face=3D"'courier new', monospace"><span style=3D"whit=
e-space:pre-wrap"> </span></sys:dependency></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:dependency></font></div><div><font face=
=3D"'courier new', monospace"><span style=3D"white-space:pre-wrap">=
</span><sys:groupId>org.apache.portals.pluto</sys:groupId><=
/font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:artifactId>pluto-portal-driver</sys=
:artifactId></font></div><div>
<font face=3D"'courier new', monospace"><span style=3D"white-space:=
pre-wrap"> </span><sys:version>2.0.1</sys:version></font></d=
iv><div><font face=3D"'courier new', monospace"><span style=3D"whit=
e-space:pre-wrap"> </span></sys:dependency></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:dependency></font></div><div><font face=
=3D"'courier new', monospace"><span style=3D"white-space:pre-wrap">=
</span><sys:groupId>org.apache.portals.pluto</sys:groupId><=
/font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:artifactId>pluto-portal-driver-impl<=
;/sys:artifactId></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:version>2.0.1</sys:version></fon=
t></div><div><font face=3D"'courier new', monospace"><span style=3D=
"white-space:pre-wrap"> </span></sys:dependency></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:dependency></font></div><div><font face=
=3D"'courier new', monospace"><span style=3D"white-space:pre-wrap">=
</span><sys:groupId>org.apache.geronimo.plugins</sys:groupId&g=
t;</font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:artifactId>pluto-support</sys:artif=
actId></font></div><div><font face=3D"'courier new', monospace">=
<span style=3D"white-space:pre-wrap"> </span></sys:dependency></fon=
t></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <sys:dependency&g=
t;</font></div><div><font face=3D"'courier new', monospace"><span s=
tyle=3D"white-space:pre-wrap"> </span>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 <sys:groupId>org.apache.geronimo.plugins</sys:groupId&=
gt;</font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <=
sys:artifactId>geronimo-pluto</sys:artifactId></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0<sys:version&g=
t;3.0-beta-1</sys:version></font></div><div>
<font face=3D"'courier new', monospace"><span style=3D"white-space:=
pre-wrap"> </span>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </sys:dependency></=
font></div><div><font face=3D"'courier new', monospace"><span style=
=3D"white-space:pre-wrap"> </span></sys:dependencies></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><sys:hidden-classes /></font></div><div><font=
face=3D"'courier new', monospace"><span style=3D"white-space:pre-w=
rap"> </span><sys:non-overridable-classes /></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span></sys:environment></font></div><div><font face=
=3D"'courier new', monospace"><br>
</font></div><div><font face=3D"'courier new', monospace"><span sty=
le=3D"white-space:pre-wrap"> </span><context-root>/control</contex=
t-root></font></div><div><ul>
<li><font face=3D"arial, helvetica, sans-serif">In </font><font face=3D"=
9;courier new', monospace">web.xml</font><font face=3D"arial, helvetica=
, sans-serif">, I have:</font></li>
</ul><div><div><font face=3D"'courier new', monospace"><span style=
=3D"white-space:pre-wrap"> </span><servlet></font></div><div><font fa=
ce=3D"'courier new', monospace"><span style=3D"white-space:pre-wrap=
"> </span><servlet-name>MyPortletServlet</servlet-name></font>=
</div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><servlet-class>org.apache.pluto.container.dri=
ver.PortletServlet</servlet-class></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><init-param></font></div><div><font face=3D"&=
#39;courier new', monospace"><span style=3D"white-space:pre-wrap"> </=
span><param-name>portlet-name</param-name></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><param-value>MyPortlet</param-value></=
font></div><div><font face=3D"'courier new', monospace"><span style=
=3D"white-space:pre-wrap"> </span></init-param></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><load-on-startup>1</load-on-startup></f=
ont></div><div><font face=3D"'courier new', monospace"><span style=
=3D"white-space:pre-wrap"> </span></servlet></font></div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><servlet-mapping></font></div><div><font face=
=3D"'courier new', monospace"><span style=3D"white-space:pre-wrap">=
</span><servlet-name>MyPortletServlet</servlet-name></font></=
div>
<div><font face=3D"'courier new', monospace"><span style=3D"white-s=
pace:pre-wrap"> </span><url-pattern>/PlutoInvoker/p/d</url-patter=
n></font></div><div><font face=3D"'courier new', monospace"><spa=
n style=3D"white-space:pre-wrap"> </span></servlet-mapping></font></d=
iv>
<div style=3D"font-family:arial,helvetica,sans-serif"><br></div><div><ul><l=
i><font face=3D"arial, helvetica, sans-serif">I use Maven </font><font face=
=3D"'courier new', monospace">geronimo:deploy</font><font face=3D"a=
rial, helvetica, sans-serif"> to deploy the WAR into Geronimo. It succeeds.=
</font></li>
<li><font face=3D"arial, helvetica, sans-serif">The </font><font face=3D"&#=
39;courier new', monospace">MyPortlet#init</font><font face=3D"arial, h=
elvetica, sans-serif"> method is called to just verify that the portlet is =
initialized.</font></li>
<li><font face=3D"arial, helvetica, sans-serif">When I issue the address </=
font><font face=3D"'courier new', monospace"><a href=3D"http://loca=
lhost:8080/control/PlutoInvoker/p/d" target=3D"_blank">http://localhost:808=
0/control/PlutoInvoker/p/d</a></font><font face=3D"arial, helvetica, sans-s=
erif"> I receive an NPE having a root cause in that there is not </font><fo=
nt face=3D"'courier new', monospace">METHOD_ID</font><font face=3D"=
arial, helvetica, sans-serif"> attached to the HTTP request attributes.</fo=
nt></li>
<li><font face=3D"arial, helvetica, sans-serif">I debugged the mixture of A=
pache Geronimo + Jetty + Pluto and I found out that based on the life cycle=
, for each portlet request, the object </font><font face=3D"'courier ne=
w', monospace">DefaultPortletInvokerService</font><font face=3D"arial, =
helvetica, sans-serif"> should be called in </font><font face=3D"'couri=
er new', monospace">invoke</font><font face=3D"arial, helvetica, sans-s=
erif"> method to prepare the METHOD_ID and other attributes in the HTTP req=
uest. I debugged this and the method gets called for other portlets in Gero=
nimo.=A0</font><span style=3D"font-family:arial,helvetica,sans-serif">For m=
y portlet, this does <b>not</b> happen.=A0</span></li>
</ul><div><font face=3D"arial, helvetica, sans-serif">Can you please tell w=
hat I am doing wrongly?=A0</font></div></div></div></div><div><font face=3D=
"arial, helvetica, sans-serif"><br>
</font></div><div><font face=3D"arial, helvetica, sans-serif">Thanks,</font=
></div><div><font face=3D"arial, helvetica, sans-serif">Behrooz</font></div=
><div><font face=3D"arial, helvetica, sans-serif"><br>
</font></div><div><font face=3D"arial, helvetica, sans-serif"><br></font></=
div><div style=3D"font-family:arial,helvetica,sans-serif"><br></div></div><=
/div><div><font face=3D"arial, helvetica, sans-serif"><br>
</font></div><div><font face=3D"arial, helvetica, sans-serif"><br></font></=
div><div><font face=3D"arial, helvetica, sans-serif"><br></font></div><div =
style=3D"font-family:arial,helvetica,sans-serif">
<br></div></div></div>
</div><br></div>
--14dae9cdc49b06734804b537ed69--