Here's the pom.xml. Rergards - Cemal http://jWeekend.co.uk jWeekend.co.uk
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany</groupId> <artifactId>myproject</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <!-- TODO project name --> <name>quickstart</name> <description></description> <!-- TODO <organization> <name>company name</name> <url>company url</url> </organization> --> <licenses> <license> <name>The Apache Software License, Version 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> <distribution>repo</distribution> </license> </licenses> <dependencies> <!-- WICKET DEPENDENCIES --> <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket</artifactId> <version>${wicket.version}</version> </dependency> <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket-extensions</artifactId> <version>${wicket.version}</version> </dependency> <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket-spring</artifactId> <version>1.3.0-SNAPSHOT</version> <type>jar</type> <scope>compile</scope> <exclusions> <exclusion> <groupId>cglib</groupId> <artifactId>cglib-nodep</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket-spring-annot</artifactId> <version>1.3.0-SNAPSHOT</version> <type>jar</type> <scope>compile</scope> </dependency> <!-- LOGGING DEPENDENCIES - LOG4J --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.0.1</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> </dependency> <!-- JETTY DEPENDENCIES FOR TESTING --> <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty</artifactId> <version>${jetty.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-util</artifactId> <version>${jetty.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-management</artifactId> <version>${jetty.version}</version> <scope>provided</scope> </dependency> <!-- SPRING --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>2.0.1</version> </dependency> <!-- JPA: HIBERNATE --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> <version>3.2.1.ga</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.2.1.ga</version> </dependency> <!-- HSQLDB --> <dependency> <groupId>hsqldb</groupId> <artifactId>hsqldb</artifactId> <version>1.8.0.7</version> </dependency> <!-- Surefire (testing) plugin requirement if src/test/java is preesent --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.2</version> <scope>test</scope> </dependency> <!-- commons-dbcp --> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.2.1</version> <scope>test</scope> </dependency> </dependencies> <build> <resources> <resource> <filtering>false</filtering> <directory>src/main/resources</directory> </resource> <resource> <filtering>false</filtering> <directory>src/main/java</directory> <includes> <include>**</include> </includes> <excludes> <exclude>**/*.java</exclude> </excludes> </resource> </resources> <testResources> <testResource> <filtering>false</filtering> <directory>src/test/java</directory> <includes> <include>**</include> </includes> <excludes> <exclude>**/*.java</exclude> </excludes> </testResource> </testResources> <plugins> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> </plugin> </plugins> </build> <properties> <wicket.version>1.3.0-beta3</wicket.version> <jetty.version>6.1.4</jetty.version> </properties> </project> jweekend wrote: > > 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#a12580180 Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
