Dashboard > GridSphere Portal v3.0 > ... > Portlet Development Guide > Hello World Portlet
  GridSphere Portal v3.0 Log In | Sign Up   View a printable version of the current page.  
  Hello World Portlet
Added by Oliver Wehrens, last edited by Oliver Wehrens on May 30, 2007  (view change)
Labels: 
(None)

Environment Setup

GridSphere provides some mechanism to get started with portlet programming. In the GridSphere source directory you can use the command ant new-project to start a process at which end you will get a subdirectory containing some template files and a basic structure for your portlets.

ant new-project
Buildfile: build.xml

setenv:
    [mkdir] Created dir: /Users/wehrens/Projects/gs/svn/gridsphere/projects
     [echo] Installing for Tomcat
     [echo] GridSphere Webserver is tomcat
     [echo] GridSphere will be deployed to /usr/local/apps/gs3/tomcat as the gridsphere web application

new-project:

new-project:
     [echo] Creating a New Portlet Project
    [input] Please enter a Project Title e.g. Cool Portlets
GS Examples
    [input] Please enter a Project Name this will be used for your portlet web application and should be lowercase e.g. coolportlets
gsexamples

check-project-exists:
    [mkdir] Created dir: /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples
     [copy] Copying 1 file to /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples
     [copy] Copying 1 file to /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples
    [mkdir] Created dir: /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples/src
    [mkdir] Created dir: /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples/lib
    [mkdir] Created dir: /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples/webapp
    [mkdir] Created dir: /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples/webapp/WEB-INF
    [mkdir] Created dir: /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples/webapp/WEB-INF/classes
     [copy] Copying 1 file to /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples/webapp/WEB-INF/classes
    [mkdir] Created dir: /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples/webapp/WEB-INF/persistence
     [copy] Copying 3 files to /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples/webapp/WEB-INF
     [copy] Copying 1 file to /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples/webapp/WEB-INF/persistence
     [copy] Copying 1 file to /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples/webapp/WEB-INF
     [copy] Copying 1 file to /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples/webapp/WEB-INF
    [mkdir] Created dir: /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples/webapp/html
    [mkdir] Created dir: /Users/wehrens/Projects/gs/svn/gridsphere/projects/gsexamples/webapp/jsp
     [echo] Creation of new portlet project GS Examples in projects/gsexamples is complete.
     [echo] Please edit src/ webapps/ and webapps/WEB-INF/{web.xml, PortletServices.xml} appropriately
     [echo] Please place portlets in src/**/portlets/ directory and service in src/**/services directory for proper compilation!

BUILD SUCCESSFUL
Total time: 15 seconds

This will create the project structure in the project directory of the GridSphere source directory.

The structure

> ls -l projects/gsexamples/
total 48
-rw-r--r-- 1 wehrens wehrens 467 May 16 17:49 build.properties
-rw-r--r-- 1 wehrens wehrens 17829 May 16 17:49 build.xml
drwxr-xr-x 2 wehrens wehrens 68 May 16 17:49 lib
drwxr-xr-x 2 wehrens wehrens 68 May 16 17:49 src
drwxr-xr-x 5 wehrens wehrens 170 May 16 17:49 webapp

Change to the projects/gsexample directory and have a look at the files.

build.properties
This file was created during the previous process and contains your input as well as some other
settings.

Property Default Description
project.title GridSphere Examples title for the project, will be used for some descriptive text in the layout.xml file
project.name gsexamples The project name is used to determine the name of the webapp this portlet package should be deployed as.
gridsphere.home ../../ Defines where GridSphere source home is located
gridsphere.build ../../build Defines where the GridSphere build files are project.version 1.0 RC 1 Defines a version tag for your project. You can/should change that.
project.build build Defines where the compiled classes go.
project.dist dist Defines where the portlet distribution files goes.
project.priority   If there are any dependencies, an integer must be specified here which will determine the ordering for when this app gets starting from smallest to largest- leave empty if ordering is not important
project.shared   if this project provides any portlet services used by another portlet application, then the value
should be set to true

Once this file is generated you normally don't need to edit it (besides the optional project.version
property).

build.xml
This file normally does not need to be changed. It contains all targets for the default code structure to compile and deploy your code to GridSphere.

