[SOLVED] Gatein jsr286 portlet 2.0
oli83 Oct 12, 2010 6:17 AMHi,
I've made a gatein extension in an ear.
In this ear i've put a jsr 286 portlet.
When i deploy it, i have an Exception :
The portlet threw an exception javax.portlet.PortletException: org.apache.jasper.JasperException: L'uri absolue: http://java.sun.com/portlet_2_0 ne peut être résolu dans le fichier web.xml ou dans les fichiers jar d�ploy�s avec cette application at org.gatein.pc.portlet.impl.jsr168.api.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:169) at org.gatein.pc.portlet.impl.jsr168.api.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:79) [...] Caused by: javax.portlet.PortletException: org.apache.jasper.JasperException: L'uri absolue: http://java.sun.com/portlet_2_0 ne peut �tre r�solu dans le fichier web.xml ou dans les fichiers jar d�ploy�s avec cette application at org.gatein.pc.portlet.impl.jsr168.api.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:169) at org.gatein.pc.portlet.impl.jsr168.api.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:79)
My web.xml
<?xml version="1.0"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd" version="2.5"> </web-app>
My portlet.xml
<?xml version="1.0" encoding="UTF-8"?> <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"> <portlet> <description>...</description> <portlet-name>...</portlet-name> <display-name>...</display-name> <portlet-class>foo.MyPortlet</portlet-class> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> <portlet-mode>view</portlet-mode> </supports> <supported-locale>fr</supported-locale> <portlet-info> <title>...</title> <short-title>...</short-title> <keywords>...</keywords> </portlet-info> </portlet> </portlet-app>
My jsp :
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <portlet:defineObjects/> <div> <span class="copyright">© foo 2010</span><span class="separator"> - </span><span class="today"><c:out value="${todayStr}" /></span> </div>
My pom
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>...</groupId> <artifactId>...</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>...</name> <dependencies> <dependency> <groupId>javax.portlet</groupId> <artifactId>portlet-api</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> <type>jar</type> <scope>compile</scope> </dependency> </dependencies> <build> <finalName>...</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> </plugins> </build> </project>
I don't understand this error. I am using Gatein 3.1 and jboss 5.1.0.GA. This portlet was working fine in gatein tomcat.
I can handle it if i put the gatein tld in the WEB-INF and i put this code in the web.xml
<taglib> <taglib-uri>http://java.sun.com/portlet_2_0</taglib-uri> <taglib-location>/WEB-INF/tld/portlet_2_0.tld</taglib-location> </taglib>
But i don't want to do so because i want my portlet multi portal compliant (jetspeed, liferay, ...), not just GateIn.
I hope you can help me.
Thanks a lot in advance
olivier