Wednesday, February 06, 2008

Guide To Setup A Running WSRP4J - Producer and Consumer

A simple test page with the consumer a portlet in jetspeed 2.1 (Tomcat console above port 8081) and the producer in pluto 1.0.1 release (tomcat console beloew port 8080)

I. Introduction

WSRP is an open standard proposed by OASIS for several years. The spec now is sponsored by a number of
big names like IBM and BEA. There are currently two active implementation of the spec. One is wsrp4j from
Apache foundation (still a incubator project, been developed since 2002). The other one is a subproject of Open-Portal.

I have been exposed and done lot of development on the Apache's wsrp4j project. Thus, in this guide I will
mainly discuss wsrp4j implementation.

At this point, wsrp4j project is still under heavy development and re-construction. It is almost impossible
to get the trunk snapshot in the project repository and make it work without pulling all your hair out to figure
out how to set it up properly. This mostly caused by the lack of documentation and support from its developers.

Still, there is a stable (enough) revision which we can use to make a perfect wsrp4j environment.
The wsrp4j revison I use here is 440430 along with pluto portal 1.0.1 release for setting up a producer.
Jetspeed 2.1 (latest version currently) will be used as a container for wsrp4j consumer (wsrp4j-proxyportlet).
Of course, you can use pluto to setup wsrp4j consumer as well. But that is very easy to do.
Plus, pluto portal doesn't provide a lot of bell and whistle in the GUI side as Jetspeed portal does.

II. Weapons Needed

- JDK 5
- maven 2.1 for bulding wsrp4j revison 440430
- maven 1.0.2 for bulding pluto 1.0.1
- Tomcat 5 (hosting the wsrp producer)
- Jetspeed 2.1 (hosting the wsrp consumer)

III. The Battle

1. Setting up Pluto 1.0.1

Download the source version of Pluto 1.0.1
Unzip/tar the file and change the to
Edit the file to make sure the path to Tomcat is correct
Maven 1.0.2 is used to build this copy of Pluto so set your MAVEN_HOME accordingly
run 'maven fullDeployment' to build the project.
Once this finish, start your tomcat and point browser to
http://localhost:8080/pluto/portal to test

Shutdown Tomcat before deploying WSRP4J.


2. Obtaining WSRP4J From SVN 440430

Get wsrp4j source in subversion
svn -r 440430 co

This version of WSRP4J is built using Maven 2, in our case Maven 2.0.4 was used.

After checking out the source code from Subversion, only a few modifications are needed in order for this version to work correctly.

Enter the source code’s root directory and edit the file to include the location of Tomcat:

Then rename this file to

Issue this command to compile WSRP4J:
mvn install

This command will compile and package the consumers and producer as WAR archives.


3. Deploying and Fixing WSRP4J 440430 Producer

The WSRP Test Portlet is located at
this can be deployed via Pluto’s admin interface.

To deploy the producer, copy
producer/target/wsrp4j-producer.war to $TOMCAT/webapps

Only a few fixes need to be implemented in this version of WSRP4J:

There is a missing XML, file copy

This will enable crossContext for the WSRP4J producer. If this is not done the logs show an error
Unable to find dispatcher for context wsrp4j producer

There is also a jar file that needs removing
This causes an exception about a class not being found org.exolab.castor.mapping.Mapping....
Leave the pluto-portal-1.0.1.jar alone.

From the installed version of wsrp, located in


This file needs editing to match the running environment:

* $TOMCAT/webapps/wsrp4j-producer/wsdl/wsrp_service.wsdl needs to have the correct host and port numbers.

!!!Important: Also copy the from the wsrp4j-proxyportlet/WEB-INF to the wsrp4j-producer/WEB-INF


4. Setup a test Portlet in the Producer:

Edit $TOMCAT/webapps/wsrp4j-producer/WEB-INF/data/portletentityregistry.xml
This will add the wsrp4j-testportlet to the producer
<application id="0">
<portlet id="1">

definition-id (for Application) = portlet_WebApp_Dir
definition-id (for portlet) = portlet_name in the portlet application
You can find the portlet name in the portlet.xml file in the portlet application.


Extra step: Do this step if you want to test the producer using the consumer inside pluto

Deploy the wsrp4j-proxyportlet.war using the pluto deployment admin interface.

Edit the
The file name can be different. But it alwaays ends with ProducerImp****
Change the port number to match your producer listen port. It is 8080 if you follow this guide from the beginning.

