I have an existing MySql Database.
Here is my Roo Shell, I manually edited database.properties before doing the dbre.
As you can see below, it looks very promising, it created all the entities and aspects as expected. I then did web mvc and that too looked good.
But trying to Run as on server gave me a 404 and the console showed a bunch of exceptions...starting with:Code:____ ____ ____ / __ \/ __ \/ __ \ / /_/ / / / / / / / / _, _/ /_/ / /_/ / /_/ |_|\____/\____/ 1.1.4.RELEASE [rev f787ce7] Welcome to Spring Roo. For assistance press CTRL+SPACE or type "hint" then hit ENTER. roo> persistence setup --database MYSQL --provider HIBERNATE Created SRC_MAIN_RESOURCES\META-INF\spring\database.properties Please update your database details in src/main/resources/META-INF/spring/database.properties. Updated ROOT\pom.xml [added dependencies mysql:mysql-connector-java:5.1.13, org.hibernate:hibernate-core:3.6.3.Final, org.hibernate:hibernate-entitymanager:3.6.3.Final, org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.0.Final, org.hibernate:hibernate-validator:4.1.0.Final, javax.validation:validation-api:1.0.0.GA, cglib:cglib-nodep:2.2, javax.transaction:jta:1.1, org.springframework:spring-jdbc:${spring.version}, org.springframework:spring-orm:${spring.version}, commons-pool:commons-pool:1.5.4, commons-dbcp:commons-dbcp:1.3; added repository https://repository.jboss.org/nexus/content/repositories/releases] Updated SRC_MAIN_RESOURCES\META-INF\spring\applicationContext.xml Created SRC_MAIN_RESOURCES\META-INF\persistence.xml roo> database reverse engineer --schema no-schema-required --package com.corenttech.care.model Created SRC_MAIN_RESOURCES\dbre.xml Updated ROOT\pom.xml Updated SRC_MAIN_RESOURCES\META-INF\persistence.xml Created SRC_MAIN_JAVA\com\corenttech\care\model Created SRC_MAIN_JAVA\com\corenttech\care\model\ActionProperties.java Created SRC_MAIN_JAVA\com\corenttech\care\model\Actions.java Created SRC_MAIN_JAVA\com\corenttech\care\model\Applications.java Created SRC_MAIN_JAVA\com\corenttech\care\model\Carerulesrepository.java Created SRC_MAIN_JAVA\com\corenttech\care\model\ContactUs.java Created SRC_MAIN_JAVA\com\corenttech\care\model\ContactUsMessage.java Created SRC_MAIN_JAVA\com\corenttech\care\model\Criteria.java Created SRC_MAIN_JAVA\com\corenttech\care\model\EventProperties.java Created SRC_MAIN_JAVA\com\corenttech\care\model\EventTypes.java Created SRC_MAIN_JAVA\com\corenttech\care\model\Events.java Created SRC_MAIN_JAVA\com\corenttech\care\model\ExecutionLog.java...some omitted for brevity. roo> web mvc setup Created SRC_MAIN_WEBAPP\WEB-INF\spring Created SRC_MAIN_WEBAPP\WEB-INF\spring\webmvc-config.xml Created SRC_MAIN_WEBAPP\WEB-INF\web.xml Created SRC_MAIN_WEBAPP\images ...some omitted for brevity Updated SRC_MAIN_WEBAPP\WEB-INF\web.xml Updated ROOT\pom.xml [added dependencies org.springframework:spring-web:${spring.version}, org.springframework:spring-webmvc:${spring.version}, org.springframework.webflow:spring-js-resources:2.2.1.RELEASE, commons-digester:commons-digester:2.0, commons-fileupload:commons-fileupload:1.2.1, javax.servlet:jstl:1.2, javax.el:el-api:1.0, joda-time:joda-time:1.6, javax.servlet.jsp:jsp-api:2.1, commons-codec:commons-codec:1.4; updated project type to war; added dependencies org.apache.tiles:tiles-core:2.2.1, org.apache.tiles:tiles-jsp:2.2.1] Updated SRC_MAIN_WEBAPP\WEB-INF\spring\webmvc-config.xml Updated SRC_MAIN_WEBAPP\WEB-INF\views\footer.jspx roo> web mvc all --package ~.cac Created SRC_MAIN_JAVA\com\corenttech\care\cac Created SRC_MAIN_JAVA\com\corenttech\care\cac\ExecutionLogController.java .omitted for brevity Created SRC_MAIN_WEBAPP\WEB-INF\views\eventtypeses Created SRC_MAIN_WEBAPP\WEB-INF\views\eventtypeses\views.xml Updated SRC_MAIN_WEBAPP\WEB-INF\views\eventtypeses\views.xml Updated SRC_MAIN_WEBAPP\WEB-INF\views\menu.jspx Updated SRC_MAIN_WEBAPP\WEB-INF\views\eventtypeses\views.xml ...omitted for brevity Updated SRC_MAIN_WEBAPP\WEB-INF\views\menu.jspx Updated SRC_MAIN_WEBAPP\WEB-INF\i18n\application.properties Updated SRC_MAIN_WEBAPP\WEB-INF\spring\webmvc-config.xml Created SRC_MAIN_JAVA\com\corenttech\care\cac\ApplicationConversionServiceFactoryBean_Roo_ConversionService.aj Created SRC_MAIN_JAVA\com\corenttech\care\cac\ActionPropertiesController_Roo_Controller.aj Created SRC_MAIN_WEBAPP\WEB-INF\views\actionpropertieses\list.jspx Created SRC_MAIN_WEBAPP\WEB-INF\views\actionpropertieses\show.jspx Created SRC_MAIN_WEBAPP\WEB-INF\views\actionpropertieses\create.jspx ...omitted for brevity Created SRC_MAIN_WEBAPP\WEB-INF\views\executionlogs\list.jspx Created SRC_MAIN_WEBAPP\WEB-INF\views\executionlogs\show.jspx Created SRC_MAIN_WEBAPP\WEB-INF\views\executionlogs\create.jspx Created SRC_MAIN_WEBAPP\WEB-INF\views\executionlogs\update.jspx com.corenttech.care.cac roo> logging setup --level TRACE Updated SRC_MAIN_RESOURCES\log4j.properties
I compared the sources and configuration files with a running application (as it happens the same one that created the database originally, also built with Roo) and couldn't find a difference.Code:2011-05-26 06:23:15,085 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in file [C:\Users\user\Documents\workspace-sts-2.6.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\DBRETest\WEB-INF\classes\META-INF\spring\applicationContext.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [C:\Users\user\Documents\workspace-sts-2.6.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\DBRETest\WEB-INF\classes\META-INF\spring\applicationContext.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)Any clues would be greatly appreciated.


Any clues would be greatly appreciated.
Reply With Quote
