Problem with GA 1.0 Tutorial
I am in the process of learning Roo. I was going through the tutorial section 'Beginning With Roo: The Tutorial' in the 'Spring Roo - Reference Documentation' that was available in the download.
I was successful to the point of adding security... Immediately after doing 'security update' from the STS Roo Shell, an error appears in the STS Marker tab, indicating a problem with the webmvc-config.xml file. The red X also appears by the file.
The error is listed below:
Unexpected exception parsing XML document from file [C:/data/projects/roo-test/pizza/src/main/webapp/WEB-INF/spring/webmvc-config.xml]; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'org.springframework.web.servlet.handler.SimpleUrl HandlerMapping#pizza#src/main/webapp/WEB-INF/spring/webmvc-config.xml#20' is defined webmvc-config.xml /pizza/src/main/webapp/WEB-INF/spring Unknown Spring Beans Problem
After 'security setup', I ran the following in the STS Roo shell.
perform package
perform eclipse
Did a refresh in STS
Still had the problem.
Did a clean
Did another refresh in STS
Still had the problem.
So I exited STS, removed .metadata directory, invoked STS, import from existing project.
Still had the problem.
So it doesn't appear to be a state issue with STS.
I expected that Roo should have added a bean for the given class, ...SimpleUrlHandlerMapping. There is no bean with that class name in the file.
Is there a way in Roo to fix this problem. Do I have to add the missing bean manually... If so, it would be helpful to note that in the documentation and it would be helpful to have a listing of the bean definition.
Problem with GA 1.0 Tutorial
I should also note that I am using
roo-1.0.0.RELEASE
sts-2.3.0.RELEASE
in springsource download for STS; but use a different download of Roo for the command shell executed outside of STS. That download is spring-roo-1.0.0.RELEASE.
Since it is the same version; I'm thinking this is not an issue...
Problem with GA 1.0 Tutorial
Here is the webmvc-config.xml file contents:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<!-- The controllers are autodetected POJOs labeled with the @Controller annotation. -->
<context:component-scan base-package="gov.va.med.roo.pizzashop" use-default-filters="false">
<context:include-filter expression="org.springframework.stereotype.Controller" type="annotation"/>
</context:component-scan>
<!-- Turns on support for mapping requests to Spring MVC @Controller methods
Also registers default Formatters and Validators for use across all @Controllers -->
<mvc:annotation-driven/>
<!-- register "global" interceptor beans to apply to all registered HandlerMappings -->
<mvc:interceptors>
<bean class="org.springframework.web.servlet.theme.ThemeChangeInterceptor"/>
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" p:paramName="lang"/>
</mvc:interceptors>
<!-- selects a static view for rendering without the need for an explicit controller -->
<mvc:view-controller path="/login"/>
<mvc:view-controller path="/index"/>
<mvc:view-controller path="/uncaughtException"/>
<mvc:view-controller path="/resourceNotFound"/>
<mvc:view-controller path="/dataAccessFailure"/>
<!-- Resolves logical view names returned by Controllers to Tiles; a view
name to resolve is treated as the name of a tiles definition -->
<bean class="org.springframework.js.ajax.AjaxUrlBasedViewResolver" id="tilesViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/>
</bean>
<!-- Configures the Tiles layout system -->
<bean class="org.springframework.web.servlet.view.tiles2.TilesConfigurer" id="tilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/layouts/layouts.xml</value>
<!-- Scan views directory for Tiles configurations -->
<value>/WEB-INF/views/**/views.xml</value>
</list>
</property>
</bean>
<!-- Resolves localized messages*.properties and application.properties files in the application to allow for internationalization.
The messages*.properties files translate Roo generated messages which are part of the admin interface, the application.properties
resource bundle localizes all application specific messages such as entity names and menu items. -->
<bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource" p:basenames="WEB-INF/i18n/messages,WEB-INF/i18n/application" p:fallbackToSystemLocale="false"/>
<!-- store preferred language configuration in a cookie -->
<bean class="org.springframework.web.servlet.i18n.CookieLocaleResolver" id="localeResolver" p:cookieName="locale"/>
<!-- resolves localized <theme_name>.properties files in the classpath to allow for theme support -->
<bean class="org.springframework.ui.context.support.ResourceBundleThemeSource" id="themeSource"/>
<!-- store preferred theme configuration in a cookie -->
<bean class="org.springframework.web.servlet.theme.CookieThemeResolver" id="themeResolver" p:cookieName="theme" p:defaultThemeName="standard"/>
<!-- This bean resolves specific types of exceptions to corresponding logical - view names for error views.
The default behaviour of DispatcherServlet - is to propagate all exceptions to the servlet container:
this will happen - here with all other types of exceptions. -->
<bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
<prop key=".DataAccessException">dataAccessFailure</prop>
<prop key=".NoSuchRequestHandlingMethodException">resourceNotFound</prop>
<prop key=".TypeMismatchException">resourceNotFound</prop>
<prop key=".lang.Exception">uncaughtException</prop>
</props>
</property>
</bean>
<!-- allows for integration of file upload functionality -->
<bean class="org.springframework.web.multipart.commons.CommonsMultipartResolver" id="multipartResolver"/>
</beans>
Problem with GA 1.0 Tutorial
I gave up and tried again, creating a new project. This time I didn't get as far.. After 'controller all ...' I got an error in STS that I do not have any clue how to debug... There is no description for the error, the location is 'unknown'; the type is 'Validation Message' and the resource is the project. I tried this twice with the same result... I did a 'perform eclipse' and refresh each time...
I don't think Roo and STS combined are ready for prime time... I don't have much confidence since I haven't been able to get a simple tutorial app to work... The AspectJ code and Roo annotations is unfamiliar; so I have some ramping up to do there...
I like the over direction and concept behind Roo; but don't feel like it is stable enough to develop real applications.