You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andreas Pardeike <ap...@fsys.se> on 2009/04/03 13:28:13 UTC

Re: [ANNOUNCE] Tapestry 5.1.0.2 - "failed due to recursion"

Unfortunately, one of my key concepts in a big application I am  
developing
stops working in the step from 5.1.0.1 -> 5.1.0.2. Our application has  
all page
classes inside a subfolder, thus our internal tapestry pages all look  
like

http://hostname/klubb/page

and there is one tapestry page 'dynamic' that handles all requests  
without
the prefixing /klubb :

http://hostname/something/else.html

where it looks up '/something/else.html' from a database. The  
configuration
for this is set up like this:


public void contributeHttpServletRequestHandler(
             OrderedConfiguration<HttpServletRequestFilter>  
configuration,
             Global global,
             ClubConfiguration clubconf)
{
   configuration.add("CustomContenHandler", new  
CustomContentHandler(global, clubconf),
                        "before:IgnoredPaths");
}


and the corresponding class:


public class CustomContentHandler implements HttpServletRequestFilter
{
   private static String contentType;

   private final Global _global;
   private final ClubConfiguration _configuration;

   private final Pattern clubAssetsMatcher;

   private enum RequestType
   {
     START_PAGE, DYNAMIC_PAGE, TAPESTRY_ACTION
   };

   // this class is used to overwrite getServletPath for inserting our  
own
   // t5
   // page at the beginning of the path
   //
   private class MyHTTPServletRequest extends HttpServletRequestWrapper
   {
     private final RequestType _type;

     public MyHTTPServletRequest(HttpServletRequest  
httpServletRequest, RequestType type)
     {
       super(httpServletRequest);
       _type = type;
     }

     @Override
     public String getServletPath()
     {
       String path = super.getServletPath();

       if(_type == RequestType.START_PAGE)
       {
         if(path.equals("/"))
           path = Constants.STARTPAGE;
         return path;
       }

       if(_type == RequestType.DYNAMIC_PAGE)
         return Constants.DYNAMIC_CLUB_URL + path.toLowerCase();

       if(_type == RequestType.TAPESTRY_ACTION)
         return Constants.TAPESTRY_ACTION_PREFIX + path;

       return path;
     }
   }

   public CustomContentHandler(final Global global, final  
ClubConfiguration configuration)
   {
     _global = global;
     _configuration = configuration;

     String regExp = ".*\\.(";

     Iterator<String> iterator = getSuffixes().keySet().iterator();
     while(iterator.hasNext())
     {
       regExp = regExp + (getSuffixes().size() == 0 ? "" : "|") +  
iterator.next();

     }
     clubAssetsMatcher = Pattern.compile(regExp + ")");
   }

   public boolean service(HttpServletRequest request,  
HttpServletResponse response, HttpServletRequestHandler handler)  
throws IOException
   {
     String path = request.getServletPath().toLowerCase();

     if(path.equals("/") ||  
path.startsWith(Constants.TAPESTRY_ACTION_PREFIX + "/"))
     {
       MyHTTPServletRequest newRequest = new  
MyHTTPServletRequest(request, RequestType.START_PAGE);
       return handler.service(newRequest, response);
     }

     if(path.startsWith(Constants.PRIVATE_ASSETS_PREFIX + "/"))
       return handler.service(request, response);

     if(path.startsWith(Constants.PRIVATE_DYNAMIC_ACTION_PREFIX) ||  
path.startsWith(Constants.PRIVATE_STARTPAGE_ACTION_PREFIX))
     {
       MyHTTPServletRequest newRequest = new  
MyHTTPServletRequest(request, RequestType.TAPESTRY_ACTION);
       return handler.service(newRequest, response);
     }

     int club = _configuration.getClubNumberFromRequest(request);

     Map<String,Object> keys = new HashMap<String,Object>();
     keys.put(Dynamic.CLUB_PROPERTY, club);
     keys.put(Dynamic.PATH_PROPERTY, path);
     keys.put(Dynamic.PART_PROPERTY, "");

     Expression condition = ExpressionFactory.matchAllDbExp(keys,  
Expression.EQUAL_TO);
     SelectQuery query = new SelectQuery(Dynamic.class, condition);
     query.setName("#" + club + ":" + path + ":");
     query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
     List<Dynamic> rows =  
_global.getReadOnlyObjectContext().performQuery(query);
     Dynamic dynamic = rows.size() == 1 ? rows.get(0) : null;

     // pass handling if this is a private asset (i.e. images that we
     // use in our templates)
     //
     Matcher match = clubAssetsMatcher.matcher(path);
     if(match.matches())
     {
       contentType = getSuffixes().get(match.group(1));
       if(dynamic != null)
       {
         response.setContentType(contentType);
         ServletOutputStream out = response.getOutputStream();
         out.write(dynamic.getData());
         out.close();

         return true;
       }

       return false;
     }

     // test for customer pages but exclude our own pages
     //
     if(dynamic != null)
     {
       MyHTTPServletRequest newRequest = new  
MyHTTPServletRequest(request, RequestType.DYNAMIC_PAGE);
       return handler.service(newRequest, response);
     }

     response.sendError(404);
     return true;
   }

   public Map<String,String> getSuffixes()
   {
     Map<String,String> suffixes = new HashMap<String,String>();

     suffixes.put("ico", "image/x-icon");
     suffixes.put("css", "text/css");
     suffixes.put("js", "text/javascript");
     suffixes.put("gif", "image/gif");
     suffixes.put("jpg", "image/jpeg");
     suffixes.put("jpeg", "image/jpeg");
     suffixes.put("png", "image/png");
     suffixes.put("tif", "mage/tif");
     suffixes.put("tiff", "mage/tiff");
     suffixes.put("pdf", "application/pdf");
     suffixes.put("xml", "text/xml");
     suffixes.put("doc", "application/msword");
     suffixes.put("docx", "application/msword");
     suffixes.put("xsl", "application/x-excel");
     suffixes.put("txt", "text/plain");
     suffixes.put("gzip", "application/x-gzip");
     suffixes.put("zip", "application/zip");
     suffixes.put("tar", "application/x-tar");
     suffixes.put("cab", "application/octet-stream");
     suffixes.put("dmg", "application/octet-stream");
     suffixes.put("tgz", "application/x-tar");
     suffixes.put("rar", "application/x-rar-compressed");
     suffixes.put("exe", "application/octet-stream");
     suffixes.put("mp3", "application/octet-stream");
     suffixes.put("wav", "application/octet-stream");
     suffixes.put("aac", "application/octet-stream");
     suffixes.put("ra", "application/octet-stream");
     suffixes.put("wma", "application/octet-stream");
     suffixes.put("mov", "application/octet-stream");
     suffixes.put("mp4", "application/octet-stream");
     suffixes.put("wmv", "application/octet-stream");
     suffixes.put("avi", "application/octet-stream");

     return suffixes;
   }
}


