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 Akshay Ahooja <ak...@gmail.com> on 2006/07/26 23:50:08 UTC
Error: The requested resource (/container) is not available
Hi,
I am putting up a struts app onto Jetspeed-2 as a portlet, but the following
error shows in the portlet. The logs do not show any errors...
"The requested resource (/container) is not available"
I have the struts-bridge library in the war file, and do have other struts
apps deployed on that same portal.
I have pasted the important files below...
Thanks,
Akshay
welcome-file:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://portals.apache.org/bridges/struts/tags-portlet-html"
prefix="html" %>
<%@page language="java"
import="java.io.*, java.util.*, java.sql.*,
javax.servlet.http.HttpSession, java.lang.*,javax.portlet.*"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
...
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>forum</display-name>
<description>SVVCForum</description>
<servlet>
<servlet-name>action</servlet-name>
<!-- <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
-->
<servlet-class>org.apache.portals.bridges.struts.PortletServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- ADDITION -->
<servlet>
<servlet-name>JetspeedContainer</servlet-name>
<display-name>Jetspeed Container</display-name>
<description>MVC Servlet for Jetspeed Portlet
Applications</description>
<servlet-class>
org.apache.jetspeed.container.JetspeedContainerServlet</servlet-class>
<init-param>
<param-name>contextName</param-name>
<param-value>forum</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- ADDITION -->
<servlet-mapping>
<servlet-name>JetspeedContainer</servlet-name>
<url-pattern>/container/*</url-pattern>
</servlet-mapping>
<session-config><session-timeout>
30
</session-timeout></session-config>
<welcome-file-list>
<welcome-file>index_.jsp</welcome-file>
</welcome-file-list>
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/portlet</taglib-uri>
<taglib-location>/WEB-INF/tld/portlet.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
<!-- ADDITION -->
<taglib>
<taglib-uri>http://java.sun.com/portlet</taglib-uri>
<taglib-location>/WEB-INF/tld/portlet.tld</taglib-location>
</taglib>
<!-- _ -->
</jsp-config></web-app>
portlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app id="forum" name="forum" version="1.0">
<portlet id="forum">
<init-param>
<name>ServletContextProvider</name>
<value>org.apache.jetspeed.portlet.ServletContextProviderImpl</value>
</init-param>
<init-param>
<name>ViewPage</name>
<value>/index_.jsp</value>
</init-param>
<init-param>
<name>Welcome</name>
<value>/index_.jsp</value>
</init-param>
<portlet-name>forum</portlet-name>
<display-name>forum</display-name>
<description>forum</description>
<portlet-class>org.apache.portals.bridges.struts.StrutsPortlet
</portlet-class>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>forum</title>
<short-title>forum</short-title>
<keywords>Struts</keywords>
</portlet-info>
</portlet>
<user-attribute>
<description>User Given Name</description>
<name>user.name.given</name>
</user-attribute>
<user-attribute>
<description>User Last Name</description>
<name>user.name.family</name>
</user-attribute>
<user-attribute>
<description>User eMail</description>
<name>user.home-info.online.email</name>
</user-attribute>
</portlet-app>
Struts-portlet-config
<?xml version="1.0" encoding="UTF-8"?>
<config>
<render-context>
<attribute name="errors" keep="true"/>
<attribute name="message" keep="true"/>
</render-context>
<portlet-url-type default="action">
<resource path="/images/"/>
</portlet-url-type>
</config>
Re: Error: The requested resource (/container) is not available
Posted by Akshay Ahooja <ak...@gmail.com>.
Great...that works..
Also, the portlet name and id in Portlet.xml should be the same as the war
file.
Thanks,
Akshay
Re: Error: The requested resource (/container) is not available
Posted by Prashant <pr...@indicussoftware.com>.
Hi,
I think its related to "contextName" init-param for JetspeedContainer
in your web.xml.
the contextName param should be same as war file name..
regards
prashant
--
Prashant <pr...@indicussoftware.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org