オーバーライドしようとしていますorg.apache.tapestry5.hibernate.HibernateSessionManager
。これを行うために、これを AppModule に追加しました。
public static void contributeServiceOverride(
MappedConfiguration<Class<?>, Object> configuration)
{
configuration.addInstance(HibernateSessionManager.class,
HibernateSessionManagerOverride.class);
}
内容はHibernateSessionManagerOverride
(とりあえず)デフォルトのタペストリー実装と同じですorg.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl
。
アプリケーションを実行すると、次のエラーが発生します。
java.lang.RuntimeException:
Exception constructing service 'ServletApplicationInitializer':
Unable to instantiate class org.apache.tapestry5.services.TapestryModule as a module:
Exception constructing service 'ServiceOverride':
Error invoking service contribution method com.company.services.AppModule.contributeServiceOverride(MappedConfiguration):
Exception constructing service 'ServiceOverride':
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:31) via org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at TapestryIOCModule.java:49) for references to another service that is itself dependent on service 'ServiceOverride'.