The stack trace is here:

java.lang.RuntimeException: Exception constructing service  
'HttpServletRequestHandler': Construction of service  
'HttpServletRequestHandler' has failed due to recursion: the service  
depends on itself in some way. Please check  
org 
.apache 
.tapestry5 
.services.TapestryModule.buildHttpServletRequestHandler(Logger, List,  
RequestHandler, String, SessionPersistedObjectAnalyzer) (at  
TapestryModule.java:1222) for references to another service that is  
itself dependent on service 'HttpServletRequestHandler'.
	at  
org 
.apache 
.tapestry5 
.ioc 
.internal 
.services 
.JustInTimeObjectCreator 
.obtainObjectFromCreator(JustInTimeObjectCreator.java:78)
	at  
org 
.apache 
.tapestry5 
.ioc 
.internal 
.services 
.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:57)
	at  
$ 
HttpServletRequestHandler_1206bab64a5 
.delegate($HttpServletRequestHandler_1206bab64a5.java)
	at  
$ 
HttpServletRequestHandler_1206bab64a5 
.service($HttpServletRequestHandler_1206bab64a5.java)
	at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java: 
127)
	at org.mortbay.jetty.servlet.ServletHandler 
$CachedChain.doFilter(ServletHandler.java:1084)
	at  
org 
.apache 
.cayenne 
.conf 
.WebApplicationContextFilter.doFilter(WebApplicationContextFilter.java: 
90)
	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:722)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 
404)
	at  
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at org.mortbay.jetty.Server.handle(Server.java:324)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 
505)
	at org.mortbay.jetty.HttpConnection 
$RequestHandler.headerComplete(HttpConnection.java:828)
	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:380)
	at  
org 
.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 
395)
	at org.mortbay.thread.BoundedThreadPool 
$PoolThread.run(BoundedThreadPool.java:450)
Caused by: org.apache.tapestry5.ioc.internal.OperationException:  
Construction of service 'HttpServletRequestHandler' has failed due to  
recursion: the service depends on itself in some way. Please check  
org 
.apache 
.tapestry5 
.services.TapestryModule.buildHttpServletRequestHandler(Logger, List,  
RequestHandler, String, SessionPersistedObjectAnalyzer) (at  
TapestryModule.java:1222) for references to another service that is  
itself dependent on service 'HttpServletRequestHandler'.
	at  
org 
.apache 
.tapestry5 
.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:90)
	at  
org 
.apache 
.tapestry5 
.ioc 
.internal 
.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
	at  
org 
.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java: 
941)
	at  
org 
.apache 
.tapestry5 
.ioc 
.internal 
.OperationTrackingObjectCreator 
.createObject(OperationTrackingObjectCreator.java:49)
	at  
org 
.apache 
.tapestry5 
.ioc 
.internal 
.services 
.JustInTimeObjectCreator 
.obtainObjectFromCreator(JustInTimeObjectCreator.java:68)
	... 21 more
Caused by: java.lang.IllegalStateException: Construction of service  
'HttpServletRequestHandler' has failed due to recursion: the service  
depends on itself in some way. Please check  
org 
.apache 
.tapestry5 
.services.TapestryModule.buildHttpServletRequestHandler(Logger, List,  
RequestHandler, String, SessionPersistedObjectAnalyzer) (at  
TapestryModule.java:1222) for references to another service that is  
itself dependent on service 'HttpServletRequestHandler'.
	at  
org 
.apache 
.tapestry5 
.ioc 
.internal 
.RecursiveServiceCreationCheckWrapper 
.createObject(RecursiveServiceCreationCheckWrapper.java:52)
	at org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator 
$1.invoke(OperationTrackingObjectCreator.java:45)
	at  
org 
.apache 
.tapestry5 
.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:68)
	... 25 more


On 3 apr 2009, at 01.41, Howard Lewis Ship wrote:

> The latest alpha release of Tapestry 5.1, Tapestry 5.1.0.2, is now
> available for download and via Maven.
>
> Please download it and give it a try; we're especially interested in
> any problems related to the upgrade from 5.0.18 to 5.1.0.2.
>
> Big features added in 5.1.0.2 include automatic combining of
> JavaScript files, a new client-side JavaScript console based on
> Blackbird, and the ability to have a single Ajax response update
> multiple client-side Zones.
>
> We are now stabilizing Tapestry 5.1 for a beta release and, if all
> goes according to plan, a short period until a stable 5.1 release.
>
> -- 
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [ANNOUNCE] Tapestry 5.1.0.2 - "failed due to recursion"

Posted by Howard Lewis Ship <hl...@gmail.com>.
You should be seeing more detailed logging in your console that will
be most helpful in determining what's going on here.

