cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Atherton <>
Subject Re: Deploying Cocoon as a Portlet into Jetspeed 2
Date Tue, 26 Jun 2007 22:22:37 GMT
Thanks for the reminder, Ard. I had intended to summarize those 
instructions once I had my system working and was able to describe the 
steps more generically. Thanks also for posting the link to the other 

To summarize the instructions from that email thread, particularly the 
instructions of Woonsan Ko and dee factorial, to get Cocoon deployed 
into Jetspeed 2 (and displaying the "Hello CocoonPortlet" if you use the 
default build of cocoon), you need to:

1. Run Jetspeed in its servlet container, likely Tomcat if using the 
demo installer version of Jetspeed 2, with sufficient memory to ensure 
your deployed application will run.
2. Explode the cocoon WAR file and remove JAR files that are likely to 
conflict with either Tomcat or Jetspeed. This definitely includes 
portlet-api-1.0.jar, and probably also includes pluto-1.0.1.jar as well.
3. Rebuild the modified cocoon WAR file. This step is important, because 
you need a WAR file to deploy into Jetspeed rather than an exploded version.
4. Modify the default-page.psml as described in my initial post (below).
5. Copy the WAR file into the ${Jetspeed-2.1}/webapps/jetspeed/deploy 
directory. Note that this is not the regular webapps directory where 
Tomcat would ordinarily pick it up, but rather a subdirectory of the 
Jetspeed webapp. The reason it goes there is that Jetspeed does some 
modifications to the deployment descriptors in the WAR file before 
deploying it, so that communication between the Jetspeed webapp and the 
Cocoon webapp can happen.
6. Load http://localhost:8080/jetspeed and scroll to the bottom of the 
portal page. You should see the Cocoon Portlet hello page.

That was phase one of my task. The next phase was to deploy my own 
Cocoon application. That followed the same steps as above, but so far 
has had these added steps (and isn't working yet):

2a) Remove any other JAR files that may prevent deploying into Tomcat 
(my application typically runs in Jetty). This was a long and involved 
2b) Provide a new sitemap that is mounted for a portlet URL-space that 
strips out the <html>, <head>, and <body> tags that the application 
ordinarily generates, leaving just a fragment of HTML that can be 
rendered on the portal page.
2c) Follow some of the instructions defined here to ensure the 
application is portal ready: This is for an 
old version of Cocoon, and is for Pluto rather than Jetspeed, but is 
otherwise pretty good. I have yet to get far enough to see the 
LinkRewriter do its stuff, but I assume it will work when I get there. 
Incidentally, I tried deploying to Pluto directly, but it apparently 
requires that it build your WAR file from scratch using Maven, and also 
requires that your application follow the Maven directory structure, 
which my application does not. There is probably a way around this but 
it wasn't clear from the documentation on the Pluto site, so I went back 
to working with Jetspeed 2.1.
2d) Double check against the instructions provided on JIRA ticket 
COCOON-1998 ( I 
didn't apply the patch because my application should only need one 
servlet path, but if you need it and you don't want to use the tip of 
the 2.1 branch of cocoon, it is there.
2e) Used the information in this blog entry to modify the 
showForm() method for the portlet flowscript. Again, I haven't got 
things to render enough to know whether it worked.

This is enough to render the initial sign on page of my application so 
long as encodeURLTransformer is not part of the pipeline. If it is, I 
get an exception saying that you cannot pass in relative paths, they 
must be absolute. I'll post about that in another message. So far, the 
lack of that transformer has precluded me from logging in and checking 
how the other steps are working.

Ard Schrijvers wrote:
> Hello Bruce,
> I would appreciate it that if you crosspost, and your issue gets solved with the help
of some willing JetSpeed guru's, that you post a mail about the fact that you got it working,
with for example a link to the thread, so that other users which might have the same problems
or are looking for the same thing or are inspired by your idea can see that it is solved and
how it is solved. 
> So, for those interested,
> Regards Ard
>> I am trying to take an existing application running under Cocoon 2.1.9
>> and deploy it as a set of portlets. Before I get that far, though, I
>> want to make sure I understand how to deploy Cocoon as a JSR-168
>> portlet. To that end, I went through the following steps of trying to
>> get Cocoon to work as a portlet inside Jetspeed 2:
>> 1. I built a WAR file of Cocoon 2.1.9 with the portal block (and
>> associated dependencies) included, as well as the samples.
>> 2. I checked that the portlet.xml file contained a definition for
>> CocoonPortlet (as it does out of the box).
>> 3. I deployed the cocoon.war file to the Tomcat instance 
>> running Jetspeed 2
>> 4. I modified
>> ${Jetspeed-2.1}/webapps/jetspeed/WEB-INF/pages/
>> ml to include:
>>     <fragment id="dp-19" type="portlet" name="cocoon::CocoonPortlet">
>>       <property name="row" value="7"/>
>>       <property name="column" value="0"/>
>>     </fragment>
>> 5. I started Jetspeed.
>> 6. I navigated to the Jetspeed default page.
>> Instead of seeing the expected hello world business, I get this error
>> message: "Portlet Application cocoon not available".
>> Have I missed a step here? What am I missing to get a basic build of
>> Cocoon to deploy as a portlet in Jetspeed 2?
>> Thanks for any help.
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message