lib
If you have 3rd party libraries to be used in your project you need to place them in that directory.

src
All your java based source code should go into that directory. One convention regarding the naming of the packagestructure must be followed if you want to use the the supplied build script. All portlets should be placed in a subdirectory named portlets (e.g. gsexamples/portlets). If you want to use the GridSphere portlet service model you have to place your service interfaces and implementations in a subdirectory named services (e.g. gsexamples/services).

webapp

The webapp directory contains three directories.

> ls -l webapp/
total 0
drwxr-xr-x 10 wehrens wehrens 340 May 18 13:12 WEB-INF
drwxr-xr-x 2 wehrens wehrens 68 May 16 17:49 html
drwxr-xr-x 2 wehrens wehrens 68 May 16 17:49 jsp

webapp/WEB-INF
This is the normal WEB-INF directory of your portlet specification. Two files are needed to be there, web.xml and portlet.xml. Those are defined in JSR 168 and are required. The other files are GridSphere specific and ease the development and deployment of portlets to the GridSphere portal framework.

s -l webapp/WEB-INF/
total 24
-rw-r--r--   1 wehrens  wehrens   770 Jan  3 15:21 PortletServices.xml
drwxr-xr-x   3 wehrens  wehrens   102 Jan  3 15:21 classes
drwxr-xr-x   3 wehrens  wehrens   102 Jan  3 15:21 persistence
-rw-r--r--   1 wehrens  wehrens  3857 Jan  3 15:21 portlet.xml
-rw-r--r--   1 wehrens  wehrens  2112 Jan  3 15:21 web.xml

Programming

Now that we have our project setup we can go ahead and develop some portlets.

Hello World

First we will create a simple Hello World Portlet using JSR 168 standard methods. Create a subdirectory src/org/gridsphere/gsexamples/portlets and create the File HelloWorld.java.

HelloWorld.java
package org.gridsphere.gsexamples.portlets;

import javax.portlet.GenericPortlet;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.PortletException;
import java.io.PrintWriter;
import java.io.IOException;

/**
 * a simple HelloWorld Portlet
 */
public class HelloWorld extends GenericPortlet {

    public void doView(RenderRequest request, RenderResponse response)
            throws PortletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.println("<h1>Hello World</h1>");
    }

}

Now we need to modify portlet.xml so that GridSphere recognizes the portlet (or any other JSR compliant portlet container). We do already have a template portlet.xml in the webapp/WEB-INF directory deployed. Please replace the current portlet section with the follwing entry:

portlet.xml
<portlet>
     <description xml:lang="en">
        The classic Hello World example
     </description>
     <portlet-name>HelloPortlet</portlet-name>
     <display-name xml:lang="en">Hello World</display-name>
     <portlet-class>
        org.gridsphere.gsexamples.portlets.HelloWorld
     </portlet-class>
     <expiration-cache>60</expiration-cache>
     <supports>
         <mime-type>text/html</mime-type>
         <portlet-mode>edit</portlet-mode>
         <portlet-mode>help</portlet-mode>
     </supports>
     <supported-locale>en</supported-locale>
     <portlet-info>
         <title>Hello World</title>
         <short-title>Hello World</short-title>
         <keywords>hello</keywords>
     </portlet-info>
 </portlet>

This defines the HelloWorld portlet with the portlet name of HelloPortlet (line 5), the portlet class beeing our HelloWorld example (line 8), a cachetime of 60 seconds (line 10), an edit (line13) and help (line 14) mode. Furthermore some information about the portlet is provided (line 17-21).

Now we are ready to compile and deploy the Hello World Portlet.

> ant install
Buildfile: build.xml
setenv:
[mkdir] Created dir: gridsphere/projects/gsexamples/build
...
BUILD SUCCESSFUL
Total time: 7 seconds

After the deployment of the portlet to the portal and configuring GridSphere to display it (go to Layout in the upper right corner and add it the desired layout), you will see your HelloWorld portlet.

Source code

Get the full source code for this example: gsexamples.zip. Unzip this into the projects directory (you maybe have to create this directory first).

I have done the above step, but it doesn't display the HelloWorld portlet. How can I configure the GridSphere for that?

Posted by Worraluk Yamwong at Apr 22, 2007 23:48 | Permalink

Did you go to the LayoutManager and added it ?

