Joel
Joel

Reputation: 30166

Tapestry5 : No service implements the interface org.springframework.context.ApplicationContext

I'm using the Tapestry5 tapx template library to send an html email, as per this example.

When I run the example I get the following error:

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)

All the tapestry-* jars, including tapestry-spring-5.1.05.jar are in my classpath.

Any clues as to what I'm missing?

Upvotes: 2

Views: 2567

Answers (3)

Howard M. Lewis Ship
Howard M. Lewis Ship

Reputation: 549

Fair enough; not sure what you situation is, but you should look in more detail at what TapestrySpringFilter does in terms of set up and replicate it into your standalone app's startup. There's some special bootstrapping magic that you will want to leverage.

Upvotes: 0

Howard M. Lewis Ship
Howard M. Lewis Ship

Reputation: 549

Follow the directions on the web site carefully; my guess is that you are not using the special TapestrySpringFilter (instead of the normal TapestryFilter).

It's been a while since I looked at this code; I can't remember if the ApplicationContext is exposed as a service or injectable object. Seems like it should be.

Upvotes: 0

Joel
Joel

Reputation: 30166

Figured it out. SpringIOC loads all modules it find on the classpath. The SpringModule, in tapestry-spring.jar, attempts to initialise the ApplicactionContext service, which causes the problem.

Removing tapestry-spring.jar from the classpath fixes the problem.

Upvotes: 1

Related Questions