Hi All,
I just have started learning spring roo , i have checked the examples (timer,vote,...) and i have successed to run them ..
I have also made my own simple example and it worked fine......
now I am facing the following application , here is the roo script
the idea of the above is that the category may contains 0,1,2,...,n subcategories , and each subcategory contains 0,1,2,...n subsubcategories , and etc... ( all categories,subcategories,subsubcategories..... should be stored in the same table)Code:project --topLevelPackage com.springsource.category.types persistence setup --provider HIBERNATE --database HYPERSONIC_PERSISTENT entity --class ~.Category --testAutomatically field string categoryName --notNull field string description field reference --fieldName categoryParent --type ~.Category controller all --package ~.web logging setup --level DEBUG --package WEB logging setup --level DEBUG perform package perform eclipse
but when i run the war file it display some error ( when i clicke "list of categories")
Code:Data access failure Sorry, a problem occurred while accessing the database. Details Exception Message org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query -Exception Stack Trace org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:312) org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect.ajc$afterThrowing$org_springframework_orm_jpa_aspectj_JpaExceptionTranslatorAspect$1$18a1ac9(JpaExceptionTranslatorAspect.aj:15) com.springsource.category.types.Category_Roo_Entity.findAllCategorys_aroundBody4(Category_Roo_Entity.aj:88) com.springsource.category.types.Category_Roo_Entity.ajc$interMethod$com_springsource_category_types_Category_Roo_Entity$com_springsource_category_types_Category$findAllCategorys(Category_Roo_Entity.aj:1) com.springsource.category.types.Category.findAllCategorys(Category.java:1) com.springsource.category.types.Category_Roo_Entity.ajc$interMethodDispatch1$com_springsource_category_types_Category_Roo_Entity$com_springsource_category_types_Category$findAllCategorys(Category_Roo_Entity.aj) com.springsource.category.types.web.CategoryController_Roo_Controller.ajc$interMethod$com_springsource_category_types_web_CategoryController_Roo_Controller$com_springsource_category_types_web_CategoryController$createForm(CategoryController_Roo_Controller.aj:31) com.springsource.category.types.web.CategoryController.createForm(CategoryController.java:1) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:710) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:167) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:414) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:402) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630) org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436) org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195) org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159) org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141) org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90) org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:71) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:113) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) java.lang.Thread.run(Thread.java:619)
I will be thankful if any one could help me...


Reply With Quote