Announcement Announcement Module
No announcement yet.
Problem with GA 1.0 Tutorial Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    Problem with GA 1.0 Tutorial

    I should also note that I am using

    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...


    • #3
      Problem with GA 1.0 Tutorial

      Here is the webmvc-config.xml file contents:

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <beans xmlns="" xmlns:context="" xmlns:mvc="" xmlns:p="" xmlns:xsi="" xsi:schemaLocation="">
      	<!-- The controllers are autodetected POJOs labeled with the @Controller annotation. -->
      	<context:component-scan base-package="" use-default-filters="false">
      		<context:include-filter expression="org.springframework.stereotype.Controller" type="annotation"/>
      	<!-- Turns on support for mapping requests to Spring MVC @Controller methods
      	     Also registers default Formatters and Validators for use across all @Controllers -->
      	<!-- register "global" interceptor beans to apply to all registered HandlerMappings -->
      		<bean class="org.springframework.web.servlet.theme.ThemeChangeInterceptor"/>
      		<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" p:paramName="lang"/>
      	<!-- 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"/>
      	<!-- Configures the Tiles layout system -->
      	<bean class="org.springframework.web.servlet.view.tiles2.TilesConfigurer" id="tilesConfigurer">
      		<property name="definitions">
      				<!-- Scan views directory for Tiles configurations -->
      	<!-- Resolves localized messages*.properties and files in the application to	allow for internationalization. 
      		The messages*.properties files translate Roo generated messages which are part of the admin interface, the
      		resource bundle localizes all application specific messages such as entity names and menu items. -->
      	<bean class="" 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="" 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">
      				<prop key=".DataAccessException">dataAccessFailure</prop>
      				<prop key=".NoSuchRequestHandlingMethodException">resourceNotFound</prop>
      				<prop key=".TypeMismatchException">resourceNotFound</prop>
      				<prop key=".lang.Exception">uncaughtException</prop>
      	<!-- allows for integration of file upload functionality -->
      	<bean class="org.springframework.web.multipart.commons.CommonsMultipartResolver" id="multipartResolver"/>


      • #4
        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.


        • #5

          What you are seeing is a problem between Spring MVC and the SpringSource Tool Suite XML validating parser. This is not an issue which will affect the functionality in your Roo application in any way. When running your application you will not see any issues as a result of this unfortunate Error marker displayed in STS. We have already addressed this problem in Spring Framework 3 trunk and it will go away once Spring Framework 3.0.1 is released and Roo applications use that.


          • #6
            Thanks for your response...

            You were correct... The application ran fine with that error...
            I also finished reading the ROO reference manual. I found that it removed a lot of the mystery around AspectJ and the Roo annotations... I can proceed with a real application feeling confident that I know what Roo is doing on a project level.


            • #7
              Glad to hear that! Please let us know how it goes.