Create a file in TOMCAT/conf/Catalina/localhost/wsrp4j-proxyportlet.xml
This is the content:

<context path="/WSRP4JResourceProxy" docbase="wsrp4j-proxyportlet" crosscontext="true">

Edit $TOMCAT/webapps/pluto/WEB-INF/data/portletentityregistry.xml
Locate the application id for wsrp4j-proxyportlet you deployed earlier. And modify it so that it look similar to this

<application id="7">
<portlet id="0">

There are two important parameters:
The producer id: this is what you get from the file

The portlet handle: this is what you get from the file
$TOMCAT/webapps/wsrp4j-producer/WEB-INF/data/portletentityregistry.xml with
application id is 0 and portlet handle is 1. Hence it's 0.1!!!

One last thing, to display the remote portlet on pluto:
Location the wsrp4j-proxyportlet fragment and make it similar to this

<fragment name="wsrp4j-proxyportlet" type="page">
<fragment name="row1" type="row">
<fragment name="col1" type="column">
<fragment name="p1" type="portlet">
<property name="portlet" value="7.0">
</fragment><!-- end of portlet frag -->
</fragment><!-- end of col frag -->
</fragment><!-- end of row frag -->
</fragment><!-- end of 'page' frag -->

Pay attention to the line
in which 7.0 is what you get from
$TOMCAT/webapps/pluto/WEB-INF/data/portletentityregistry.xml edited earlier above.
Again, application = 7 and portlet = 0. Hence, it's 7.0!!!

Att his point , start TOMCAT and go to
Click on wsrp4j-proxyportlet link. You should be able to see the remote portlet.
If you succeed, congrats and you can move on to setup consumer in Jetspeed 2.1
If you don't ,then please go back and examine the steps above.
Missing one minor step and you could mess up the whole dang thing.


5. Install Jetspeed-2

Download the jetspeed 2.1 installer JAR from
This comes without any demo.

Install the jetspeed by running
java -jar jetspeed-2.1.3-installer.jar

Note: If you install both tomcat producer and jetspeed in the same PC, make sure you have them run on different ports!!!

During the installation, make sure you DO NOT select "Save PSML to Database". Theoretically, you can still can use this option
but I haven't had any chance to learn how to create/edit a page using the database yet.

After the installation, copy these files in your producer TOMCAT/common/endorsed/ to your jetspeed/common/endorsed
xercesImpl.jar, xml-apis.jar

In your jetspeed/shared/lib, make sure you have:
pluto-1.0.1.jar and portlet-api-1.0.jar

Next, deploy the wsrp4j-proxyportlet.war to Jetspeed by copying that file to

You may need to bounce JetSpeed a time or two to get the wsrp4j-proxyportlet exploded

After the wsrp4j-proxyportlet.war get exploded in jetspeed/webapps/wsrp4j-proxyportlet, we need to edit the producer info in this file

Change the port number to the correct one of your producer.

Create a file in TOMCAT/conf/Catalina/localhost/wsrp4j-proxyportlet.xml
This is the content:

<Context path="/WSRP4JResourceProxy" docBase="wsrp4j-proxyportlet"

Now, let create a page in Jetspeed to display a remote portlet

Create a simple page

You can copy the content here:

<?xml version="1.0" encoding="UTF-8"?>
<page id="/wsrp4j.psml" hidden="false">
<title>Welcome to Jetspeed 2</title>
<short-title>Welcome to Jetspeed 2</short-title>
<defaults skin="blue" decorator="tigris" decorator="tigris">
<fragment id="dp-1" type="layout" name="jetspeed-layouts::VelocityOneColumn">
<fragment id="dp-12" type="portlet" name="j2-admin::LoginPortlet">
<property name="row" value="3">
<property name="column" value="0">
<fragment id="P-117c25c3b64-10000" type="portlet" name="wsrp4j-proxyportlet::WSRP4JConsumer">
<property name="row" value="0">
<property name="column" value="0">
<preference name="wsrp_producer_id" readonly="false">
<preference name="wsrp_portlet_handle" readonly="false">
<metadata name="title" lang="fr">Bienvenue a Jetspeed</metadata>
<metadata name="title" lang="ja">Jetspeed 2 ?????</metadata>
<metadata name="title" lang="es">¡Bienvenido a Jetspeed 2!</metadata>
<metadata name="title" lang="hu">Köszönti a Jetspeed 2!</metadata>
<metadata name="title" lang="zh">????Jetspeed 2</metadata>
<metadata name="title" lang="zh_TW">????Jetspeed 2</metadata>
<metadata name="title" lang="ko">Jetspeed 2 ? ?? ?? ?????</metadata>

