Tapestry5:没有服务实现接口org.springframework.context.ApplicationContext

Tapestry5:没有服务实现接口org.springframework.context.ApplicationContext,spring,tapestry,Spring,Tapestry,根据,我正在使用Tapestry5发送html电子邮件 运行该示例时,出现以下错误: Caused by: java.lang.RuntimeException: No service implements the interface org.springframework.context.ApplicationContext. at org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.ja

根据,我正在使用Tapestry5发送html电子邮件

运行该示例时,出现以下错误:

Caused by: java.lang.RuntimeException: No service implements the interface org.springframework.context.ApplicationContext.
        at org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:560)
        at org.apache.tapestry5.ioc.internal.ObjectLocatorImpl.getService(ObjectLocatorImpl.java:44)
所有tapestry-*jar,包括tapestry-spring-5.1.05.jar都在我的类路径中


关于我遗漏了什么,有什么线索吗?

找到了。SpringIOC加载它在类路径上找到的所有模块。tapestry-spring.jar中的SpringModule试图初始化ApplicationContext服务,这导致了问题


从类路径中删除tapestry-spring.jar可以解决问题。

请仔细遵循网站上的说明;我猜您没有使用特殊的TapestrySpringFilter(而不是普通的TapestryFilter)


我已经有一段时间没有看过这个代码了;我不记得ApplicationContext是作为服务还是可注入对象公开的。看起来应该是这样。

很公平;不确定您的情况是什么,但您应该更详细地了解TapestrySpringFilter在设置方面做了什么,并将其复制到独立应用程序的启动中。您需要利用一些特殊的引导魔法。

类路径上是否也有Spring?您是否使用可以调试程序的IDE?如果是这样,请中断此类的构造函数:以确认spring正在初始化。如果不是,则很可能它实际上不在类路径上。已确认。断点命中。我不确定这是否是问题所在——我也不确定Tapestry为什么要加载SpringModule。SpringModule应该由Tapestry运行。这就是stacktrace的全部吗?嗨Howard。TapestrySpringFilter不是用于web应用程序吗?我正在使用tapx模板库-发送html电子邮件,我不认为我需要Spring。好的,谢谢!(如果我不使用Spring或T5 web,而只是一个独立的应用程序,这是否仍然适用?)