我使用带有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)...)
答案 0 :(得分:5)
我不知道Tapestry,但看起来它无法找到你的Spring上下文。您是否按照integrating Tapestry with Spring的说明进行操作?你确认Spring真的开始了吗?
答案 1 :(得分:1)
你似乎错过了挂毯春天的依赖
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-spring</artifactId>
<version>[your-tapestry-version]</version>
</dependency>
您使用的是哪种挂毯版本?我相信5.0 tapestry希望ApplicationContext
在ServletContext
。除此之外,请查看documentation,如@Ryan Steward建议。