【问题标题】:Tapestry5 : No service implements the interface org.springframework.context.ApplicationContextTapestry5:没有服务实现接口 org.springframework.context.ApplicationContext
【发布时间】:2011-08-01 15:22:44
【问题描述】:

我在 spring 和 hibernate 中使用 Tapestry 5,我尝试构建我的应用程序抛出这个异常???!!!???有什么问题,任何建议都会是这样的 relif??

[WARNING] Some problems were encountered while building the effective model for com.fit:rent-a-car:war:1.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 194, column 18
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 235, column 17
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
.....
.....

[ERROR] ioc.Registry No service implements the interface org.springframework.context.ApplicationContext.
[ERROR] ioc.Registry Operations trace:

[ERROR] ioc.Registry [ 1] Realizing service ApplicationInitializer

[ERROR] ioc.Registry [ 2] Invoking org.apache.tapestry5.services.TapestryModule.buildApplicationInitializer(Logger, List) (at TapestryModule.java:1458)

[ERROR] ioc.Registry [ 3] Determining injection value for parameter #2 (java.util.List)

[ERROR] ioc.Registry [ 4] Collecting ordered configuration for service ApplicationInitializer

[ERROR] ioc.Registry [ 5] Invoking method org.apache.tapestry5.spring.SpringModule.contributeApplicationInitializer(OrderedConfiguration, ApplicationContext) (at SpringModule.java:54).

[ERROR] ioc.Registry [ 6] Determining injection value for parameter #2 (org.springframework.context.ApplicationContext)

[ERROR] ioc.Registry [ 7] Resolving object of type org.springframework.context.ApplicationContext using MasterObjectProvider
[ERROR] TapestryModule.ApplicationInitializer Construction of service ApplicationInitializer failed: Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildApplicationInitializer(Logger, List) (at TapestryModule.java:1458) (for service 'ApplicationInitializer'): Error invoking service contribution method org.apache.tapestry5.spring.SpringModule.contributeApplicationInitializer(OrderedConfiguration, ApplicationContext): No service implements the interface org.springframework.context.ApplicationContext.
java.lang.RuntimeException: Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildApplicationInitializer(Logger, List) (at TapestryModule.java:1458) (for service 'ApplicationInitializer'): Error invoking service contribution method org.apache.tapestry5.spring.SpringModule.contributeApplicationInitializer(OrderedConfiguration, ApplicationContext): No service implements the interface org.springframework.context.ApplicationContext.
    at org.apache.tapestry5.ioc.internal.ServiceBuilderMethodInvoker.createObject(ServiceBuilderMethodInvoker.java:76)
    at org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45)
    at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65)
    at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
    at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1063)
    at ......

    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.RuntimeException: Error invoking service contribution method org.apache.tapestry5.spring.SpringModule.contributeApplicationInitializer(OrderedConfiguration, ApplicationContext): No service implements the interface org.springframework.context.ApplicationContext.
    at org.apache.tapestry5.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:139)
    at org.apache.tapestry5.ioc.internal.ContributionDefImpl.contribute(ContributionDefImpl.java:82)
    at org.apache.tapestry5.ioc.internal.RegistryImpl$9.run(RegistryImpl.java:651)
    at org.apache.tapestry5.ioc.internal.OperationTrackerImpl$1.invoke(OperationTrackerImpl.java:50)org.apache.tapestry5.ioc.internal.ServiceBuilderMethodInvoker.createObject(ServiceBuilderMethodInvoker.java:56)
    ... 65 more
Caused by: org.apache.tapestry5.ioc.internal.OperationException: No service implements the interface org.springframework.context.ApplicationContext.
    at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:102)
    at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:69)
    at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
    ....
    ... 93 more
Caused by: java.lang.RuntimeException: No service implements the interface org.springframework.context.ApplicationContext.
    at org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:670)
    at org.apache.tapestry5.ioc.internal.ObjectLocatorImpl.getService(ObjectLocatorImpl.java:45)...)

【问题讨论】:

    标签: java spring-mvc maven-plugin tapestry


    【解决方案1】:

    我不知道 Tapestry,但它似乎无法找到您的 Spring 上下文。您是否按照integrating Tapestry with Spring 的说明进行操作?您是否确认 Spring 真的开始了?

    【讨论】:

    • 是的。 Spring 甚至在类路径上吗?
    【解决方案2】:

    您似乎缺少 Tapestry-spring 依赖项

       <dependency>
         <groupId>org.apache.tapestry</groupId>
         <artifactId>tapestry-spring</artifactId>
         <version>[your-tapestry-version]</version>
       </dependency>
    

    您使用的是哪个挂毯版本?我相信 5.0 挂毯期望 ApplicationContextServletContext 中。除此之外,请像@Ryan Steward 建议的那样检查documentation

    【讨论】:

    • 嗨,我知道是什么问题了?你的建议在我删除的 pom.xml 中是多余的,现在构建应用程序好了.....非常感谢 :)
    猜你喜欢
    • 1970-01-01
    • 2019-10-07
    • 1970-01-01
    • 1970-01-01
    • 2022-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多