aspose file tools*
The moose likes Struts and the fly likes Struts + Tiles Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts + Tiles Error" Watch "Struts + Tiles Error" New topic
Author

Struts + Tiles Error

Harjeet Parmar
Greenhorn

Joined: Jun 10, 2002
Posts: 3
Dear all,

I am trying to deploy a very simple Struts 1.3 application on Tomcat 5.5.20, windows 2000 environment. I am trying to employ the use of Tiles. However, whenever I use the Plugin for Tiles in my struts-config.xml, I get the following error:

___________________________________________________________________________
org.apache.jasper.JasperException: Module 'null' not found.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.NullPointerException: Module 'null' not found.
org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:743)
org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:723)
org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:1086)
org.apache.struts.taglib.TagUtils.message(TagUtils.java:944)
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:221)
org.apache.jsp.index_jsp._jspx_meth_bean_message_0(index_jsp.java:132)
org.apache.jsp.index_jsp._jspx_meth_html_html_0(index_jsp.java:95)
org.apache.jsp.index_jsp._jspService(index_jsp.java:66)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
___________________________________________________________________________

When I comment-out the Tiles plug-in, the page appears to render just fine. Based on some advise I got off of google.com, I made changes to my chain-config.xml, made the appropriate changes to the web.xml, but I am still getting the error. I have include the web.xml, struts-config.xml, tiles-def.xml, and calling JSP code below. Please advise.

WEB.XML
___________________________________________________________________________

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>

<!-- Action Servlet Configuration / Action Servlet Mapping -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</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>5</param-value>
</init-param>
<init-param>
<param-name>mapping</param-name>
<param-value>gov.psc.assetweb.services.PMISAMActionMapping</param-value>
</init-param>
<init-param>
<param-name>chainConfig</param-name>
<param-value>org/apache/struts/tiles/chain-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<!-- The Welcome File List -->

<welcome-file-list>
<welcome-file>proxy.jsp</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>

___________________________________________________________________________


STRUTS_CONFIG.XML

___________________________________________________________________________

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>
<form-beans>
<form-bean name="proxyForm" type="gov.psc.assetweb.framework.models.UserForm"/>
</form-beans>

<global-forwards>
<forward name="proxy" path="/pages/proxy.jsp"/>
</global-forwards>

<action-mappings>
<action
path="/proxy"
type="gov.psc.assetweb.framework.actions.AccMaintenanceMain"
validate="false"
name="proxyForm"
scope="request">
<forward name="SUCCESS" path="/pages/gothere.jsp"/>
</action>
</action-mappings>
<message-resources parameter="gov.psc.assetweb.MessageResources"/>
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml/>
<set-property property="definitions-debug" value="2" />
<set-property property="definitions-parser-details" value="2" />
<set-property property="definitions-parser-validate" value="true" />
<set-property property="moduleAware" value="true" />
</plug-in>
</struts-config>
___________________________________________________________________________

TILES_DEF.XML

<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN" "http://struts.apache.org/dtds/tiles-config_1_3.dtd">
<!-- Definitions for Tiles documentation -->

<tiles-definitions>

<!-- ======================================================= -->
<!-- Master definition -->
<!-- ======================================================= -->

<!-- Main page layout used as a root for other pages defintion. -->

<definition name="admin.mainLayout" path="/layouts/defaultPMISAMLayout.jsp">
<put name="title" value="Tiles Blank Site" />
<put name="header" value="/tiles/common/header.jsp" />
<put name="menu" value="site.menu.bar" />
<put name="footer" value="/tiles/common/footer.jsp" />
</definition>

</tiles-definitions>

___________________________________________________________________________

CALLING JSP

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>

<html:html>
<head>
<title><bean:message key="welcome.title"/></title>
<html:base/>
</head>

<body bgcolor="white">
<logic:forward name="proxy"/>
</body>
</html:html>
Zip Ped
Ranch Hand

Joined: Jul 26, 2005
Posts: 336
You could try putting the TLD files under your WEB-INF folder and give the path for the TLD file in the URI as = "/WEB-INF/struts-tiles.def".
Harjeet Parmar
Greenhorn

Joined: Jun 10, 2002
Posts: 3
From the sources off the Struts Website, I was told to remove the .tld declarations in the web.xml.

But: Based on your advice, I did add the declarations to the web.xml and the files, *.tld, to the WEB-INF directory. No dice.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts + Tiles Error