On Fri, Apr 3, 2009 at 6:53 AM, Andreas Pardeike <ap...@fsys.se> wrote:
> Hi,
>
> Maybe I got this pinpoint a bit more. My question is: how do I customize
> the template locator so it works with 5.1.0.2 ?
>
> I have:
>
>> // 1) we configure the factory that generates the HTMLPageLocator. this
>> allows us to define that it will be constructed with two input parameters
>> hat it needs: contextRoot and a resolver (we need this build method because
>> the first parameter in the constructor has a method call)
>> //
>> public PageTemplateLocator buildHTMLPageLocator(@ContextProvider
>> AssetFactory contextAssetFactory, ComponentClassResolver
>> componentClassResolver)
>> {
>>  return new HTMLTemplateLocator(contextAssetFactory.getRootResource(),
>> componentClassResolver, productionMode);
>> }
>>
>> // 2) we overwrite the original service with our new implementation
>> //
>> public static void
>> contributeAliasOverrides(@InjectService("HTMLPageLocator")
>> PageTemplateLocator locator,
>> Configuration<AliasContribution<PageTemplateLocator>> configuration)
>> {
>>  configuration.add(AliasContribution.create(PageTemplateLocator.class,
>> locator));
>> }
>
> and
>
>> public class HTMLTemplateLocator implements PageTemplateLocator
>> {
>>  private final Resource _contextRoot;
>>  private final ComponentClassResolver _resolver;
>>
>>  public HTMLTemplateLocator(Resource contextRoot, ComponentClassResolver
>> resolver)
>>  {
>>    _contextRoot = contextRoot;
>>    _resolver = resolver;
>>  }
>>
>>  public Resource findPageTemplateResource(ComponentModel model, Locale
>> locale)
>>  {
>>    String className = model.getComponentClassName();
>>    if(!className.contains(".pages."))
>>      return null;
>>
>>    String logicalName =
>> _resolver.resolvePageClassNameToPageName(className);
>>    int slashx = logicalName.lastIndexOf('/');
>>    if(slashx > 0)
>>    {
>>      String simpleClassName = InternalUtils.lastTerm(className);
>>      logicalName = logicalName.substring(0, slashx + 1) + simpleClassName;
>>    }
>>
>>    String path = format("pages/%s.%s", logicalName,
>> "html"/*InternalConstants.TEMPLATE_EXTENSION*/);
>>    return _contextRoot.forFile(path).forLocale(locale);
>>  }
>> }
>
> I have commented out all other contributions, services and custom code in my
> AppModules except for the template locator overwrite. So it seems that this
> one is the culprit for the recursion exception I get with 5.1.0.2
>
> /Andreas
>
>
>
> On 3 apr 2009, at 13.28, Andreas Pardeike wrote:
>
>> Unfortunately, one of my key concepts in a big application I am developing
>> stops working in the step from 5.1.0.1 -> 5.1.0.2. Our application has all
>> page
>> classes inside a subfolder, thus our internal tapestry pages all look like
>>
>> http://hostname/klubb/page
>>
>> and there is one tapestry page 'dynamic' that handles all requests without
>> the prefixing /klubb :
>>
>> http://hostname/something/else.html
>>
>> where it looks up '/something/else.html' from a database. The
>> configuration
>> for this is set up like this:
>>
>>
>> public void contributeHttpServletRequestHandler(
>>           OrderedConfiguration<HttpServletRequestFilter> configuration,
>>           Global global,
>>           ClubConfiguration clubconf)
>> {
>>  configuration.add("CustomContenHandler", new CustomContentHandler(global,
>> clubconf),
>>                      "before:IgnoredPaths");
>> }
>>
>>
>> and the corresponding class:
>>
>>
>> public class CustomContentHandler implements HttpServletRequestFilter
>> {
>>  private static String contentType;
>>
>>  private final Global _global;
>>  private final ClubConfiguration _configuration;
>>
>>  private final Pattern clubAssetsMatcher;
>>
>>  private enum RequestType
>>  {
>>   START_PAGE, DYNAMIC_PAGE, TAPESTRY_ACTION
>>  };
>>
>>  // this class is used to overwrite getServletPath for inserting our own
>>  // t5
>>  // page at the beginning of the path
>>  //
>>  private class MyHTTPServletRequest extends HttpServletRequestWrapper
>>  {
>>   private final RequestType _type;
>>
>>   public MyHTTPServletRequest(HttpServletRequest httpServletRequest,
>> RequestType type)
>>   {
>>     super(httpServletRequest);
>>     _type = type;
>>   }
>>
>>   @Override
>>   public String getServletPath()
>>   {
>>     String path = super.getServletPath();
>>
>>     if(_type == RequestType.START_PAGE)
>>     {
>>       if(path.equals("/"))
>>         path = Constants.STARTPAGE;
>>       return path;
>>     }
>>
>>     if(_type == RequestType.DYNAMIC_PAGE)
>>       return Constants.DYNAMIC_CLUB_URL + path.toLowerCase();
>>
>>     if(_type == RequestType.TAPESTRY_ACTION)
>>       return Constants.TAPESTRY_ACTION_PREFIX + path;
>>
>>     return path;
>>   }
>>  }
>>
>>  public CustomContentHandler(final Global global, final ClubConfiguration
>> configuration)
>>  {
>>   _global = global;
>>   _configuration = configuration;
>>
>>   String regExp = ".*\\.(";
>>
>>   Iterator<String> iterator = getSuffixes().keySet().iterator();
>>   while(iterator.hasNext())
>>   {
>>     regExp = regExp + (getSuffixes().size() == 0 ? "" : "|") +
>> iterator.next();
>>
>>   }
>>   clubAssetsMatcher = Pattern.compile(regExp + ")");
>>  }
>>
>>  public boolean service(HttpServletRequest request, HttpServletResponse
>> response, HttpServletRequestHandler handler) throws IOException
>>  {
>>   String path = request.getServletPath().toLowerCase();
>>
>>   if(path.equals("/") || path.startsWith(Constants.TAPESTRY_ACTION_PREFIX
>> + "/"))
>>   {
>>     MyHTTPServletRequest newRequest = new MyHTTPServletRequest(request,
>> RequestType.START_PAGE);
>>     return handler.service(newRequest, response);
>>   }
>>
>>   if(path.startsWith(Constants.PRIVATE_ASSETS_PREFIX + "/"))
>>     return handler.service(request, response);
>>
>>   if(path.startsWith(Constants.PRIVATE_DYNAMIC_ACTION_PREFIX) ||
>> path.startsWith(Constants.PRIVATE_STARTPAGE_ACTION_PREFIX))
>>   {
>>     MyHTTPServletRequest newRequest = new MyHTTPServletRequest(request,
>> RequestType.TAPESTRY_ACTION);
>>     return handler.service(newRequest, response);
>>   }
>>
>>   int club = _configuration.getClubNumberFromRequest(request);
>>
>>   Map<String,Object> keys = new HashMap<String,Object>();
>>   keys.put(Dynamic.CLUB_PROPERTY, club);
>>   keys.put(Dynamic.PATH_PROPERTY, path);
>>   keys.put(Dynamic.PART_PROPERTY, "");
>>
>>   Expression condition = ExpressionFactory.matchAllDbExp(keys,
>> Expression.EQUAL_TO);
>>   SelectQuery query = new SelectQuery(Dynamic.class, condition);
>>   query.setName("#" + club + ":" + path + ":");
>>   query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
>>   List<Dynamic> rows =
>> _global.getReadOnlyObjectContext().performQuery(query);
>>   Dynamic dynamic = rows.size() == 1 ? rows.get(0) : null;
>>
>>   // pass handling if this is a private asset (i.e. images that we
>>   // use in our templates)
>>   //
>>   Matcher match = clubAssetsMatcher.matcher(path);
>>   if(match.matches())
>>   {
>>     contentType = getSuffixes().get(match.group(1));
>>     if(dynamic != null)
>>     {
>>       response.setContentType(contentType);
>>       ServletOutputStream out = response.getOutputStream();
>>       out.write(dynamic.getData());
>>       out.close();
>>
>>       return true;
>>     }
>>
>>     return false;
>>   }
>>
>>   // test for customer pages but exclude our own pages
>>   //
>>   if(dynamic != null)
>>   {
>>     MyHTTPServletRequest newRequest = new MyHTTPServletRequest(request,
>> RequestType.DYNAMIC_PAGE);
>>     return handler.service(newRequest, response);
>>   }
>>
>>   response.sendError(404);
>>   return true;
>>  }
>>
>>  public Map<String,String> getSuffixes()
>>  {
>>   Map<String,String> suffixes = new HashMap<String,String>();
>>
>>   suffixes.put("ico", "image/x-icon");
>>   suffixes.put("css", "text/css");
>>   suffixes.put("js", "text/javascript");
>>   suffixes.put("gif", "image/gif");
>>   suffixes.put("jpg", "image/jpeg");
>>   suffixes.put("jpeg", "image/jpeg");
>>   suffixes.put("png", "image/png");
>>   suffixes.put("tif", "mage/tif");
>>   suffixes.put("tiff", "mage/tiff");
>>   suffixes.put("pdf", "application/pdf");
>>   suffixes.put("xml", "text/xml");
>>   suffixes.put("doc", "application/msword");
>>   suffixes.put("docx", "application/msword");
>>   suffixes.put("xsl", "application/x-excel");
>>   suffixes.put("txt", "text/plain");
>>   suffixes.put("gzip", "application/x-gzip");
>>   suffixes.put("zip", "application/zip");
>>   suffixes.put("tar", "application/x-tar");
>>   suffixes.put("cab", "application/octet-stream");
>>   suffixes.put("dmg", "application/octet-stream");
>>   suffixes.put("tgz", "application/x-tar");
>>   suffixes.put("rar", "application/x-rar-compressed");
>>   suffixes.put("exe", "application/octet-stream");
>>   suffixes.put("mp3", "application/octet-stream");
>>   suffixes.put("wav", "application/octet-stream");
>>   suffixes.put("aac", "application/octet-stream");
>>   suffixes.put("ra", "application/octet-stream");
>>   suffixes.put("wma", "application/octet-stream");
>>   suffixes.put("mov", "application/octet-stream");
>>   suffixes.put("mp4", "application/octet-stream");
>>   suffixes.put("wmv", "application/octet-stream");
>>   suffixes.put("avi", "application/octet-stream");
>>
>>   return suffixes;
>>  }
>> }
>>
>>
>> The stack trace is here:
>>
>> java.lang.RuntimeException: Exception constructing service
>> 'HttpServletRequestHandler': Construction of service
>> 'HttpServletRequestHandler' has failed due to recursion: the service depends
>> on itself in some way. Please check
>> org.apache.tapestry5.services.TapestryModule.buildHttpServletRequestHandler(Logger,
>> List, RequestHandler, String, SessionPersistedObjectAnalyzer) (at
>> TapestryModule.java:1222) for references to another service that is itself
>> dependent on service 'HttpServletRequestHandler'.
>>        at
>> org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:78)
>>        at
>> org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:57)
>>        at
>> $HttpServletRequestHandler_1206bab64a5.delegate($HttpServletRequestHandler_1206bab64a5.java)
>>        at
>> $HttpServletRequestHandler_1206bab64a5.service($HttpServletRequestHandler_1206bab64a5.java)
>>        at
>> org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127)
>>        at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>>        at
>> org.apache.cayenne.conf.WebApplicationContextFilter.doFilter(WebApplicationContextFilter.java:90)
>>        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:722)
>>        at
>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404)
>>        at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>>        at org.mortbay.jetty.Server.handle(Server.java:324)
>>        at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
>>        at
>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
>>        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:380)
>>        at
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
>>        at
>> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
>> Caused by: org.apache.tapestry5.ioc.internal.OperationException:
>> Construction of service 'HttpServletRequestHandler' has failed due to
>> recursion: the service depends on itself in some way. Please check
>> org.apache.tapestry5.services.TapestryModule.buildHttpServletRequestHandler(Logger,
>> List, RequestHandler, String, SessionPersistedObjectAnalyzer) (at
>> TapestryModule.java:1222) for references to another service that is itself
>> dependent on service 'HttpServletRequestHandler'.
>>        at
>> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:90)
>>        at
>> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
>>        at
>> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:941)
>>        at
>> org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator.createObject(OperationTrackingObjectCreator.java:49)
>>        at
>> org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:68)
>>        ... 21 more
>> Caused by: java.lang.IllegalStateException: Construction of service
>> 'HttpServletRequestHandler' has failed due to recursion: the service depends
>> on itself in some way. Please check
>> org.apache.tapestry5.services.TapestryModule.buildHttpServletRequestHandler(Logger,
>> List, RequestHandler, String, SessionPersistedObjectAnalyzer) (at
>> TapestryModule.java:1222) for references to another service that is itself
>> dependent on service 'HttpServletRequestHandler'.
>>        at
>> org.apache.tapestry5.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:52)
>>        at
>> org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45)
>>        at
>> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:68)
>>        ... 25 more
>>
>>
>> On 3 apr 2009, at 01.41, Howard Lewis Ship wrote:
>>
>>> The latest alpha release of Tapestry 5.1, Tapestry 5.1.0.2, is now
>>> available for download and via Maven.
>>>
>>> Please download it and give it a try; we're especially interested in
>>> any problems related to the upgrade from 5.0.18 to 5.1.0.2.
>>>
>>> Big features added in 5.1.0.2 include automatic combining of
>>> JavaScript files, a new client-side JavaScript console based on
>>> Blackbird, and the ability to have a single Ajax response update
>>> multiple client-side Zones.
>>>
>>> We are now stabilizing Tapestry 5.1 for a beta release and, if all
>>> goes according to plan, a short period until a stable 5.1 release.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Problem using tapx-datefield