Posted by Oliver Wehrens at May 30, 2007 06:40 | Permalink

Hi, I also carried out all of the above described steps, but it doesn't seem to work. I cannot add the portlet in the Layout Manager, because it isn't displayed. Also, the  Portlet Application Manager tells me there was a failure deploying the portlet. No further as to what failure is given.

 Further above you wrote: After the deployment of the portlet to the portal and configuring GridSphere to display it...

 What exactly do you mean by deployment? Is this already done by the build-script? Or are further steps necessary? If so, could you give me a hint how to do deploy the Portlet? (I'm using tomcat 5.5 with Windows XP and Gridsphere 3.0.7)

 Thanks in Advance,

Daniel

Posted by Daniel Wickeroth at Jun 20, 2007 04:15 | Permalink

Same problem. Can't see the Layout Manager. Get a class cast exception, casting from org.gridsphere.portletcontainer.impl.ApplicationPortletImpl to org.gridsphere.portletcontainer.impl.ApplicationPortletImpl. Tried 3.0.7.tar.gz in Ubuntu and PCLinux with jdk 5 and jdk 6, tomcat5.5 and tomcat6 (with the example portlet from gsexamples.zip).

Finally gave up and tried different releases from svn. Most of them from 3.0.1 to 3.0.8RC1 and trunk; all of them gave differen errors, but in none of the cases was I able to get the portlet showing in the portal... Should be a simple issue, so I must say I'm not very impressed.

Posted by klausolsen at Jul 04, 2007 10:47 | Permalink

I have the same problem as well. I got the class cast exception when accessing the Layout view and just got a blank screen. My system configuration is Windows XP, JDK 5 and tomcat 5.5. If you want to see the exception trace is identical to this one

http://lists.gridsphere.org/pipermail/gridsphere-dev/2007-April/000364.html&nbsp;

It's really frustrating not to be able to get a simple Hello World application working...

Cheers 

Posted by Fede Garcia at Jul 06, 2007 00:22 | Permalink

I got the blank screen on the Layout tab too. The portlet appears in the Portlet Application Manager with a successfull status, but I can't pick it on the Layout area 'cause the area is blank. I'm using Tomcat 5.5.23 and Gridsphere 3-0.7.

Here are the trace errors of stdout:

42922:DEBUG:(LayoutManagerPortlet.java:doShowLayout:615)
< rendering the component >

in doRenderSelPortlets cid=11
42922:ERROR:(ActionPortlet.java:doAction:228)
< Error invoking action method: doShowLayout >

java.lang.ClassCastException: org.gridsphere.portletcontainer.impl.ApplicationPortletImpl cannot be cast to org.gridsphere.portletcontainer.impl.ApplicationPortletImpl
    at org.gridsphere.layout.PortletTableLayout.getAllPortletsToAdd(PortletTableLayout.java:192)
    at org.gridsphere.layout.view.brush.TableLayout.doRenderSelectPortlets(TableLayout.java:89)
    at org.gridsphere.layout.PortletTableLayout.doRender(PortletTableLayout.java:231)
    at org.gridsphere.layout.PortletBar.doRender(PortletBar.java:89)
    at org.gridsphere.portlets.core.admin.layout.LayoutManagerPortlet.doShowLayout(LayoutManagerPortlet.java:618)
    at org.gridsphere.portlets.core.admin.layout.LayoutManagerPortlet.doShowLayout(LayoutManagerPortlet.java:359)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.gridsphere.provider.portlet.jsr.ActionPortlet.doAction(ActionPortlet.java:204)
    at org.gridsphere.provider.portlet.jsr.ActionPortlet.doMode(ActionPortlet.java:301)
    at org.gridsphere.provider.portlet.jsr.ActionPortlet.doView(ActionPortlet.java:270)
    at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:201)
    at org.gridsphere.provider.portlet.jsr.ActionPortlet.doDispatch(ActionPortlet.java:325)
    at javax.portlet.GenericPortlet.render(GenericPortlet.java:140)
    at org.gridsphere.provider.portlet.jsr.PortletServlet.render(PortletServlet.java:410)
    at org.gridsphere.provider.portlet.jsr.PortletServlet.service(PortletServlet.java:336)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)
    at org.gridsphere.portletcontainer.impl.PortletDispatcherImpl.include(PortletDispatcherImpl.java:174)
    at org.gridsphere.portletcontainer.impl.PortletDispatcherImpl.service(PortletDispatcherImpl.java:79)
    at org.gridsphere.portletcontainer.impl.PortletInvoker.service(PortletInvoker.java:54)
    at org.gridsphere.layout.PortletFrame.doRender(PortletFrame.java:571)
    at org.gridsphere.layout.PortletColumnLayout.doRender(PortletColumnLayout.java:43)
    at org.gridsphere.layout.PortletTableLayout.doRender(PortletTableLayout.java:227)
    at org.gridsphere.layout.PortletBar.doRender(PortletBar.java:89)
    at org.gridsphere.layout.PortletPage.doRender(PortletPage.java:463)
    at org.gridsphere.layout.PortletLayoutEngine.service(PortletLayoutEngine.java:167)
    at org.gridsphere.servlets.GridSphereServlet.processRequest(GridSphereServlet.java:229)
    at org.gridsphere.servlets.GridSphereServlet.doGet(GridSphereServlet.java:124)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at org.gridsphere.servlets.GridSphereFilter.doFilter(GridSphereFilter.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
    at java.lang.Thread.run(Unknown Source)
42937:ERROR:(ApplicationDispatcher.java:invoke:723)
< Servlet.service() for servlet PortletServlet threw exception >

java.lang.ClassCastException: org.gridsphere.portletcontainer.impl.ApplicationPortletImpl cannot be cast to org.gridsphere.portletcontainer.impl.ApplicationPortletImpl
    at org.gridsphere.layout.PortletTableLayout.getAllPortletsToAdd(PortletTableLayout.java:192)
    at org.gridsphere.layout.view.brush.TableLayout.doRenderSelectPortlets(TableLayout.java:89)
    at org.gridsphere.layout.PortletTableLayout.doRender(PortletTableLayout.java:231)
    at org.gridsphere.layout.PortletBar.doRender(PortletBar.java:89)
    at org.gridsphere.portlets.core.admin.layout.LayoutManagerPortlet.doShowLayout(LayoutManagerPortlet.java:618)
    at org.gridsphere.portlets.core.admin.layout.LayoutManagerPortlet.doShowLayout(LayoutManagerPortlet.java:359)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.gridsphere.provider.portlet.jsr.ActionPortlet.doAction(ActionPortlet.java:204)
    at org.gridsphere.provider.portlet.jsr.ActionPortlet.doMode(ActionPortlet.java:301)
    at org.gridsphere.provider.portlet.jsr.ActionPortlet.doView(ActionPortlet.java:270)
    at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:201)
    at org.gridsphere.provider.portlet.jsr.ActionPortlet.doDispatch(ActionPortlet.java:325)
    at javax.portlet.GenericPortlet.render(GenericPortlet.java:140)
    at org.gridsphere.provider.portlet.jsr.PortletServlet.render(PortletServlet.java:410)
    at org.gridsphere.provider.portlet.jsr.PortletServlet.service(PortletServlet.java:336)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)
    at org.gridsphere.portletcontainer.impl.PortletDispatcherImpl.include(PortletDispatcherImpl.java:174)
    at org.gridsphere.portletcontainer.impl.PortletDispatcherImpl.service(PortletDispatcherImpl.java:79)
    at org.gridsphere.portletcontainer.impl.PortletInvoker.service(PortletInvoker.java:54)
    at org.gridsphere.layout.PortletFrame.doRender(PortletFrame.java:571)
    at org.gridsphere.layout.PortletColumnLayout.doRender(PortletColumnLayout.java:43)
    at org.gridsphere.layout.PortletTableLayout.doRender(PortletTableLayout.java:227)
    at org.gridsphere.layout.PortletBar.doRender(PortletBar.java:89)
    at org.gridsphere.layout.PortletPage.doRender(PortletPage.java:463)
    at org.gridsphere.layout.PortletLayoutEngine.service(PortletLayoutEngine.java:167)
    at org.gridsphere.servlets.GridSphereServlet.processRequest(GridSphereServlet.java:229)
    at org.gridsphere.servlets.GridSphereServlet.doGet(GridSphereServlet.java:124)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at org.gridsphere.servlets.GridSphereFilter.doFilter(GridSphereFilter.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
    at java.lang.Thread.run(Unknown Source)
in doRenderSelPortlets cid=8
java.lang.ClassCastException: org.gridsphere.portletcontainer.impl.ApplicationPortletImpl cannot be cast to org.gridsphere.portletcontainer.impl.ApplicationPortletImpl
    at org.gridsphere.layout.PortletTableLayout.getAllPortletsToAdd(PortletTableLayout.java:192)
    at org.gridsphere.layout.view.brush.TableLayout.doRenderSelectPortlets(TableLayout.java:89)
    at org.gridsphere.layout.PortletTableLayout.doRender(PortletTableLayout.java:231)
    at org.gridsphere.layout.PortletBar.doRender(PortletBar.java:89)
    at org.gridsphere.layout.PortletPage.doRender(PortletPage.java:463)
    at org.gridsphere.layout.PortletLayoutEngine.service(PortletLayoutEngine.java:167)
    at org.gridsphere.servlets.GridSphereServlet.processRequest(GridSphereServlet.java:229)
    at org.gridsphere.servlets.GridSphereServlet.doGet(GridSphereServlet.java:124)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at org.gridsphere.servlets.GridSphereFilter.doFilter(GridSphereFilter.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
    at java.lang.Thread.run(Unknown Source)
42937:DEBUG:(PersistenceManagerRdbmsImpl.java:endTransaction:261)

Posted by Edrick Perez at Jul 11, 2007 05:04 | Permalink

Hi,

there was an error with the LayoutManager in the latest release, I fixed that and released today 3.0.8. If you try that again it should work (you need to update your build scripts though if you use the supplied downloadable example). I will update this as well.

Oliver

Posted by Oliver Wehrens at Jul 12, 2007 02:58 | Permalink

I reinstalled tomcat, installed GS 3.08 and tested the new version (downloaded) of the HelloWorld example and it now works!
The example portlet won't show on the portlet manager at first, but a tomcat restart did the trick.

Thanks

Edrick 

Posted by Edrick Perez at Jul 12, 2007 05:13 | Permalink

I reinstalled too, and the HelloWorld portlet example really works in GS 3.0.8!!

 Now I´m going to test it with old portlets (upgrade) ...

Posted by Camila Pregioni Bayma at Jul 12, 2007 08:58 | Permalink

I just wanted to make a note for the newbies that, if you do not see the freshly baked portletin the layout manager, restart tomcat ($CATALINA_HOME/bin/shutdown.sh && $CATALINA_HOME/bin/startup.sh)

Posted by Anand Vaidya at Dec 07, 2007 17:34 | Permalink

Is there an equivalent to this for GS 2.2?  Due to the portlets I'm using, I need to stick with GS 2.2, and would like examples of how to use ant new-project to init a new portlet.  My initial attempts at this, however, have failed.  I'd rather not copy-paste existing portlets, since 1) I won't understand what I'm copying, and 2) Additional, unnecessary material will get copied.

