Hello,
I encounter two issues with the deployment of portlets in Pluto.
-->First issue
Tomcat generate an error when it is launch.
the error message says :
"28 avr. 2006 16:35:05 org.apache.commons.digester.Digester error
GRAVE: Parse Error at line 6 column 39: The content of element type
"distributable" must match "EMPTY".
org.xml.sax.SAXParseException: The content of element type "distributable" must
match "EMPTY".
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
..."
So OK. But when I empty the distributable field .
I can't run Pluto :S
Has someone an idea ?
Has someone already encountered this problem ?
--> Second issue
I created my Portlet, put it in a new context called "portletsDemo" and change
the XML files to refer it. But it doesn't run in the portal.
However, if I put the same portlet in the pluto context, it run well.
I don't understand why.
I use Tomcat 4.1.3 with JAVA 1.4.2_04
I built pluto from source. (thanks Elliot for the information in your previous
mail, you were right. Now, it runs)
The same problem appears with the test portlet of Pluto.
In the testsuite context, all portlets display the following sentence : "Error
occurred in portlet!" in wiew mode. However, the portlets works well in help
mode and edit mode.
And in the tomcat log files, the following message appears :
"GRAVE: Error in Portlet
java.lang.NullPointerException
at
org.apache.pluto.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:109)
at
org.apache.pluto.invoker.impl.PortletInvokerImpl.load(PortletInvokerImpl.java:80)
at
org.apache.pluto.PortletContainerImpl.portletLoad(PortletContainerImpl.java:218)
at
org.apache.pluto.portalImpl.core.PortletContainerWrapperImpl.portletLoad(PortletContainerWrapperImpl.java:94)"
why it runs in the "pluto" context and not in my "portletsDemo" context
you will find my portlet and the definition files, this below:
-------------------------------------------------------------
-------------------- SimpleDateTimePortlet.java ------------
-------------------------------------------------------------
package portlets.demo;
import javax.portlet.*;
import java.io.*
import java.text.SimpleDateFormat;
import java.util.Date;
public class SimpleDateTimePortlet extends GenericPortlet {
private String helpPage;
public void init(PortletConfig config) throws PortletException {
helpPage = config.getInitParameter("helpPage");
super.init(config);
}
public void doView(RenderRequest request, RenderResponse response)
throws
PortletException, IOException {
SimpleDateFormat simpleDateFormat = new
SimpleDateFormat("dd.MM.yyyy
HH:mm:ss");
String dateTime = simpleDateFormat.format(new Date());
response.setContentType("text/html");
PrintWriter writer = response.getWriter();
writer.write("<table border=\"1\">");
writer.write("<tr><td>" + dateTime + " </td></tr></table>");
writer.close();
}
public void doHelp(RenderRequest request, RenderResponse response)
throws
PortletException, IOException {
PortletRequestDispatcher dispatcher =
getPortletContext().getRequestDispatcher(helpPage);
dispatcher.include(request,response);
}
public void destroy() {
super.destroy();
}
}
-------------------------------------------------------------------
--------------------- portlet.xml ---------------------------------
-------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0"
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">
<portlet>
<description>simpleDateTimePortlet</description>
<portlet-name>simpleDateTimePortlet</portlet-name>
<display-name>simpleDateTimePortlet</display-name>
<portlet-class>portlets.demo.SimpleDateTimePortlet</portlet-class>
<init-param>
<name>helpPage</name>
<value>/portlets/demo/help.jsp</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
<portlet-mode>help</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title> Simple date and time display </title>
<short-title>Simple date/time</short-title>
</portlet-info>
</portlet>
</portlet-app>
----------------------------------------------------------------
------------------- web.xml ------------------------------------
----------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!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>portletsDemo</display-name>
<description>Demo</description>
<servlet>
<servlet-name>simpleDateTimePortlet</servlet-name>
<display-name>simpleDateTimePortlet (Pluto Invoker)</display-name>
<description>simpleDateTimePortlet</description>
<servlet-class>portlets.demo.SimpleDateTimePortlet</servlet-class>
<security-role-ref>
<role-name>plutoTestRole</role-name>
<role-link>tomcat</role-link>
</security-role-ref>
</servlet>
<servlet-mapping>
<servlet-name>simpleDateTimePortlet</servlet-name>
<url-pattern>/simpleDateTimePortlet/*</url-pattern>
</servlet-mapping>
<security-role>
<role-name>tomcat</role-name>
</security-role>
</web-app>
------------------------------------------------------------------
I add the following row : "/portletsDemo" to the "portletcontext.txt" file.
I add the nodes in the pageregistry.xml and portletentityregistry.xml files to
refer my portlet.
------------------------------------------------------------------
this below, the architecture of my webapps folder :
+pluto
+ ...
+testsuite
+ ...
+portletsDemo
+META-INF
+WEB-INF
+classes
+portlets
+demo
-simpleDateTimeFormat.class
-help.jsp
+lib
Do you see an error ?
Could someone explain me the problem ?
Thanks !
Best regards,
Ludovic
--------------------------------------------------
This mail sent through Polytech'Lille WebMail (IMP)