Posted by Blšták Peter <pe...@softec.sk>.
Thanks for guide.

I did not say, that I use RunJettyRun using simple Java project in Eclipse and project classes and libraries are not copied to <context_root>/WEB-INF/(lib|classes) (they are only in RunJettyRun run configuration classpath).

So, adding VM directive 
-Dorg.mortbay.jetty.webapp.parentLoaderPriority=true
to run configuration solved the problem.

P.

________________________________________
From: Howard Lewis Ship [hlship@gmail.com]
Sent: Friday, April 03, 2009 6:04 PM
To: Tapestry users
Subject: Re: Problem using tapx-datefield

Looks like you have a classpath problem, probably two copies of
tapestry-ioc.jar in two different places (and two different class
loaders).

2009/4/3 Blšták Peter <pe...@softec.sk>:
> Hi,
>
> I have tried tapx-datefield module downloaded from formos snapshot repository.
> Since I added downloaded jar (this one tapx-datefield-1.0.0-20090403.121507-20.jar) to application classpath I got this error (bellow).
>
> I use jetty, jre 1.6.0_11-b03 and have tried using tapestry-5.1.0.1 and 5.1.0.2.
>
> Tapx-datefield sources looks OK.
>
> Any idea?
>
> Thanks
>
> P.
>
>
>
> [INFO] mortbay.log jetty-6.1.6
> [INFO] ioc.RegistryBuilder Adding module definition for class org.apache.tapestry5.ioc.services.TapestryIOCModule
> [INFO] ioc.RegistryBuilder Adding module definition for class com.formos.tapestry.tapx.datefield.services.DateFieldModule
> [ERROR] mortbay.log failed app
> java.lang.RuntimeException: Exception loading module(s) from manifest jar:file:/C:/.../tapx-datefield-1.0.0-SNAPSHOT.jar!/META-INF/MANIFEST.MF: Failure loading Tapestry IoC module class com.formos.tapestry.tapx.datefield.services.DateFieldModule: Service contribution method com.formos.tapestry.tapx.datefield.services.DateFieldModule.contributeBeanBlockOverrideSource(Configuration) does not contain a parameter of type Configuration, OrderedConfiguration or MappedConfiguration. This parameter is how the method make contributions into the service's configuration.
>        at org.apache.tapestry5.ioc.IOCUtilities.addModulesInManifest(IOCUtilities.java:123)
>        at org.apache.tapestry5.ioc.IOCUtilities.addDefaultModules(IOCUtilities.java:77)
>        at org.apache.tapestry5.internal.TapestryAppInitializer.<init>(TapestryAppInitializer.java:85)
>        at org.apache.tapestry5.TapestryFilter.init(TapestryFilter.java:74)
>        at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
>        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>        at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:589)
>        at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
>        at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1216)
>        at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:509)
>        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:447)
>        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>        at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
>        at org.mortbay.jetty.Server.doStart(Server.java:222)
>        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>        at runjettyrun.Bootstrap.main(Bootstrap.java:76)
> Caused by: java.lang.RuntimeException: Failure loading Tapestry IoC module class com.formos.tapestry.tapx.datefield.services.DateFieldModule: Service contribution method com.formos.tapestry.tapx.datefield.services.DateFieldModule.contributeBeanBlockOverrideSource(Configuration) does not contain a parameter of type Configuration, OrderedConfiguration or MappedConfiguration. This parameter is how the method make contributions into the service's configuration.
>        at org.apache.tapestry5.ioc.RegistryBuilder.add(RegistryBuilder.java:155)
>        at org.apache.tapestry5.ioc.IOCUtilities.addModulesInList(IOCUtilities.java:137)
>        at org.apache.tapestry5.ioc.IOCUtilities.addModulesInManifest(IOCUtilities.java:107)
>        ... 15 more
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



