You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ben Gidley <be...@gidley.co.uk> on 2009/06/05 13:53:16 UTC

ioc issues overriding MarkupWriterFactory service in 5.1

I am trying to override the MarkupWriterFactory in tapestry 5.1

I tried using the the new service override contribution

public static void contributeServiceOverride(MappedConfiguration<Class,
Object> configuration,
 @Local XhtmlMarkupWriterFactory xhtmlMarkupWriterFactory) {

configuration.add(MarkupWriterFactory.class, xhtmlMarkupWriterFactory);
}
but I get

Caused by: org.apache.tapestry5.ioc.internal.OperationException:
Construction of service 'ServiceOverride' has failed due to recursion: the
service depends on itself in some way. Please check
org.apache.tapestry5.ioc.internal.services.ServiceOverrideImpl(Map) (at
ServiceOverrideImpl.java:29) via
org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at
TapestryIOCModule.java:43) for references to another service that is itself
dependent on service 'ServiceOverride'.
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)
... 155 more
Caused by: java.lang.IllegalStateException: Construction of service
'ServiceOverride' has failed due to recursion: the service depends on itself
in some way. Please check
org.apache.tapestry5.ioc.internal.services.ServiceOverrideImpl(Map) (at
ServiceOverrideImpl.java:29) via
org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at
TapestryIOCModule.java:43) for references to another service that is itself
dependent on service 'ServiceOverride'.
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)
... 159 more
[INFO] mortbay.log Started SelectChannelConnector@0.0.0.0:8080

Has anyone got an idea of what I could do to get past this? I have tried
aliasing the service as well and get a similar error.


Ben Gidley

www.gidley.co.uk
ben@gidley.co.uk

Re: ioc issues overriding MarkupWriterFactory service in 5.1

Posted by Martin Papy <ma...@liber-mundi.org>.
In fact, in the AppModule it should be something like this :

    public static void contributeAliasOverrides(
            Configuration<AliasContribution<MarkupWriterFactory>>
configuration,
            @InjectService("PageContentTypeAnalyzer")
PageContentTypeAnalyzer analyzer,
            @InjectService("RequestPageCache") RequestPageCache cache) {

	    configuration.add(AliasContribution.create(MarkupWriterFactory.class,
new XhtmlMarkupWriterFactory(analyzer, cache)));
    }
-- 
View this message in context: http://www.nabble.com/ioc-issues-overriding-MarkupWriterFactory-service-in-5.1-tp23887578p23894060.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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