Ok, tried removing all items with appfuse:remove both in web and core and then regenerating. No joy.
Generated Controller files have correct package names package xyz.webapp.controller; wrong references to the Model class import xyz.model.Barrio; should be import xyz.core.model.Barrio; and wrong package directories /xyz/core/webapp/controller Well, I'm stuck. Suppose I could try setting up a new project from scratch. Cheers, Marc mraible wrote: > > The directory structure used by "appfuse:gen" is groupId (from your > root pom.xml), then packages as follows: > > http://appfuse.org/display/APF/FAQ#FAQ-packagenaming > > I suspect you might have these sub-directories because you tried > running "gen" with a fully-qualified class name. > > The good news is 1) you should be able to run "appfuse:remove" and > delete any generated code and 2) you should be able to run > "appfuse:gen" multiple times and duplicates shouldn't be created. > > Matt > > On 10/29/07, mschipperheyn <[EMAIL PROTECTED]> wrote: >> >> I'm using simple names iso full qualified names. The subdir is from some >> model classes I have in seperate model/subdir packages. Hell, no idea >> where >> those dirs are coming from either. Dont know how the directory structure >> is >> determined for appfuse:gen. Is there any way I can backtrack this? >> >> Cheers, >> >> Marc >> >> >> >> mraible wrote: >> > >> > On 10/29/07, mschipperheyn <[EMAIL PROTECTED]> wrote: >> >> >> >> This issue is actually more cumbersome than I thought b/c it affects >> >> stuff in >> >> different directories and requires me to fix for each POJO before I >> run >> >> mvn >> >> appfuse:gen again. It does look like a 'real' issue. My setup is prety >> >> vanilla. >> >> >> >> So, summarizing: >> >> Running appfuse:gen from the web dir I get: >> >> * package path: xyz/core/model/<subdir if any>/webapp/controller >> > >> > I don't understand the problem here - where are core/model coming >> > from? They shouldn't be there, nor should there be a <subdir>. I'm >> > guessing this might be caused by using the fully-qualified class name >> > instead of the simple name. >> > >> >> * package name within controller file xyz.webapp.controller >> >> * package name within controllerForm file xyz.webapp.controller >> >> * Error message in validation.xml: there should not be a form entry >> when >> >> there are no child field entries >> > >> > Yes, it's possible this is a bug - we recommend adding at least one >> > not-null constraint to your POJO to fix it. >> > >> > Matt >> > >> >> >> >> Cheers, >> >> >> >> Marc >> >> >> >> Hope to see a response on this. >> >> >> >> Cheers, >> >> >> >> Marc >> >> >> >> >> >> mschipperheyn wrote: >> >> > >> >> > One more thing I'm noticing is the following error, may or may not >> have >> >> > something to do with me: >> >> > After running mvn instal in the root, then mvn appfuse:gen on >> Barrio, I >> >> > get this issue: >> >> > The created package is xyz.core.webapp.controller which should be >> >> > xyz.webapp.controller which is also the package name within the java >> >> file. >> >> > >> >> > Not sure if it's something to do with me or with appfuse. >> >> > >> >> > Cheers, >> >> > >> >> > Marc >> >> > >> >> > >> >> > mschipperheyn wrote: >> >> >> >> >> >> I ran mvn install on the cor dir and from the web dir (following >> the >> >> >> docs), not the top level. I'm trying that now. Yeh, some things are >> >> >> starting to work. Ok, so you need to run mvn install at the root >> dir >> >> and >> >> >> then do mvn appfuse:gen on the web dir. Ok, got some errors running >> >> mvn >> >> >> install in web dir after that, but that's prob something I did >> wrong. >> >> >> Thanks, Moving forward! >> >> >> >> >> >> You might want to update the documentation >> >> >> In a modular project, these commands must be run in the "core" and >> >> "web" >> >> >> modules. The plugin is smart enough to figure out when it >> >> should/should >> >> >> not generate stuff based on the packaging type (jar vs. war). If >> you >> >> want >> >> >> to generate specific code in a "war" project, you can use gen-core >> or >> >> >> gen-web. >> >> >> >> >> >> Should be >> >> >> n a modular project, you should run these commands in the core dir >> >> first, >> >> >> then run mvn install in the root of the project dir and then run >> these >> >> >> commands again in the web dir. The plugin is smart enough to figure >> >> out >> >> >> when it should/should not generate stuff based on the packaging >> type >> >> (jar >> >> >> vs. war). If you want to generate specific code in a "war" project, >> >> you >> >> >> can use gen-core or gen-web. >> >> >> >> >> >> Maybe I should have figured it all out by myself, but with all this >> >> >> generation going on, it's just very hard to see why things don't >> work >> >> >> sometimes. >> >> >> >> >> >> Thanks again, >> >> >> >> >> >> Marc >> >> >> >> >> >> >> >> >> Mike Horwitz wrote: >> >> >>> >> >> >>> Have you run mvn:install either from the top level or in your core >> >> >>> project? >> >> >>> >> >> >>> Mike >> >> >>> >> >> >>> On 10/29/07, mschipperheyn <[EMAIL PROTECTED]> wrote: >> >> >>>> >> >> >>>> >> >> >>>> Ok, noted some small issues: >> >> >>>> 1. the sample data doesn't take into account column lenght. If >> you >> >> have >> >> >>>> a >> >> >>>> column length of say 5, it will fail on mvn install >> >> >>>> 2. the sample data doesn't take references into account, you >> should >> >> gen >> >> >>>> the >> >> >>>> referenced POJOs first and then the POJOs with references to >> them. >> >> >>>> >> >> >>>> But that's all easily fixable by hand. Would be nice to be able >> to >> >> just >> >> >>>> enter a list of POJOs and have mvn figure out the order and all >> >> that. >> >> >>>> But >> >> >>>> now back to the problem >> >> >>>> >> >> >>>> So I now have my sample data set up. Done all the gens and >> installs. >> >> >>>> Still got that error running the same commands in the web dir. >> >> >>>> >> >> >>>> [INFO] >> >> >>>> >> >> >> ------------------------------------------------------------------------ >> >> >>>> [ERROR] FATAL ERROR >> >> >>>> [INFO] >> >> >>>> >> >> >> ------------------------------------------------------------------------ >> >> >>>> [INFO] Unable to load class declared as <mapping >> >> >>>> class="nl.msw.compraventa.core. >> >> >>>> model.Archive"/> in the configuration: >> >> >>>> [INFO] >> >> >>>> >> >> >> ------------------------------------------------------------------------ >> >> >>>> [INFO] Trace >> >> >>>> org.hibernate.MappingException: Unable to load class declared as >> >> >>>> <mapping >> >> >>>> class= >> >> >>>> "nl.msw.compraventa.core.model.Archive"/> in the configuration: >> >> >>>> >> >> >>>> Cheers, >> >> >>>> >> >> >>>> Marc >> >> >>>> >> >> >>>> >> >> >>>> mschipperheyn wrote: >> >> >>>> > >> >> >>>> > Right, ok. Hmm, getting a >> >> >>>> > Caused by: org.dbunit.DatabaseUnitException: >> >> >>>> > com.mysql.jdbc.exceptions.MySQLInte >> >> >>>> > grityConstraintViolationException: Cannot add or update a child >> >> row: >> >> >>>> a >> >> >>>> > foreign k >> >> >>>> > ey constraint fails (`compraventa/barrios`, CONSTRAINT >> >> >>>> > `FK4F5D3CCEB9857FF2` FORE >> >> >>>> > IGN KEY (`FK_CityId`) REFERENCES `cities` (`cityId`)) >> >> >>>> > >> >> >>>> > That's prob caused by the sample data -1 being inserted while >> >> there >> >> >>>> isn't >> >> >>>> > a City created yet. I'll try to appfuse:gen all those POJOs >> first >> >> to >> >> >>>> have >> >> >>>> > some coherent sample data. >> >> >>>> > >> >> >>>> > Cheers, >> >> >>>> > >> >> >>>> > Marc >> >> >>>> > >> >> >>>> > >> >> >>>> > >> >> >>>> > >> >> >>>> > >> >> >>>> > mraible wrote: >> >> >>>> >> >> >> >>>> >> In the core directory, you should run "mvn install", not "mvn >> >> >>>> >> appfuse:install". >> >> >>>> >> >> >> >>>> >> Matt >> >> >>>> >> >> >> >>>> >> On 10/29/07, mschipperheyn <[EMAIL PROTECTED]> wrote: >> >> >>>> >>> >> >> >>>> >>> Yes, completed without fail. However, I dont see any code >> >> generated >> >> >>>> in >> >> >>>> >>> the >> >> >>>> >>> core dir (I guess dont need that with universal stuff). Did >> see >> >> the >> >> >>>> >>> entries >> >> >>>> >>> in applicationContext.xml added. >> >> >>>> >>> >> >> >>>> >>> Marc >> >> >>>> >>> >> >> >>>> >>> D:\Java\Projects\CompraVenta\core>mvn appfuse:gen >> >> >>>> >>> [INFO] Scanning for projects... >> >> >>>> >>> [INFO] Searching repository for plugin with prefix: >> 'appfuse'. >> >> >>>> >>> [INFO] >> >> >>>> >>> >> >> >>>> >> >> >> ------------------------------------------------------------------------- >> >> >>>> >>> --- >> >> >>>> >>> [INFO] Building AppFuse Modular Application - Core >> >> >>>> >>> [INFO] task-segment: [appfuse:gen] >> >> >>>> >>> [INFO] >> >> >>>> >>> >> >> >>>> >> >> >> ------------------------------------------------------------------------- >> >> >>>> >>> --- >> >> >>>> >>> [INFO] Preparing appfuse:gen >> >> >>>> >>> [INFO] [aspectj:compile {execution: default}] >> >> >>>> >>> [INFO] [resources:resources] >> >> >>>> >>> [INFO] Using default encoding to copy filtered resources. >> >> >>>> >>> [INFO] [compiler:compile] >> >> >>>> >>> [INFO] Nothing to compile - all classes are up to date >> >> >>>> >>> [WARNING] POM for >> 'org.hibernate:jtidy:pom:r8-20060801:runtime' >> >> is >> >> >>>> >>> invalid. >> >> >>>> >>> It w >> >> >>>> >>> ill be ignored for artifact resolution. Reason: Parse error >> >> reading >> >> >>>> POM. >> >> >>>> >>> Reason: >> >> >>>> >>> TEXT must be immediately followed by END_TAG and not >> START_TAG >> >> >>>> >>> (position: >> >> >>>> >>> START >> >> >>>> >>> _TAG seen ...<licenses>\n\t\t\t<license>... @12:13) >> >> >>>> >>> [INFO] [appfuse:gen] >> >> >>>> >>> What is the name of your pojo (i.e. Person)?: Barrio >> >> >>>> >>> [INFO] Configuration XML file loaded: >> >> >>>> >>> D:\Java\Projects\CompraVenta\core\src\main >> >> >>>> >>> \resources\hibernate.cfg.xml >> >> >>>> >>> [INFO] Configuration XML file loaded: >> >> >>>> >>> D:\Java\Projects\CompraVenta\core\src\main >> >> >>>> >>> \resources\hibernate.cfg.xml >> >> >>>> >>> [INFO] src/main/resources/database.properties not found >> within >> >> the >> >> >>>> >>> project. >> >> >>>> >>> Tryi >> >> >>>> >>> ng absolute path. >> >> >>>> >>> [INFO] No hibernate properties file loaded. >> >> >>>> >>> [info] [AppFuse] Installing generated files (pattern: >> >> **/*.java)... >> >> >>>> >>> [info] [AppFuse] Installing sample data for DbUnit... >> >> >>>> >>> [info] [AppFuse] Installing Spring bean definitions... >> >> >>>> >>> [INFO] >> >> >>>> >>> >> >> >>>> >> >> >> ------------------------------------------------------------------------ >> >> >>>> >>> [INFO] BUILD SUCCESSFUL >> >> >>>> >>> [INFO] >> >> >>>> >>> >> >> >>>> >> >> >> ------------------------------------------------------------------------ >> >> >>>> >>> [INFO] Total time: 7 seconds >> >> >>>> >>> [INFO] Finished at: Mon Oct 29 17:09:08 CET 2007 >> >> >>>> >>> [INFO] Final Memory: 13M/23M >> >> >>>> >>> [INFO] >> >> >>>> >>> >> >> >>>> >> >> >> ------------------------------------------------------------------------ >> >> >>>> >>> >> >> >>>> >>> D:\Java\Projects\CompraVenta\core>mvn appfuse:install >> >> >>>> >>> [INFO] Scanning for projects... >> >> >>>> >>> [INFO] Searching repository for plugin with prefix: >> 'appfuse'. >> >> >>>> >>> [INFO] >> >> >>>> >>> >> >> >>>> >> >> >> ------------------------------------------------------------------------- >> >> >>>> >>> --- >> >> >>>> >>> [INFO] Building AppFuse Modular Application - Core >> >> >>>> >>> [INFO] task-segment: [appfuse:install] >> >> >>>> >>> [INFO] >> >> >>>> >>> >> >> >>>> >> >> >> ------------------------------------------------------------------------- >> >> >>>> >>> --- >> >> >>>> >>> [INFO] Preparing appfuse:install >> >> >>>> >>> [INFO] [aspectj:compile {execution: default}] >> >> >>>> >>> [INFO] [resources:resources] >> >> >>>> >>> [INFO] Using default encoding to copy filtered resources. >> >> >>>> >>> [INFO] [compiler:compile] >> >> >>>> >>> [INFO] Nothing to compile - all classes are up to date >> >> >>>> >>> [WARNING] POM for >> 'org.hibernate:jtidy:pom:r8-20060801:runtime' >> >> is >> >> >>>> >>> invalid. >> >> >>>> >>> It w >> >> >>>> >>> ill be ignored for artifact resolution. Reason: Parse error >> >> reading >> >> >>>> POM. >> >> >>>> >>> Reason: >> >> >>>> >>> TEXT must be immediately followed by END_TAG and not >> START_TAG >> >> >>>> >>> (position: >> >> >>>> >>> START >> >> >>>> >>> _TAG seen ...<licenses>\n\t\t\t<license>... @12:13) >> >> >>>> >>> [INFO] [appfuse:install] >> >> >>>> >>> What is the name of your pojo (i.e. Person)?: Barrio >> >> >>>> >>> [info] [AppFuse] Installing generated files (pattern: >> >> **/*.java)... >> >> >>>> >>> [info] [AppFuse] Installing sample data for DbUnit... >> >> >>>> >>> [info] [AppFuse] Installing Spring bean definitions... >> >> >>>> >>> [INFO] >> >> >>>> >>> >> >> >>>> >> >> >> ------------------------------------------------------------------------ >> >> >>>> >>> [INFO] BUILD SUCCESSFUL >> >> >>>> >>> [INFO] >> >> >>>> >>> >> >> >>>> >> >> >> ------------------------------------------------------------------------ >> >> >>>> >>> [INFO] Total time: 5 seconds >> >> >>>> >>> [INFO] Finished at: Mon Oct 29 17:09:27 CET 2007 >> >> >>>> >>> [INFO] Final Memory: 11M/23M >> >> >>>> >>> [INFO] >> >> >>>> >>> >> >> >>>> >> >> >> ------------------------------------------------------------------------ >> >> >>>> >>> -- >> >> >>>> >>> View this message in context: >> >> >>>> >>> >> >> >>>> >> >> >> http://www.nabble.com/app%3Agen--Unable-to-load-class-declared-as-mapping-class%3D%22xyz%22-in-the-configuration-tf4700458s2369.html#a13471891 >> >> >>>> >>> 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/app%3Agen--Unable-to-load-class-declared-as-mapping-class%3D%22xyz%22-in-the-configuration-tf4700458s2369.html#a13474215 >> >> >>>> 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/app%3Agen--Unable-to-load-class-declared-as-mapping-class%3D%22xyz%22-in-the-configuration-tf4700458s2369.html#a13475799 >> >> 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/app%3Agen--Unable-to-load-class-declared-as-mapping-class%3D%22xyz%22-in-the-configuration-tf4700458s2369.html#a13476202 >> 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/app%3Agen--Unable-to-load-class-declared-as-mapping-class%3D%22xyz%22-in-the-configuration-tf4700458s2369.html#a13477670 Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
