Something must have happened! You seem to have actions and the corresponding tests for your two new pojos, so it looks as if a fair bit of code has been added, either by being generated through a plugin or being hand coded. Either way this code contains errors that need fixing. The stuff that is breaking is not in AppFuse itself - it is part of the code that has been added - so climb on in, you won't be affecting the structure of AppFuse.
Mike On 9/19/07, phamvubinh <[EMAIL PROTECTED]> wrote: > > > I think so, but I have never changed source code in my appfuse project. > All I > have done are modifing something in pom.xml file, adding my POJOs (Quan & > Phuong) and deploying project by Maven. > Now I got those errors, I don't know how to figure out. I'm afraid to > break > the structure of Appfuse. > > Can you give me some advices? > > Thanks you very much. > > > Mike Horwitz wrote: > > > > You seem to have three basic errors: > > > > 1) In action class com.giavaviet.app.webapp.action.PhuongForm on line 39 > > you > > are trying to cast a Quan object to be a Phuong object. > > 2) In action class com.giavaviet.app.webapp.action.PhuongList you are > > trying > > to sort a list of Phuong using the column 'id_phuong'. Phuong objects > have > > no such attribute. > > 3) Your database sample data does not contain a Quan object with id -2. > > > > Mike. > > > > On 9/19/07, phamvubinh <[EMAIL PROTECTED]> wrote: > >> > >> > >> Thanks for your help, Mike. I can run mvn jetty:run-war without the > >> previous > >> error, but after that, I met some things wrong :-((. Can you help me. > >> > >> You can see my error message below: > >> > >> ========================================================== > >> > >> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.099sec > >> Running com.giavaviet.app.webapp.action.PhuongFormTest > >> [webgisdulich] DEBUG [main] PhuongFormTest.testEdit(40) | testing > edit... > >> [webgisdulich] DEBUG [main] PhuongFormTest.testSave(49) | testing > save... > >> [webgisdulich] DEBUG [main] PhuongFormTest.testRemove(65) | testing > >> remove... > >> Tests run: 4, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.419sec > >> <<< FAILURE! > >> testEdit(com.giavaviet.app.webapp.action.PhuongFormTest) Time elapsed: > >> 0.107 sec <<< ERROR! > >> java.lang.ClassCastException: com.giavaviet.app.model.Quan cannot be > cast > >> to > >> com.giavaviet.app.model.Phuong > >> at > >> com.giavaviet.app.webapp.action.PhuongForm.edit(PhuongForm.java:39) > >> at > >> com.giavaviet.app.webapp.action.PhuongFormTest.testEdit( > >> PhuongFormTest.java:43) > >> > >> testSave(com.giavaviet.app.webapp.action.PhuongFormTest) Time elapsed: > >> 0.073 sec <<< ERROR! > >> java.lang.ClassCastException: com.giavaviet.app.model.Quan cannot be > cast > >> to > >> com.giavaviet.app.model.Phuong > >> at > >> com.giavaviet.app.webapp.action.PhuongForm.edit(PhuongForm.java:39) > >> at > >> com.giavaviet.app.webapp.action.PhuongFormTest.testSave( > >> PhuongFormTest.java:52) > >> > >> Running com.giavaviet.app.webapp.action.PhuongListTest > >> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.334sec > >> <<< FAILURE! > >> testSearch(com.giavaviet.app.webapp.action.PhuongListTest) Time > elapsed: > >> 0.325 sec <<< ERROR! > >> java.lang.ClassCastException: java.lang.NoSuchMethodException: Unknown > >> property 'id_phuong' > >> at > >> org.apache.commons.beanutils.BeanComparator.compare(BeanComparator.java > >> :155) > >> at > >> org.apache.commons.collections.comparators.ReverseComparator.compare( > >> ReverseComparator.java:80) > >> at java.util.Arrays.mergeSort(Arrays.java:1270) > >> at java.util.Arrays.sort(Arrays.java:1210) > >> at java.util.Collections.sort(Collections.java:159) > >> at org.appfuse.webapp.action.BasePage.sort(BasePage.java:262) > >> at > >> com.giavaviet.app.webapp.action.PhuongList.getPhuongs(PhuongList.java > :22) > >> at > >> com.giavaviet.app.webapp.action.PhuongListTest.testSearch( > >> PhuongListTest.java:37) > >> > >> Running com.giavaviet.app.AppTest > >> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.02sec > >> Running com.giavaviet.app.webapp.action.QuanFormTest > >> [webgisdulich] DEBUG [main] QuanFormTest.testEdit(40) | testing edit... > >> [webgisdulich] DEBUG [main] QuanFormTest.testSave(49) | testing save... > >> [webgisdulich] DEBUG [main] QuanFormTest.testRemove(65) | testing > >> remove... > >> [webgisdulich] WARN [main] GenericDaoHibernate.get(60) | Uh oh, 'class > >> com.giavaviet.app.model.Quan' object with id '-2' not found... > >> Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.411sec > >> <<< FAILURE! > >> testRemove(com.giavaviet.app.webapp.action.QuanFormTest) Time elapsed: > >> 0.074 sec <<< ERROR! > >> org.springframework.orm.ObjectRetrievalFailureException: Object of > class > >> [com.giavaviet.app.model.Quan] with identifier [-2]: not found > >> at > >> org.appfuse.dao.hibernate.GenericDaoHibernate.get( > GenericDaoHibernate.java > >> :61) > >> at > >> org.appfuse.dao.hibernate.GenericDaoHibernate.remove( > >> GenericDaoHibernate.java:88) > >> at > >> org.appfuse.service.impl.GenericManagerImpl.remove( > GenericManagerImpl.java > >> :96) > >> > >> ================================================================ > >> > >> Any suggestion for me. > >> > >> Thanks very much > >> > >> Binh Pham > >> > >> > >> Mike Horwitz wrote: > >> > > >> > Cascading of delete is not supported in the JPA spec, so you will > need > >> to > >> > use the @OnDelete Hibernate extension to do it: > >> http://tinyurl.com/22n4wv > >> > > >> > Mike > >> > > >> > On 9/19/07, phamvubinh <[EMAIL PROTECTED]> wrote: > >> >> > >> >> > >> >> I have the same error. Any suggestion for this mistake? > >> >> Donleyp, have you found the solution? > >> >> > >> >> Thanks > >> >> Binh Pham > >> >> > >> >> > >> >> > >> >> donleyp wrote: > >> >> > > >> >> > I am getting the following error when I try to delete a user: > >> >> > "java.sql.SQLException: ORA-02292: integrity constraint > >> >> > (FTAP_DEMO.FK1D0C220DF503D155) violated - child record found" > >> >> > > >> >> > I looked at the DDL generated by hibernate and it does not contain > >> the > >> >> > cascade delete clause in the alter table statement for this > foreign > >> >> key. > >> >> I > >> >> > am trying to figure out if it is possible to get that clause > added. > >> >> > > >> >> > I have a domain object that associates itself with a user > >> (represented > >> >> by > >> >> > org.appfuse.model.User). Here are the setter and getter for it: > >> >> > /** > >> >> > * @return the user > >> >> > */ > >> >> > @ManyToOne(cascade = CascadeType.ALL, optional = false) > >> >> > public User getUser() > >> >> > { > >> >> > return user; > >> >> > } > >> >> > > >> >> > /** > >> >> > * @param user > >> >> > * the user to set > >> >> > */ > >> >> > public void setUser(User user) { > >> >> > this.user = user; > >> >> > } > >> >> > > >> >> > From my reading of the persistence spec, that "cascade= > >> CascadeType.ALL" > >> >> is > >> >> > only really for operations originating on the this object, so it > is > >> not > >> >> > doing me any good. I need a way to tell hibernate that it should > >> >> cascade > >> >> > deletes from user to this object. Any suggestions? > >> >> > > >> >> > Thanks! > >> >> > > >> >> > Donley > >> >> > > >> >> > > >> >> > >> >> -- > >> >> View this message in context: > >> >> > >> > http://www.nabble.com/Cascading-delete-from-User-to-my-own-model-objects.-tf3854160s2369.html#a12770256 > >> >> Sent from the AppFuse - User mailing list archive at Nabble.com. > >> >> > >> >> > --------------------------------------------------------------------- > >> >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> >> For additional commands, e-mail: [EMAIL PROTECTED] > >> >> > >> >> > >> > > >> > > >> > >> > >> -- > >> View this message in context: > >> > http://www.nabble.com/Cascading-delete-from-User-to-my-own-model-objects.-tf3854160s2369.html#a12773596 > >> Sent from the AppFuse - User mailing list archive at Nabble.com. > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > > > -- > View this message in context: > http://www.nabble.com/Cascading-delete-from-User-to-my-own-model-objects.-tf3854160s2369.html#a12774367 > Sent from the AppFuse - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
