1.3betae3 With no @SpringBean annotation, I can get to the HomePage. When I put it back in (to inject the DAO, see below), and the ComponentInjector gets called to do it job, I get: --- Error --- WicketMessage: Can't instantiate page using constructor public com.sjw.HomePage(org.apache.wicket.PageParameters) and argument
Root cause: java.lang.NoSuchMethodError: org.apache.wicket.util.lang.Classes.isPrimitive(Ljava/lang/Class;)Z at org.apache.wicket.proxy.LazyInitProxyFactory.createProxy(LazyInitProxyFactory.java:122) at org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:98) ... with the following simple set up: --- web.xml --- <?xml version="1.0" encoding="ISO-8859-1"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <display-name>sjw1</display-name> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:conf/applicationContext.xml</param-value> </context-param> <servlet> <servlet-name>ws</servlet-name> <servlet-class> org.apache.wicket.protocol.http.WicketServlet </servlet-class> <init-param> <param-name>applicationFactoryClassName</param-name> <param-value> org.apache.wicket.spring.SpringWebApplicationFactory </param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>ws</servlet-name> <url-pattern>/sjw1/*</url-pattern> </servlet-mapping> </web-app> --- conf/applicationContext.xml --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="wicketApplication" class="com.sjw.WicketApplication"></bean> <!-- setup entity manager factory --> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"> </bean> <bean id="e1Dao" class="com.sjw.dao.E1Dao"> <property name="entityManagerFactory"> <ref local="entityManagerFactory" /> </property> </bean> </beans> ---- WicketApplication.java --- public class WicketApplication extends WebApplication { public Class getHomePage() {return HomePage.class;} public ApplicationContext context() {return WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext()); } protected void init() {addComponentInstantiationListener(new SpringComponentInjector(this, context())); } } --- HomePage.java (partial) --- public class HomePage extends WebPage { @SpringBean private E1Dao e1Dao; public HomePage(final PageParameters parameters) { ... -- View this message in context: http://www.nabble.com/Using-%40SpringBean---NoSuchMethodError-tf4409685.html#a12579776 Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]