--
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Problem using tapx-datefield

Posted by Howard Lewis Ship <hl...@gmail.com>.
Looks like you have a classpath problem, probably two copies of
tapestry-ioc.jar in two different places (and two different class
loaders).

2009/4/3 Blšták Peter <pe...@softec.sk>:
> Hi,
>
> I have tried tapx-datefield module downloaded from formos snapshot repository.
> Since I added downloaded jar (this one tapx-datefield-1.0.0-20090403.121507-20.jar) to application classpath I got this error (bellow).
>
> I use jetty, jre 1.6.0_11-b03 and have tried using tapestry-5.1.0.1 and 5.1.0.2.
>
> Tapx-datefield sources looks OK.
>
> Any idea?
>
> Thanks
>
> P.
>
>
>
> [INFO] mortbay.log jetty-6.1.6
> [INFO] ioc.RegistryBuilder Adding module definition for class org.apache.tapestry5.ioc.services.TapestryIOCModule
> [INFO] ioc.RegistryBuilder Adding module definition for class com.formos.tapestry.tapx.datefield.services.DateFieldModule
> [ERROR] mortbay.log failed app
> java.lang.RuntimeException: Exception loading module(s) from manifest jar:file:/C:/.../tapx-datefield-1.0.0-SNAPSHOT.jar!/META-INF/MANIFEST.MF: Failure loading Tapestry IoC module class com.formos.tapestry.tapx.datefield.services.DateFieldModule: Service contribution method com.formos.tapestry.tapx.datefield.services.DateFieldModule.contributeBeanBlockOverrideSource(Configuration) does not contain a parameter of type Configuration, OrderedConfiguration or MappedConfiguration. This parameter is how the method make contributions into the service's configuration.
>        at org.apache.tapestry5.ioc.IOCUtilities.addModulesInManifest(IOCUtilities.java:123)
>        at org.apache.tapestry5.ioc.IOCUtilities.addDefaultModules(IOCUtilities.java:77)
>        at org.apache.tapestry5.internal.TapestryAppInitializer.<init>(TapestryAppInitializer.java:85)
>        at org.apache.tapestry5.TapestryFilter.init(TapestryFilter.java:74)
>        at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
>        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>        at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:589)
>        at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
>        at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1216)
>        at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:509)
>        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:447)
>        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>        at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
>        at org.mortbay.jetty.Server.doStart(Server.java:222)
>        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>        at runjettyrun.Bootstrap.main(Bootstrap.java:76)
> Caused by: java.lang.RuntimeException: Failure loading Tapestry IoC module class com.formos.tapestry.tapx.datefield.services.DateFieldModule: Service contribution method com.formos.tapestry.tapx.datefield.services.DateFieldModule.contributeBeanBlockOverrideSource(Configuration) does not contain a parameter of type Configuration, OrderedConfiguration or MappedConfiguration. This parameter is how the method make contributions into the service's configuration.
>        at org.apache.tapestry5.ioc.RegistryBuilder.add(RegistryBuilder.java:155)
>        at org.apache.tapestry5.ioc.IOCUtilities.addModulesInList(IOCUtilities.java:137)
>        at org.apache.tapestry5.ioc.IOCUtilities.addModulesInManifest(IOCUtilities.java:107)
>        ... 15 more
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Problem using tapx-datefield