Posted by Ian Stokes-Rees at Apr 15, 2008 11:05 | Permalink

I installed GridSphere 3.1 and tomcat 5.5. The First time that I tested the HelloWorld Portlet,it don't work. Then, I try:

 touch $HOME/.gridsphere/portlets/gsexamples.2

$CATALINA_HOME/bin/startup.sh 

and the portlet appears into the layout.

Posted by Rafael Leon at Jul 01, 2008 13:40 | Permalink

Hi. I installed GS 3.1, tomcat 5.5.26, ant 1.7. running on Windows XP platform. anyway, got GS up and running. But am i missing something if i don't actually see a Portlet Group Manager? 'Cause I've searched everywhere.

Plus, I also don't see anything under Portlet Application Manager except for the GS core portlet that shows a successful deployment status. No error. Nothing. Does this mean it has failed to deploy? 'cause when I run ant install on gsexamples, it gives me a BUILD SUCCESS. 

Have also added an empty file in CustomPortal/portlets/"webappname" already.

I've shutdown and restarted tomcat. But I still don't see any Hello World portlet in the Layout Manager. None

Have been on this for quite a few days now. Would appreciate if anyone could point anything out that I've missed. Thanks!

Posted by e.c at Jan 04, 2009 02:11 | Permalink
Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.8 Build:#525 Aug 08, 2006) - Bug/feature request - Contact Administrators