You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by Ken Bowen <kb...@als.com> on 2010/03/15 23:24:58 UTC

Problem with tiles 2.2.1

Hi Antonio,

I have Tiles 2.2.1 starting up ok under Google App Engine (gae), but  
I'm running into problems.
So I constructed a simple example (based on how I used to do things  
with Tiles 2.0.6) to try to figure things out.
[The exception is copied at the end of this email.]

I have the following pages and files in my gae project:

~war/abc.jsp  [this will be the browser target]
------
<%@ page contentType="text/html;charset=UTF-8" language="java"  
session="false" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ page import="com.myapp.*" %>

<tiles:insertDefinition name="xyz1" />

======================================
~war/WEB-INF/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://tiles.apache.org/dtds/tiles-config_2_0.dtd">

<tiles-definitions>
       <definition name="xyz1"                template="/layouts/ 
test.jsp">
           <put-attribute name="page_title"   value="My Page" />
       </definition>
</tiles-definitions>

======================================
In ~war/WEB-INF/web.xml:
------

     <servlet>
       <servlet-name>tiles</servlet-name>
       <servlet-class>org.apache.tiles.web.startup.TilesServlet</ 
servlet-class>
       <init-param>
           <param-name>
                  
org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
           </param-name>
           <param-value>
                 /WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath- 
defs.xml
           </param-value>
       </init-param>
       <load-on-startup>2</load-on-startup>
     </servlet>

======================================

~war/layouts/test.jsp
------


-ge contentType="text/html;charset=UTF-8" language="java"  
session="false" %>
<%@page import="java.net.URLDecoder"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3.org/TR/html4/loose.dtd 
">
<html>
<head>
     <title><tiles:getAsString name="page_title"/></title>
</head>
<body>
     <h1><tiles:getAsString name="page_title"/></h1>
</body>
</html>

======================================

However, when I attempt to access http://localhost:8888/abc.jsp, I get  
the exception
copied below.  Can you see what I'm doing wrong?

Thanks in advance,
Ken

Exception:
---------------
HTTP ERROR: 500
INTERNAL_SERVER_ERROR
RequestURI=/abc.jsp

Caused by:
java.lang.NullPointerException
	at  
org 
.apache 
.tiles 
.definition 
.UnresolvingLocaleDefinitionsFactory 
.getDefinition(UnresolvingLocaleDefinitionsFactory.java:102)
	at  
org 
.apache 
.tiles.impl.BasicTilesContainer.getDefinition(BasicTilesContainer.java: 
364)
	at  
org 
.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java: 
618)
	at  
org 
.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java: 
321)
	at  
org 
.apache 
.tiles.template.InsertDefinitionModel.end(InsertDefinitionModel.java: 
105)
	at  
org 
.apache 
.tiles.jsp.taglib.InsertDefinitionTag.doTag(InsertDefinitionTag.java: 
278)
	at  
org 
.apache.jsp.abc_jsp._jspx_meth_tiles_insertDefinition_0(abc_jsp.java:68)
	at org.apache.jsp.abc_jsp._jspService(abc_jsp.java:45)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
	at  
org 
.apache 
.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
	at  
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	at com.google.appengine.tools.development.PrivilegedJspServlet.access 
$101(PrivilegedJspServlet.java:23)
	at com.google.appengine.tools.development.PrivilegedJspServlet 
$2.run(PrivilegedJspServlet.java:59)
	at java.security.AccessController.doPrivileged(Native Method)
	at  
com 
.google 
.appengine 
.tools 
.development.PrivilegedJspServlet.service(PrivilegedJspServlet.java:57)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java: 
487)
	at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1093)
	at  
com 
.google 
.appengine 
.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:51)
	at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1084)
	at  
com 
.google 
.apphosting 
.utils 
.servlet 
.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
	at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1084)
	at  
com 
.google 
.appengine 
.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:121)
	at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1084)
	at  
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
	at  
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 
216)
	at  
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at  
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 
405)
	at  
com 
.google 
.apphosting 
.utils 
.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java: 
70)
	at  
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at com.google.appengine.tools.development.JettyContainerService 
$ApiProxyHandler.handle(JettyContainerService.java:352)
	at  
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at org.mortbay.jetty.Server.handle(Server.java:313)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 
506)
	at org.mortbay.jetty.HttpConnection 
$RequestHandler.headerComplete(HttpConnection.java:830)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
	at  
org 
.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 
396)
	at org.mortbay.thread.BoundedThreadPool 
$PoolThread.run(BoundedThreadPool.java:442)
Powered by Jetty://























Re: Problem with tiles 2.2.1

Posted by Ken Bowen <kb...@als.com>.
Sure.   I file the JIRA issue as soon as I can.
Quick question:  Is the "double evaluation" problem fixed in 2.1.4?

Thanks,
Ken

On Mar 16, 2010, at 4:47 AM, Antonio Petrelli wrote:

> 2010/3/15 Ken Bowen <kb...@als.com>:
>> Caused by:
>> java.lang.NullPointerException
>>        at
>> org
>> .apache
>> .tiles
>> .definition
>> .UnresolvingLocaleDefinitionsFactory
>> .getDefinition(UnresolvingLocaleDefinitionsFactory.java:102)
>
> Curious, it seems that the locale resolver is null, I think it is a
> bug. Can you open a JIRA issue attaching a test case?
> https://issues.apache.org/jira/browse/TILES
> If you attach a patch, the bug will be resolved faster.
>
> Thanks
> Antonio


Re: [Same as TILES-499] Problem with tiles 2.2.1

Posted by Antonio Petrelli <an...@gmail.com>.
2010/3/16 Ken Bowen <kb...@als.com>:
> Antonio,
>
> On investigating, this appears to be the same Exception as JIRA TILES-499.
> Should I file this anyway to add an additional test case?

No, it's not necessary. However patches are still welcome :-)

Antonio

Re: [Same as TILES-499] Problem with tiles 2.2.1

Posted by Ken Bowen <kb...@als.com>.
Antonio,

On investigating, this appears to be the same Exception as JIRA  
TILES-499.
Should I file this anyway to add an additional test case?

--Ken

On Mar 16, 2010, at 4:47 AM, Antonio Petrelli wrote:

> 2010/3/15 Ken Bowen <kb...@als.com>:
>> Caused by:
>> java.lang.NullPointerException
>>        at
>> org 
>> .apache 
>> .tiles 
>> .definition 
>> .UnresolvingLocaleDefinitionsFactory 
>> .getDefinition(UnresolvingLocaleDefinitionsFactory.java:102)
>
> Curious, it seems that the locale resolver is null, I think it is a
> bug. Can you open a JIRA issue attaching a test case?
> https://issues.apache.org/jira/browse/TILES
> If you attach a patch, the bug will be resolved faster.
>
> Thanks
> Antonio


Re: Problem with tiles 2.2.1

Posted by Antonio Petrelli <an...@gmail.com>.
2010/3/15 Ken Bowen <kb...@als.com>:
> Caused by:
> java.lang.NullPointerException
>        at
> org.apache.tiles.definition.UnresolvingLocaleDefinitionsFactory.getDefinition(UnresolvingLocaleDefinitionsFactory.java:102)

Curious, it seems that the locale resolver is null, I think it is a
bug. Can you open a JIRA issue attaching a test case?
https://issues.apache.org/jira/browse/TILES
If you attach a patch, the bug will be resolved faster.

Thanks
Antonio