Posted by Blšták Peter <pe...@softec.sk>.
Hi,

I have tried tapx-datefield module downloaded from formos snapshot repository.
Since I added downloaded jar (this one tapx-datefield-1.0.0-20090403.121507-20.jar) to application classpath I got this error (bellow).

I use jetty, jre 1.6.0_11-b03 and have tried using tapestry-5.1.0.1 and 5.1.0.2.

Tapx-datefield sources looks OK.

Any idea? 

Thanks

P.



[INFO] mortbay.log jetty-6.1.6
[INFO] ioc.RegistryBuilder Adding module definition for class org.apache.tapestry5.ioc.services.TapestryIOCModule
[INFO] ioc.RegistryBuilder Adding module definition for class com.formos.tapestry.tapx.datefield.services.DateFieldModule
[ERROR] mortbay.log failed app
java.lang.RuntimeException: Exception loading module(s) from manifest jar:file:/C:/.../tapx-datefield-1.0.0-SNAPSHOT.jar!/META-INF/MANIFEST.MF: Failure loading Tapestry IoC module class com.formos.tapestry.tapx.datefield.services.DateFieldModule: Service contribution method com.formos.tapestry.tapx.datefield.services.DateFieldModule.contributeBeanBlockOverrideSource(Configuration) does not contain a parameter of type Configuration, OrderedConfiguration or MappedConfiguration. This parameter is how the method make contributions into the service's configuration.
	at org.apache.tapestry5.ioc.IOCUtilities.addModulesInManifest(IOCUtilities.java:123)
	at org.apache.tapestry5.ioc.IOCUtilities.addDefaultModules(IOCUtilities.java:77)
	at org.apache.tapestry5.internal.TapestryAppInitializer.<init>(TapestryAppInitializer.java:85)
	at org.apache.tapestry5.TapestryFilter.init(TapestryFilter.java:74)
	at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
	at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:589)
	at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
	at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1216)
	at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:509)
	at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:447)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
	at org.mortbay.jetty.Server.doStart(Server.java:222)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
	at runjettyrun.Bootstrap.main(Bootstrap.java:76)
Caused by: java.lang.RuntimeException: Failure loading Tapestry IoC module class com.formos.tapestry.tapx.datefield.services.DateFieldModule: Service contribution method com.formos.tapestry.tapx.datefield.services.DateFieldModule.contributeBeanBlockOverrideSource(Configuration) does not contain a parameter of type Configuration, OrderedConfiguration or MappedConfiguration. This parameter is how the method make contributions into the service's configuration.
	at org.apache.tapestry5.ioc.RegistryBuilder.add(RegistryBuilder.java:155)
	at org.apache.tapestry5.ioc.IOCUtilities.addModulesInList(IOCUtilities.java:137)
	at org.apache.tapestry5.ioc.IOCUtilities.addModulesInManifest(IOCUtilities.java:107)
	... 15 more

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [ANNOUNCE] Tapestry 5.1.0.2 - "failed due to recursion"

Posted by Andreas Pardeike <ap...@fsys.se>.
Hi,

Maybe I got this pinpoint a bit more. My question is: how do I customize
the template locator so it works with 5.1.0.2 ?

I have:

> // 1) we configure the factory that generates the HTMLPageLocator.  
> this allows us to define that it will be constructed with two input  
> parameters hat it needs: contextRoot and a resolver (we need this  
> build method because the first parameter in the constructor has a  
> method call)
> //
> public PageTemplateLocator buildHTMLPageLocator(@ContextProvider  
> AssetFactory contextAssetFactory, ComponentClassResolver  
> componentClassResolver)
> {
>   return new  
> HTMLTemplateLocator(contextAssetFactory.getRootResource(),  
> componentClassResolver, productionMode);
> }
> 	
> // 2) we overwrite the original service with our new implementation
> //
> public static void  
> contributeAliasOverrides(@InjectService("HTMLPageLocator")  
> PageTemplateLocator locator,  
> Configuration<AliasContribution<PageTemplateLocator>> configuration)
> {
>    
> configuration 
> .add(AliasContribution.create(PageTemplateLocator.class, locator));
> }

and

> public class HTMLTemplateLocator implements PageTemplateLocator
> {
>   private final Resource _contextRoot;
>   private final ComponentClassResolver _resolver;
>
>   public HTMLTemplateLocator(Resource contextRoot,  
> ComponentClassResolver resolver)
>   {
>     _contextRoot = contextRoot;
>     _resolver = resolver;
>   }
>
>   public Resource findPageTemplateResource(ComponentModel model,  
> Locale locale)
>   {
>     String className = model.getComponentClassName();
>     if(!className.contains(".pages."))
>       return null;
>
>     String logicalName =  
> _resolver.resolvePageClassNameToPageName(className);
>     int slashx = logicalName.lastIndexOf('/');
>     if(slashx > 0)
>     {
>       String simpleClassName = InternalUtils.lastTerm(className);
>       logicalName = logicalName.substring(0, slashx + 1) +  
> simpleClassName;
>     }
>
>     String path = format("pages/%s.%s", logicalName, "html"/ 
> *InternalConstants.TEMPLATE_EXTENSION*/);
>     return _contextRoot.forFile(path).forLocale(locale);
>   }
> }

