我正在尝试覆盖org.apache.tapestry5.hibernate.HibernateSessionManager
. 为此,我将其添加到我的 AppModule 中:
public static void contributeServiceOverride(
MappedConfiguration<Class<?>, Object> configuration)
{
configuration.addInstance(HibernateSessionManager.class,
HibernateSessionManagerOverride.class);
}
HibernateSessionManagerOverride
(暂时)的内容与默认的 Tapestry implementation 相同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'.