I found out the reason but can not solve it. :(( I make a fool of myself with JPA annotation in my pojos java files. I don't know how to use JPA annotation to define the relationships between my pojos...
phamvubinh wrote: > > Thanks Matt, that problem was fixed. But I got another one. Can you help > me? > > I have 2 pojos, Phuong and Quan. The primary key of Quan (id_quan) is the > foreign key of Phuong. When I run mvn jetty:run-war, I got this error > message: > > [webgisdulich] ERROR [main] BasicPropertyAccessor.set(94) | > IllegalArgumentException in class: com.giavaviet.app.model.Phuong, setter > method of property: id_quan > [webgisdulich] ERROR [main] BasicPropertyAccessor.set(98) | expected type: > java.lang.Long, actual value: com.giavaviet.app.model.Quan > > I don't know why, I have never changed anything in source code, just add > my own pojos. All of them are generated by appfuse itself. Can you give me > any solution? > > Thanks > Binh Pham > > Here is my full error message: > ================================================================ > Running com.giavaviet.app.webapp.action.PersonFormTest > [webgisdulich] INFO [main] PersonFormTest.loadContextLocations(177) | > Loading context for locations: > classpath:/applicationContext-resources.xml,classpath:/applicationContext-dao.xml,classpath:/applicationContext-service.xml,classpath*:/applicationContext.xml,/WEB-INF/applicationContext*.xml > [webgisdulich] WARN [main] Oracle9Dialect.<init>(37) | The Oracle9Dialect > dialect has been deprecated; use either Oracle9iDialect or > Oracle10gDialect instead > [webgisdulich] DEBUG [main] PersonFormTest.testEdit(46) | testing edit... > [webgisdulich] DEBUG [main] PersonFormTest.testSave(55) | testing save... > [webgisdulich] DEBUG [main] PersonFormTest.testRemove(72) | testing > remove... > Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.579 sec > Running com.giavaviet.app.webapp.action.QuanListTest > Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.474 sec > Running com.giavaviet.app.webapp.action.PhuongFormTest > [webgisdulich] DEBUG [main] PhuongFormTest.testEdit(44) | testing edit... > [webgisdulich] ERROR [main] BasicPropertyAccessor.set(94) | > IllegalArgumentException in class: com.giavaviet.app.model.Phuong, setter > method of property: id_quan > [webgisdulich] ERROR [main] BasicPropertyAccessor.set(98) | expected type: > java.lang.Long, actual value: com.giavaviet.app.model.Quan > [webgisdulich] DEBUG [main] PhuongFormTest.testSave(53) | testing save... > [webgisdulich] ERROR [main] BasicPropertyAccessor.set(94) | > IllegalArgumentException in class: com.giavaviet.app.model.Phuong, setter > method of property: id_quan > [webgisdulich] ERROR [main] BasicPropertyAccessor.set(98) | expected type: > java.lang.Long, actual value: com.giavaviet.app.model.Quan > [webgisdulich] DEBUG [main] PhuongFormTest.testRemove(69) | testing > remove... > [webgisdulich] ERROR [main] BasicPropertyAccessor.set(94) | > IllegalArgumentException in class: com.giavaviet.app.model.Phuong, setter > method of property: id_quan > [webgisdulich] ERROR [main] BasicPropertyAccessor.set(98) | expected type: > java.lang.Long, actual value: com.giavaviet.app.model.Quan > Tests run: 4, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.291 sec > <<< FAILURE! > Running com.giavaviet.app.webapp.action.PhuongListTest > [webgisdulich] ERROR [main] BasicPropertyAccessor.set(94) | > IllegalArgumentException in class: com.giavaviet.app.model.Phuong, setter > method of property: id_quan > [webgisdulich] ERROR [main] BasicPropertyAccessor.set(98) | expected type: > java.lang.Long, actual value: com.giavaviet.app.model.Quan > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.125 sec > <<< FAILURE! > ================================================================= > > > mraible wrote: >> >> This is something we should probably fix. Can you please enter this as >> an issue in JIRA? >> >> http://issues.appfuse.org/browse/APF >> >> For most integration tests with Spring, we've remembered to set >> autowiring to use byName. However, it looks like I forgot it for JSF. >> You should be able to fix this in your code by adding the following >> method: >> >> protected String[] getConfigLocations() { >> setAutowireMode(AUTOWIRE_BY_NAME); >> return super.getConfigLocations(); >> } >> >> Matt >> >> On 9/19/07, phamvubinh <[EMAIL PROTECTED]> wrote: >>> >>> Hi all, >>> >>> I'm using Appfuse with JSF framework and I got an error (below). I think >>> I >>> should config some think about autowire, autowire-candidate, ... in my >>> applicationContext.xml file to figure it out but I don't know how. Can >>> you >>> give me some advices? >>> >>> ================================================================== >>> >>> Running com.giavaviet.app.webapp.action.PersonListTest >>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.056 >>> sec >>> <<< FAILURE! >>> testSearch(com.giavaviet.app.webapp.action.PersonListTest) Time >>> elapsed: >>> 0.041 sec <<< ERROR! >>> org.springframework.beans.factory.UnsatisfiedDependencyException: Error >>> creating bean with name >>> 'com.giavaviet.app.webapp.action.PersonListTest': >>> Unsatisfied dependency expressed through bean property 'personManager': >>> There are 3 beans of type [org.appfuse.service.GenericManager] available >>> for >>> autowiring by type: [quanManager, phuongManager, personManager]. There >>> should have been exactly 1 to be able to autowire property >>> 'personManager' >>> of bean 'com.giavaviet.app.webapp.action.PersonListTest'. Consider using >>> autowiring by name instead. >>> >>> ================================================================ >>> >>> Thanks, >>> Binh Pham >>> -- >>> View this message in context: >>> http://www.nabble.com/Have-problem-with-autowire-tf4484940s2369.html#a12789644 >>> Sent from the AppFuse - User mailing list archive at Nabble.com. >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> >> -- >> http://raibledesigns.com >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- View this message in context: http://www.nabble.com/Have-problem-with-autowire-tf4484940s2369.html#a12794327 Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
