You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Enrique Perez <pe...@dit.upm.es> on 2006/08/30 17:56:10 UTC
Cannot create instance of "Simplest Portlet"
Hi all,
I'm trying to view two "simplest portlets" (just saying "Hi, I'm portlet
x.") in a psml located at "WEB-INF/pages", but all I get is an error
message:
Cannot create Portlet instance p1.java for Portlet Application Test
for portlet 1, and
Cannot create Portlet instance p2.java for Portlet Application Test
for portlet 2.
The jetspeed log ("error_log.txt" contains the complete error trace) is
quite confusing for me (both portlets have the same error number, 1352):
2006-08-30 17:17:30,109 [http-8080-Processor16] ERROR
org.apache.jetspeed.factory.JetspeedPortletFactory - Cannot create
Portlet instance p1.java for Portlet Application Test
java.lang.ClassNotFoundException: p1.java
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
.java:1352)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
.java:1198)
at
org.apache.jetspeed.factory.JetspeedPortletFactory.getPortletInstance(Je
tspeedPortletFactory.java:197)
at
org.apache.jetspeed.container.invoker.ServletPortletInvoker.invoke(Servl
etPortletInvoker.java:190)
at
org.apache.jetspeed.container.invoker.ServletPortletInvoker.render(Servl
etPortletInvoker.java:126)
at
org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl
.java:119)
at
org.apache.jetspeed.container.JetspeedPortletContainerWrapper.renderPort
let(JetspeedPortletContainerWrapper.java:120)
because "p1.class" and "p2.class" are both located at
"$TOMCAT_HOME/webapps/Test/WEB-INF/classes", where they are supposed to
be.
I've created a "Test.war" and it's been successfully deployed by J2,
generating the following directory structure:
Test
|- META-INF
|- WEB-INF
|- classes
| |- p1.class
| |- p2.class
|- src
| |- p1.java
| |- p2.java
|- tld
| |- portlet.tld
|- portlet.xml
|- web.xml
Maybe my problem is that I've used Eclipse to create the classes: I've
imported the library "portlet.jar" to the project, and used the command
"import javax.portlet.*" at the beginning...
I've tried to add a new folder (called "lib" or "shared") to WEB-INF
including the library "portlet.jar" but with no success =/
Can anyone help me, please?
Thanks in advance,
Enrique
PS: I attach the files in case they are needed
Re: Cannot create instance of "Simplest Portlet"
Posted by Enrique Perez <pe...@dit.upm.es>.
Hi,
Thank you, Ludovic, David =)
It was my fault... The guide specifies clearly that I must use class
name only... silly me =/
Regards,
Enrique
David Sean Taylor escribió:
> Enrique Perez wrote:
>>
>> Maybe my problem is that I've used Eclipse to create the classes:
>> I've imported the library "portlet.jar" to the project, and used the
>> command "import javax.portlet.*" at the beginning...
>> I've tried to add a new folder (called "lib" or "shared") to WEB-INF
>> including the library "portlet.jar" but with no success =/
>>
> 1) class name only: p1 not p1.java
> 2) don't include the portlet.jar in your war file, its not allowed
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
Re: Cannot create instance of "Simplest Portlet"
Posted by David Sean Taylor <da...@bluesunrise.com>.
Enrique Perez wrote:
>
> Maybe my problem is that I've used Eclipse to create the classes: I've
> imported the library "portlet.jar" to the project, and used the command
> "import javax.portlet.*" at the beginning...
> I've tried to add a new folder (called "lib" or "shared") to WEB-INF
> including the library "portlet.jar" but with no success =/
>
1) class name only: p1 not p1.java
2) don't include the portlet.jar in your war file, its not allowed
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
Re: Cannot create instance of "Simplest Portlet"
Posted by ch...@polytech.unice.fr.
Hi Enrique,
My first guess would be to remove the .java extension found inside your
portlet.xml, because it is looking for a Class, not a file :
<portlet-class>Portlet1</portlet-class>
instead of :
<portlet-class>p1.java</portlet-class>
HTH,
Ludovic
> Hi all,
>
> I'm trying to view two "simplest portlets" (just saying "Hi, I'm portlet
> x.") in a psml located at "WEB-INF/pages", but all I get is an error
> message:
>
> Cannot create Portlet instance p1.java for Portlet Application Test
>
> for portlet 1, and
>
> Cannot create Portlet instance p2.java for Portlet Application Test
>
> for portlet 2.
>
> The jetspeed log ("error_log.txt" contains the complete error trace) is
> quite confusing for me (both portlets have the same error number, 1352):
>
> 2006-08-30 17:17:30,109 [http-8080-Processor16] ERROR
> org.apache.jetspeed.factory.JetspeedPortletFactory - Cannot create
> Portlet instance p1.java for Portlet Application Test
> java.lang.ClassNotFoundException: p1.java
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
> .java:1352)
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
> .java:1198)
> at
> org.apache.jetspeed.factory.JetspeedPortletFactory.getPortletInstance(Je
> tspeedPortletFactory.java:197)
> at
> org.apache.jetspeed.container.invoker.ServletPortletInvoker.invoke(Servl
> etPortletInvoker.java:190)
> at
> org.apache.jetspeed.container.invoker.ServletPortletInvoker.render(Servl
> etPortletInvoker.java:126)
> at
> org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl
> .java:119)
> at
> org.apache.jetspeed.container.JetspeedPortletContainerWrapper.renderPort
> let(JetspeedPortletContainerWrapper.java:120)
>
>
> because "p1.class" and "p2.class" are both located at
> "$TOMCAT_HOME/webapps/Test/WEB-INF/classes", where they are supposed to
> be.
>
> I've created a "Test.war" and it's been successfully deployed by J2,
> generating the following directory structure:
> Test
> |- META-INF
> |- WEB-INF
> |- classes
> | |- p1.class
> | |- p2.class
> |- src
> | |- p1.java
> | |- p2.java
> |- tld
> | |- portlet.tld
> |- portlet.xml
> |- web.xml
>
> Maybe my problem is that I've used Eclipse to create the classes: I've
> imported the library "portlet.jar" to the project, and used the command
> "import javax.portlet.*" at the beginning...
> I've tried to add a new folder (called "lib" or "shared") to WEB-INF
> including the library "portlet.jar" but with no success =/
>
> Can anyone help me, please?
>
> Thanks in advance,
> Enrique
>
>
>
>
>
>
>
> PS: I attach the files in case they are needed
>
>
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org