portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip Mark Donaghy" <philip.dona...@gmail.com>
Subject Re: Cannot create Portlet instance
Date Fri, 21 Jul 2006 12:11:55 GMT
Hi Ernesto,

I suggest trying to extend your portlet with GenericServletPortlet.

There is some simple documention on running servlet portlet here,
http://wiki.apache.org/portals/Jetspeed2/QuickstartForTheImpatient/CreateYourOwnSimpleServletPortlet

Philip

On 7/21/06, Ernesto Mansilla <emansilla@quiter.com> wrote:
> I have an error when executing the jetspeed 2 and to show the
> information of HelloWorld, very basic.
>
> as is the solution ???????
>
> the error message is
>
> Cannot create Portlet instance net.wehrens.portlets.HelloWorld for
> Portlet Application HelloWorld
>
> I am working with this:
>
> - portlet-api-1.0.jar
>
> - JetSpeed 2
>
> - Tomcat 5.5
>
> - Eclipse 3.2 for generated .war
>
>
>
>
> My code and files are :
>
> - default--page.psml
>
>     <fragment id="dp-19" type="portlet" name="helloworld::helloworld">
>       <property layout="TwoColumns" name="row" value="3" />
>       <property layout="TwoColumns" name="column" value="2" />
>     </fragment>
>
>
>
> - HelloWorld.java
>
> package net.wehrens.portlets;
> import java.io.IOException;
> import java.io.PrintWriter;
>
> import javax.portlet.GenericPortlet;
> import javax.portlet.PortletException;
> import javax.portlet.RenderRequest;
> import javax.portlet.RenderResponse;
>
>
> /** * 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>");
>     }
> }
>
>
>
> - portlet.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
> http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
>         version="1.0">
>     <portlet>
>         <description xml:lang="en">Hello World</description>
>         <portlet-name>helloworld</portlet-name>
>         <display-name xml:lang="en">HelloWorld</display-name>
>         <portlet-class>net.wehrens.portlets.HelloWorld</portlet-class>
>         <expiration-cache>60</expiration-cache>
>         <supports>
>             <mime-type>text/html</mime-type>
>             <portlet-mode>view</portlet-mode>
>         </supports>
>         <supported-locale>en</supported-locale>
>         <portlet-info>
>             <title>Hello World</title>
>             <short-title>Hello</short-title>
>             <keywords>Hello World</keywords>
>         </portlet-info>
>     </portlet>
>     <user-attribute>
>         <description xml:lang="en">User Name</description>
>         <name>user.name</name>
>     </user-attribute>
>     <user-attribute>
>         <description xml:lang="en">User Full Name</description>
>         <name>user.name.full</name>
>     </user-attribute>
>     <user-attribute>
>         <description xml:lang="en">User E-Mail</description>
>         <name>user.email</name>
>     </user-attribute>
>     <user-attribute>
>         <description xml:lang="en">User Organization</description>
>         <name>user.organization</name>
>     </user-attribute>
>     <user-attribute>
>         <description xml:lang="en">User Timezone</description>
>         <name>user.timezone</name>
>     </user-attribute>
>     <user-attribute>
>         <description xml:lang="en">User Preferred Locale</description>
>         <name>user.locale</name>
>     </user-attribute>
> </portlet-app>
>
>
>
> web.xml
>
>
> <?xml version="1.0"?>
> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
> 2.3//EN"
>                          "http://java.sun.com/dtd/web-app_2_3.dtd">
> <web-app>
>     <display-name>Hello World Example</display-name>
>     <servlet>
>         <servlet-name>helloworld</servlet-name>
>         <display-name>Hello World</display-name>
>         <description>Simple Hello World</description>
>         <servlet-class>net.wehrens.portlets.HelloWorld</servlet-class>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>helloworld</servlet-name>
>         <url-pattern>/helloworld/*</url-pattern>
>     </servlet-mapping>
> </web-app>
>
>
> Thanks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>
>


-- 
Philip Donaghy
donaghy.blogspot.com del.icio.us/donaghy/philip
Skype: philipmarkdonaghy
Office: +33 5 56 60 88 02
Mobile: +33 6 20 83 22 62

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message