Friday June 23, 2006
Java Studio Creator 2 Portlets and Jetspeed-2
I finally had time to get a Java Studio Creator 2 Update 1 portlet
working on Apache Jetspeed-2. You have to make a couple of
modifications to the Creator portlet project to get things working
properly.
Modification 1 - Remove
the "tld" Folder
If you don't remove the "tld" folder from the Creator-produced WAR,
you'll get the following exception in the Jetspeed-2 log during the
deploy.
Attempting to add portlet.tld
to war...
Adding
portlet.tld to war...
ERROR:
java.util.zip.ZipException: duplicate entry: WEB-INF/tld/portlet.tld
org.apache.jetspeed.deployment.DeploymentException:
java.util.zip.ZipException:
duplicate entry:
WEB-INF/tld/portlet.tld at
org.apache.jetspeed.deployment.impl.DeployPortletAppEventListener.deployPortletApplication(DeployPortletAppEventListener.java:173)
at
org.apache.jetspeed.deployment.impl.DeployPortletAppEventListener.invokeDeploy(DeployPortletAppEventListener.java:158)
at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager.dispatch(StandardDeploymentManager.java:257)
at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager.deploy(StandardDeploymentManager.java:168)
at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager.fireDeploymentEvent(StandardDeploymentManager.java:202)
at
org.apache.jetspeed.deployment.impl.StandardDeploymentManager$FileSystemScanner.run(StandardDeploymentManager.java:342)
Caused by:
java.util.zip.ZipException: duplicate entry: WEB-INF/tld/portlet.tld
at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:163)
at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:90)
at
org.apache.jetspeed.tools.deploy.JetspeedDeploy.addFile(JetspeedDeploy.java:277)
at
org.apache.jetspeed.tools.deploy.JetspeedDeploy.<init>(JetspeedDeploy.java:170)
at
org.apache.jetspeed.deployment.impl.DeployPortletAppEventListener.deployPortletApplication(DeployPortletAppEventListener.java:168)
... 5 more
ERROR: Failure
deploying C:\Apache Jetspeed 2.0\webapps\jetspeed\WEB-INF\deploy\
Portlet3.war
|
First you'll need to remove the "tld" folder from the Creator project
because the Jetspeed-2 deployment process injects a "tld" folder.
Go to the "Files" window, select the "tld" folder, right-click and
select "Delete".

Modification
2 - Remove the "portlet.jar" from the Run Time Library
Next, you'll need to remove "portlet.jar" file from the "Sun Web UI
Components" library. If this is not removed, you'll get a
"ClassCastException" because the JetSpeed-2 container, in the
classloader hierarchy, already has a "portlet.jar" and specifically the
"Portlet" interface.
Open the Library manager by selecting the "Tools->Library
Manager" menu. Select the "Sun Web UI Components"
library on the left. You should see something like
this.
Remove the "jar:nbinst:///modules/ext/portlet.jar" entry and press the
"OK" button.
Next, export the WAR file by doing a right-click on the Project node
and choosing "Export War...". Choose the 1.4 J2EE container
and make the target directory the
"jetspeed-2_installdir/webapps/jetspeed/WEB-INF/deploy" directory.
When the WAR file is place here, Jetspeed-2 will pick up the
WAR file and deploy it to the app server and to the portal server.
Then you'll need to add it to a page by editing the
appropriate ".psml" file as directed in the Jetspeed-2
manual. I chose to put mine in the "jsf-demo.psml"
file so the portlet would show up with the other JSF portlets.
Working Proof
Here's a screen shot just so you believe me.

Posted by david
( Jun 23 2006, 06:40:38 PM MDT )
Permalink

|

|
Trackback URL: http://blogs.sun.com/david/entry/java_studio_creator_2_portlets
Posted by alex on July 12, 2006 at 08:11 AM MDT #
Posted by alex on July 12, 2006 at 08:11 AM MDT #
Are there no other changes that need to be made?
I've been down several paths that start with making "org.apache.portals.bridges.jsf.FacesPortlet" the portlet-class, but still no success.
Any help would be appreciated.
Posted by Brian on August 14, 2006 at 09:42 AM MDT #
Please look at the app server log to see if there are any exceptions. Also, please look for some common solutions on the Java Studio Creator Forum at http://forum.sun.com/jive/thread.jspa?forumID=123.
Thanks!
-David
Posted by David Botterill on August 16, 2006 at 12:26 AM MDT #
I don't have a lot of experience with locale switching and JSF. I suggest you check the JSF forum at http://forum.java.sun.com/forum.jspa?forumID=427 or the Sun Portal Server forums at http://swforum.java.sun.com/jive/category.jspa?categoryID=2.
Thanks!
-David
Posted by David Botterill on August 16, 2006 at 12:39 AM MDT #
Posted by Nicolas on September 13, 2006 at 07:43 AM MDT #
Posted by Anand Kulkarni on October 25, 2006 at 06:23 AM MDT #
Thanks!
-David
Posted by David Botterill on October 25, 2006 at 04:53 PM MDT #
Posted by pavan on November 20, 2006 at 11:34 PM MST #
Besides the information I've provided in this blog and the Creator/Jetspeed-2 documentation, there really isn't any more to offer. Please provide specifics about any problems you might be having.
Thanks!
-David
Posted by David Botterill on November 21, 2006 at 10:50 AM MST #
Posted by pavan on November 22, 2006 at 07:13 AM MST #
I'm actually a Java Tools Evangelist so I don't have any information about portlets developed with myeclipse. Your problem does appear to be something to do with the Jetspeed-2 specifically though so I would refer to http://portals.apache.org/jetspeed-2/ for information.
Or you could develop the portlets in Java Studio Creator and this blog plus a large community of portlet developers would be able to help. :)
-David
Posted by David Botterill on November 22, 2006 at 04:04 PM MST #
Posted by Brian on February 01, 2007 at 04:08 PM MST #
Posted by Marcin Migdal on February 01, 2007 at 04:08 PM MST #
Posted by Farhadi on July 10, 2007 at 03:11 PM MDT #
did u happen to come accross this case when running a portlet developed with Sun Creator 2 U 1 studio on Jetspeed-2;
I did exactly what you did, and this is what i got in the jetspeed-2 demo logs:
(supposing my portlet is AnotherPortlet.war)
INFO: Deploying web application archive AnotherPortlet.war
Nov 14, 2007 12:25:29 PM org.apache.commons.beanutils.MethodUtils getMatchingAccessibleMethod WARNING: Cannot use JVM pre-1.4 access bug workaround die to restrictive security manager.
Nov 14, 2007 12:25:29 PM com.sun.faces.config.rules.ComponentRule end
WARNING: [ComponentRule]{faces-config/component} Merge(com.sun.rave.web.ui.Time)
Nov 14, 2007 12:25:29 PM com.sun.faces.config.rules.ConverterRule end
WARNING: [ConverterRule]{faces-config/converter} Merge(null,java.math.BigDecimal)
Nov 14, 2007 12:25:29 PM com.sun.faces.config.rules.ConverterRule end
WARNING: [ConverterRule]{faces-config/converter} Merge(null,java.math.BigInteger)
Nov 14, 2007 12:25:32 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Nov 14, 2007 12:25:32 PM org.apache.catalina.core.StandardContext start
& hence, the portlet didnot appear on the page, instead a text appeared in its location saying it couldnt been started
Thx in advance
Posted by nasimjo on November 14, 2007 at 06:43 AM MST #