我正在学习用apache wicket开发,我试图整合Spring
这是对pom.xml
文件
</dependency>
-->
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-spring</artifactId>
<version>${wicket.version}</version>
</dependency>
<!-- spring dependency -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
这是SpringIntegrationPage.java
public class SpringIntegrationPage extends WebPage {
private static final long serialVersionUID = 1L;
@ SpringBean(name="userModel")
private UserModel userModel;
public SpringIntegrationPage(){
add(new Label("namelbl", new PropertyModel<String>(userModel, "name")));
add(new Label("genderlbl", new PropertyModel<String>(userModel, "gender")));
}
}
我得到org.apache.wicket.WicketRuntimeException:无法使用构造函数&#39; public com.beton.SpringIntegrationPage()实例化页面 引起:java.lang.NoClassDefFoundError:org / springframework / core / ResolvableType
org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public com.beton.SpringIntegrationPage()'. An exception has been thrown during construction!
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:194) ~[wicket-core-7.8.0.jar:7.8.0]
at
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) [catalina.jar:7.0.12]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) [catalina.jar:7.0.12]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) [catalina.jar:7.0.12]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562) [catalina.jar:7.0.12]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [catalina.jar:7.0.12]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395) [catalina.jar:7.0.12]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250) [tomcat-coyote.jar:7.0.12]
at
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_45]
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:175) ~[wicket-core-7.8.0.jar:7.8.0]
... 32 more
Caused by: java.lang.NoClassDefFoundError: org/springframework/core/ResolvableType
答案 0 :(得分:3)
似乎在Spring 4.0中引入了这种类型(ResolvableType),因此它不会在3.0.5.RELEASE中出现。 check this page
因此,您可能需要考虑升级Spring版本或使用wicket的兼容版本。