You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Gregg Leichtman <gs...@erols.com> on 2006/10/11 12:26:26 UTC

Tiles Failure in GlassFish: org.apache.tiles.NoSuchDefinitionException

At Greg Reddins suggestion I have moved to GlassFish v2_b20 in an
attempt to get past the need to use the verbatim tag around all non JSF
tags within a tile.

I have run into a problem that seems to be identical to the fixed
problem described in SB-37: <tiles:insert> tag does not support
correctly the "name" attribute.

Here are what I believe are pertinent snippets from various pieces of my
webapp.

/tiles-defs.xml:

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

 <!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
       "http://struts.apache.org/dtds/tiles-config_2_0.dtd">

<tiles-definitions>

        <!-- Display Definitions -->
   
    <definition name="/mainLayout" path="/tiles/layouts/siteLayout.jsp">
        <put name="htmlHeader" type="template"
value="/tiles/htmlHeaderTile.jsp"/>
        <put name="header" type="template" value="/tiles/headerTile.jsp"/>
        <put name="rightSideBar" type="template"
value="/tiles/rightSideBarTile.jsp"/>
        <put name="footer" type="template" value="/tiles/footerTile.jsp"/>
    </definition>

    <definition name="/welcomePage" extends="/mainLayout">
        <put name="content" type="template" value="/tiles/homeTile.jsp"/>
    </definition>

</tiles-definitions>

/web.xml:

...
  <!-- Welcome File List -->
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
...

/index.jsp:

<jsp:forward page="/tiles/layouts/siteLayout.faces"/>

/tiles/layouts/siteLayout.jsp

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>


<html lang="en">
<f:view>
    <head>
        <base
href="http://localhost:8080/TilesBug/tiles/layouts/siteLayout.jsp">
        <title><h:outputText value="This is a title."/></title>
        <f:subview id="id1"><tiles:insert name="htmlHeader"
flush="false"/></f:subview>
    </head>
   
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"
style="margin:0;padding:0">

        <!-- Header and Menu -->
        <h:outputText value="this is some text."/>
        <h:inputText/>
    </body>
</f:view>
</html>

/tiles/htmlHeaderTile.jsp

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<f:verbatim><meta name="keywords" content="keyword1 keyword2">
<title></f:verbatim><h:outputText value="Some title
text."/><f:verbatim></title>
<link rel="shortcut icon" href="favicon.ico"
type="image/x-icon"></f:verbatim>

I am using the following libs:

commons-beanutils-1.7.0.jar
commons-chain-1.1.jar
commons-digester-1.7.jar
commons-logging-1.1.jar
javaee.jar
jsf-impl.jar
shale-core-1.0.4-SNAPSHOT.jar
shale-spring-1.0.4-SNAPSHOT.jar
shale-tiles-1.0.4-SNAPSHOT.jar
spring-beans-1.2.8.jar
spring-context-1.2.8.jar
spring-core-1.2.8.jar
spring-web-1.2.8.jar
tiles-core-2.0-SNAPSHOT-20060922.jar

The javaee and jsf-impl jars came directly from the latest j2ee 5
installation.

I have successfully gotten the siteLayout.jsp page to render, if the
tiles:insert tag is commented out, so I know that JSF is getting that
far. I have also used the tiles-defs.xml and web.xml files in my
previous Tomcat tests successfully albeit with the verbatim tags
peppered all over the place. Does anyone see why I should receive the
following exceptions:

[#|2006-10-11T05:47:11.145-0400|SEVERE|sun-appserver-pe9.1|javax.enterprise.system.container.web|_ThreadID=12;_ThreadName=httpWorkerThread-8080-1;_RequestID=b9de8883-434e-4aac-b919-73480e7c1a4b;|ApplicationDispatcher[/tilestest3]
PWC1231: Servlet.service() for servlet jsp threw exception
org.apache.tiles.NoSuchDefinitionException
    at
org.apache.tiles.taglib.InsertTag.processDefinitionName(InsertTag.java:486)
    at org.apache.tiles.taglib.InsertTag.processName(InsertTag.java:452)
    ...

[#|2006-10-11T05:47:11.222-0400|WARNING|sun-appserver-pe9.1|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=12;_ThreadName=httpWorkerThread-8080-1;_RequestID=b9de8883-434e-4aac-b919-73480e7c1a4b;|executePhase(RENDER_RESPONSE
6,com.sun.faces.context.FacesContextImpl@178f2b) threw exception
javax.faces.FacesException: javax.servlet.ServletException: Error -  Tag
Insert : Can't get definition 'null'. Check if this name exists in
definitions factory.
    at
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:418)
    at
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:410)
    at
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:112)
    at
org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:175)
    ...

                               -=> Gregg <=-