Next, bounce JetSPeed server and point your browser to

You should see your remote portlet get render.

To build wsrp4j producer I get the guide from


djoog said...

Don't you have to say what it is first ???

Anonymous said...

Could you mail me you entire jetspeed with tomcat and pluto with tomcat to me? I have had very difficulties to make all work.


Anonymous said...

Do you have email address so I can contact you?


Anonymous said...

in the wsrp_service.wsdl file, that the port number shouyld be?
8080 or 8081? (The tomcat port is 8080)


Doug said...

I will post the archives after work, sometimes tonight - regards

Anonymous said...

wen I had wsrp4j-proxyportlet.xml in conf/Cataline/localhost, I got the errors:

Apr 29, 2008 2:15:43 PM org.apache.catalina.startup.HostConfig deployDescriptor
SEVERE: Error deploying configuration descriptor wsrp4j-proxyportlet.xml
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.j
at org.apache.catalina.startup.HostConfig.deployApps(
at org.apache.catalina.startup.HostConfig.start(
at org.apache.catalina.startup.HostConfig.lifecycleEvent(
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
at org.apache.catalina.core.ContainerBase.start(

at org.apache.catalina.core.StandardHost.start(
at org.apache.catalina.core.ContainerBase.start(

at org.apache.catalina.core.StandardEngine.start(

Anonymous said...

Did you have experience of wsrp2j producer? I following your instructions and installed producer but i always got errors when I call a portlet on the producer. Did you try before?


Doug said...

The WAR archives for the relevant projects: Pluto portal, producer, consumer are:

Anonymous said...

Thnk you very much! I'll give it a try and let you know.


Anonymous said...

I tried pluto.war file and it didn't work with my pluto-1.0.1 boundled with tomcat. Could you zip a pluto with tomcat files for me?


Doug said...

You're not supposed to put pluto.war in another pluto distribution!. Just create a new Tomcat instance/container and deploy the pluto.war and producer.war

Anonymous said...

is there another pluto-portal-1.1.x.jar file other than pluto-portal-1.0.1.jar? It seems to me there are some problems in this file.

at org.apache.wsrp4j.producer.provider.pluto.driver.DescriptionHandlerIm
at org.apache.wsrp4j.producer.provider.pluto.driver.DescriptionHandlerIm
at org.apache.wsrp4j.commons.producer.driver.WSRPEngine.getServiceDescri
at org.apache.wsrp4j.commons.producer.binding.WSRPServiceDescriptionBind
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
at java.lang.reflect.Method.invoke(
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
at org.apache.axis.SimpleChain.doVisiting(
at org.apache.axis.SimpleChain.invoke(
at org.apache.axis.handlers.soap.SOAPService.invoke(
at org.apache.axis.server.AxisServer.invoke(
at org.apache.axis.transport.http.AxisServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBas
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
at org.apache.tomcat.util.threads.ThreadPool$


Anonymous said...

Did you try a wsrp? I didn't see it in your Could you send me 1. wsr4j.pmsl in jetspped
2. wsrp_service.wsdl


Anonymous said...

do you have a psml file in the jetspeed pages directory in which calls a WSRP portlet? Could you send me an example?


Anonymous said...

How many war files did you deploy on the producer side?
Here is what I did:
1. Pluto with tomcat
2. wsrp4j-producer
3. wsrp4j-testportlet
Are they enough to run a wsrp as producer?


Doug said...

That is correct. Those are the producer and test portlet to setup a complete producer environment. I'm working on fixing WSRP4j producer to make it work with Jetspeed container. Jetspeed 2 is using pluto cotainer 1.0.1, the producer in this revision is also using the same container. What I recognize is that the container servlet may need to be fixed.

mr.choi said...

Hello, I am joon choi and my blog is

Sorry, but do you know how to make usb-ubuntu os which is not read-only?

I made my usb stick bootable and I copied contents of Ubuntu 8.04 LiveCD to my stick.

And my usb ubuntu works fine. But any change made to system configuration is lost if I restart my computer.

Do you have any good idea?

Anonymous said...

According to your guide, I set jetspeed 2.1 (port 8081) as consumer and pluto 1.0.1 (port 8080) as producer. What should I do to make changes in the producer/wsdl/wsrp_service.wsdl file? the port should be 8081 or 8080?


rosi said... much emails you provide in web hosting provider my 2GB site...?