I have commented out all other contributions, services and custom code  
in my
AppModules except for the template locator overwrite. So it seems that  
this
one is the culprit for the recursion exception I get with 5.1.0.2

/Andreas



On 3 apr 2009, at 13.28, Andreas Pardeike wrote:

> Unfortunately, one of my key concepts in a big application I am  
> developing
> stops working in the step from 5.1.0.1 -> 5.1.0.2. Our application  
> has all page
> classes inside a subfolder, thus our internal tapestry pages all  
> look like
>
> http://hostname/klubb/page
>
> and there is one tapestry page 'dynamic' that handles all requests  
> without
> the prefixing /klubb :
>
> http://hostname/something/else.html
>
> where it looks up '/something/else.html' from a database. The  
> configuration
> for this is set up like this:
>
>
> public void contributeHttpServletRequestHandler(
>            OrderedConfiguration<HttpServletRequestFilter>  
> configuration,
>            Global global,
>            ClubConfiguration clubconf)
> {
>  configuration.add("CustomContenHandler", new  
> CustomContentHandler(global, clubconf),
>                       "before:IgnoredPaths");
> }
>
>
> and the corresponding class:
>
>
> public class CustomContentHandler implements HttpServletRequestFilter
> {
>  private static String contentType;
>
>  private final Global _global;
>  private final ClubConfiguration _configuration;
>
>  private final Pattern clubAssetsMatcher;
>
>  private enum RequestType
>  {
>    START_PAGE, DYNAMIC_PAGE, TAPESTRY_ACTION
>  };
>
>  // this class is used to overwrite getServletPath for inserting our  
> own
>  // t5
>  // page at the beginning of the path
>  //
>  private class MyHTTPServletRequest extends HttpServletRequestWrapper
>  {
>    private final RequestType _type;
>
>    public MyHTTPServletRequest(HttpServletRequest  
> httpServletRequest, RequestType type)
>    {
>      super(httpServletRequest);
>      _type = type;
>    }
>
>    @Override
>    public String getServletPath()
>    {
>      String path = super.getServletPath();
>
>      if(_type == RequestType.START_PAGE)
>      {
>        if(path.equals("/"))
>          path = Constants.STARTPAGE;
>        return path;
>      }
>
>      if(_type == RequestType.DYNAMIC_PAGE)
>        return Constants.DYNAMIC_CLUB_URL + path.toLowerCase();
>
>      if(_type == RequestType.TAPESTRY_ACTION)
>        return Constants.TAPESTRY_ACTION_PREFIX + path;
>
>      return path;
>    }
>  }
>
>  public CustomContentHandler(final Global global, final  
> ClubConfiguration configuration)
>  {
>    _global = global;
>    _configuration = configuration;
>
>    String regExp = ".*\\.(";
>
>    Iterator<String> iterator = getSuffixes().keySet().iterator();
>    while(iterator.hasNext())
>    {
>      regExp = regExp + (getSuffixes().size() == 0 ? "" : "|") +  
> iterator.next();
>
>    }
>    clubAssetsMatcher = Pattern.compile(regExp + ")");
>  }
>
>  public boolean service(HttpServletRequest request,  
> HttpServletResponse response, HttpServletRequestHandler handler)  
> throws IOException
>  {
>    String path = request.getServletPath().toLowerCase();
>
>    if(path.equals("/") ||  
> path.startsWith(Constants.TAPESTRY_ACTION_PREFIX + "/"))
>    {
>      MyHTTPServletRequest newRequest = new  
> MyHTTPServletRequest(request, RequestType.START_PAGE);
>      return handler.service(newRequest, response);
>    }
>
>    if(path.startsWith(Constants.PRIVATE_ASSETS_PREFIX + "/"))
>      return handler.service(request, response);
>
>    if(path.startsWith(Constants.PRIVATE_DYNAMIC_ACTION_PREFIX) ||  
> path.startsWith(Constants.PRIVATE_STARTPAGE_ACTION_PREFIX))
>    {
>      MyHTTPServletRequest newRequest = new  
> MyHTTPServletRequest(request, RequestType.TAPESTRY_ACTION);
>      return handler.service(newRequest, response);
>    }
>
>    int club = _configuration.getClubNumberFromRequest(request);
>
>    Map<String,Object> keys = new HashMap<String,Object>();
>    keys.put(Dynamic.CLUB_PROPERTY, club);
>    keys.put(Dynamic.PATH_PROPERTY, path);
>    keys.put(Dynamic.PART_PROPERTY, "");
>
>    Expression condition = ExpressionFactory.matchAllDbExp(keys,  
> Expression.EQUAL_TO);
>    SelectQuery query = new SelectQuery(Dynamic.class, condition);
>    query.setName("#" + club + ":" + path + ":");
>    query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
>    List<Dynamic> rows =  
> _global.getReadOnlyObjectContext().performQuery(query);
>    Dynamic dynamic = rows.size() == 1 ? rows.get(0) : null;
>
>    // pass handling if this is a private asset (i.e. images that we
>    // use in our templates)
>    //
>    Matcher match = clubAssetsMatcher.matcher(path);
>    if(match.matches())
>    {
>      contentType = getSuffixes().get(match.group(1));
>      if(dynamic != null)
>      {
>        response.setContentType(contentType);
>        ServletOutputStream out = response.getOutputStream();
>        out.write(dynamic.getData());
>        out.close();
>
>        return true;
>      }
>
>      return false;
>    }
>
>    // test for customer pages but exclude our own pages
>    //
>    if(dynamic != null)
>    {
>      MyHTTPServletRequest newRequest = new  
> MyHTTPServletRequest(request, RequestType.DYNAMIC_PAGE);
>      return handler.service(newRequest, response);
>    }
>
>    response.sendError(404);
>    return true;
>  }
>
>  public Map<String,String> getSuffixes()
>  {
>    Map<String,String> suffixes = new HashMap<String,String>();
>
>    suffixes.put("ico", "image/x-icon");
>    suffixes.put("css", "text/css");
>    suffixes.put("js", "text/javascript");
>    suffixes.put("gif", "image/gif");
>    suffixes.put("jpg", "image/jpeg");
>    suffixes.put("jpeg", "image/jpeg");
>    suffixes.put("png", "image/png");
>    suffixes.put("tif", "mage/tif");
>    suffixes.put("tiff", "mage/tiff");
>    suffixes.put("pdf", "application/pdf");
>    suffixes.put("xml", "text/xml");
>    suffixes.put("doc", "application/msword");
>    suffixes.put("docx", "application/msword");
>    suffixes.put("xsl", "application/x-excel");
>    suffixes.put("txt", "text/plain");
>    suffixes.put("gzip", "application/x-gzip");
>    suffixes.put("zip", "application/zip");
>    suffixes.put("tar", "application/x-tar");
>    suffixes.put("cab", "application/octet-stream");
>    suffixes.put("dmg", "application/octet-stream");
>    suffixes.put("tgz", "application/x-tar");
>    suffixes.put("rar", "application/x-rar-compressed");
>    suffixes.put("exe", "application/octet-stream");
>    suffixes.put("mp3", "application/octet-stream");
>    suffixes.put("wav", "application/octet-stream");
>    suffixes.put("aac", "application/octet-stream");
>    suffixes.put("ra", "application/octet-stream");
>    suffixes.put("wma", "application/octet-stream");
>    suffixes.put("mov", "application/octet-stream");
>    suffixes.put("mp4", "application/octet-stream");
>    suffixes.put("wmv", "application/octet-stream");
>    suffixes.put("avi", "application/octet-stream");
>
>    return suffixes;
>  }
> }
>
>
> The stack trace is here:
>
> java.lang.RuntimeException: Exception constructing service  
> 'HttpServletRequestHandler': Construction of service  
> 'HttpServletRequestHandler' has failed due to recursion: the service  
> depends on itself in some way. Please check  
> org 
> .apache 
> .tapestry5 
> .services.TapestryModule.buildHttpServletRequestHandler(Logger,  
> List, RequestHandler, String, SessionPersistedObjectAnalyzer) (at  
> TapestryModule.java:1222) for references to another service that is  
> itself dependent on service 'HttpServletRequestHandler'.
> 	at  
> org 
> .apache 
> .tapestry5 
> .ioc 
> .internal 
> .services 
> .JustInTimeObjectCreator 
> .obtainObjectFromCreator(JustInTimeObjectCreator.java:78)
> 	at  
> org 
> .apache 
> .tapestry5 
> .ioc 
> .internal 
> .services 
> .JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:57)
> 	at  
> $ 
> HttpServletRequestHandler_1206bab64a5 
> .delegate($HttpServletRequestHandler_1206bab64a5.java)
> 	at  
> $ 
> HttpServletRequestHandler_1206bab64a5 
> .service($HttpServletRequestHandler_1206bab64a5.java)
> 	at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java: 
> 127)
> 	at org.mortbay.jetty.servlet.ServletHandler 
> $CachedChain.doFilter(ServletHandler.java:1084)
> 	at  
> org 
> .apache 
> .cayenne 
> .conf 
> .WebApplicationContextFilter 
> .doFilter(WebApplicationContextFilter.java:90)
> 	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: 
> 722)
> 	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 
> 404)
> 	at  
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 
> 139)
> 	at org.mortbay.jetty.Server.handle(Server.java:324)
> 	at  
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 
> 505)
> 	at org.mortbay.jetty.HttpConnection 
> $RequestHandler.headerComplete(HttpConnection.java:828)
> 	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:380)
> 	at  
> org 
> .mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 
> 395)
> 	at org.mortbay.thread.BoundedThreadPool 
> $PoolThread.run(BoundedThreadPool.java:450)
> Caused by: org.apache.tapestry5.ioc.internal.OperationException:  
> Construction of service 'HttpServletRequestHandler' has failed due  
> to recursion: the service depends on itself in some way. Please  
> check  
> org 
> .apache 
> .tapestry5 
> .services.TapestryModule.buildHttpServletRequestHandler(Logger,  
> List, RequestHandler, String, SessionPersistedObjectAnalyzer) (at  
> TapestryModule.java:1222) for references to another service that is  
> itself dependent on service 'HttpServletRequestHandler'.
> 	at  
> org 
> .apache 
> .tapestry5 
> .ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java: 
> 90)
> 	at  
> org 
> .apache 
> .tapestry5 
> .ioc 
> .internal 
> .PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
> 	at  
> org 
> .apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java: 
> 941)
> 	at  
> org 
> .apache 
> .tapestry5 
> .ioc 
> .internal 
> .OperationTrackingObjectCreator 
> .createObject(OperationTrackingObjectCreator.java:49)
> 	at  
> org 
> .apache 
> .tapestry5 
> .ioc 
> .internal 
> .services 
> .JustInTimeObjectCreator 
> .obtainObjectFromCreator(JustInTimeObjectCreator.java:68)
> 	... 21 more
> Caused by: java.lang.IllegalStateException: Construction of service  
> 'HttpServletRequestHandler' has failed due to recursion: the service  
> depends on itself in some way. Please check  
> org 
> .apache 
> .tapestry5 
> .services.TapestryModule.buildHttpServletRequestHandler(Logger,  
> List, RequestHandler, String, SessionPersistedObjectAnalyzer) (at  
> TapestryModule.java:1222) for references to another service that is  
> itself dependent on service 'HttpServletRequestHandler'.
> 	at  
> org 
> .apache 
> .tapestry5 
> .ioc 
> .internal 
> .RecursiveServiceCreationCheckWrapper 
> .createObject(RecursiveServiceCreationCheckWrapper.java:52)
> 	at org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator 
> $1.invoke(OperationTrackingObjectCreator.java:45)
> 	at  
> org 
> .apache 
> .tapestry5 
> .ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java: 
> 68)
> 	... 25 more
>
>
> On 3 apr 2009, at 01.41, Howard Lewis Ship wrote:
>
>> The latest alpha release of Tapestry 5.1, Tapestry 5.1.0.2, is now
>> available for download and via Maven.
>>
>> Please download it and give it a try; we're especially interested in
>> any problems related to the upgrade from 5.0.18 to 5.1.0.2.
>>
>> Big features added in 5.1.0.2 include automatic combining of
>> JavaScript files, a new client-side JavaScript console based on
>> Blackbird, and the ability to have a single Ajax response update
>> multiple client-side Zones.
>>
>> We are now stabilizing Tapestry 5.1 for a beta release and, if all
>> goes according to plan, a short period until a stable 5.1 release.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org