Mmmmm, overriding makes T5 throw an exception

Caused by: org.apache.tapestry5.ioc.internal.OperationException: Service
interface org.apache.tapestry5.internal.services.PageTemplateLocator is
matched by 2 services: PageTemplateLocator, PageTemplateLocatorFileBased. 
Automatic dependency resolution requires that exactly one service implement
the interface.

What I´ve done:
In my module

        @ServiceId("TemplateFileSystem")
        public static PageTemplateLocator
buildPageTemplateLocatorFileBased(@ContextProvider
                    AssetFactory contextAssetFactory,

        ComponentClassResolver componentClassResolver)
        {
                  return new
PageTemplateLocatorFileSystemImpl(contextAssetFactory.getRootResource(),
componentClassResolver);
        }
        
    public ComponentTemplateSource
buildComponentTemplateSource(TemplateParser parser,
@InjectService("TemplateFileSystem") PageTemplateLocator locator,
            ClasspathURLConverter classpathURLConverter)
    {
        ComponentTemplateSourceImpl service = new
ComponentTemplateSourceImpl(parser, locator, classpathURLConverter);
        return service;
    }


As you can see it doe not matter if I add the serviceId and then inject the
service by name!
The problem is that the one which is throwing the exception is in
org.apache.tapestry5.internal.services.InternalModule (which I cannot
modify)

So in this case I cannot override?

An alternative can be decorate the service (ignoring whatever it does and my
small bits of logic
to return a resouce based in the FileSystem) but I´d rather do it using
overriding.

Thanks!

-- 
View this message in context: 
http://tapestry-users.832.n2.nabble.com/How-to-load-tml-files-from-the-filesystem-instead-of-classpath-tp5009386p5011392.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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

Reply via email to