Announcement Announcement Module
Collapse
No announcement yet.
Roo shell does not generate ITDs for my @RooConversionService Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roo shell does not generate ITDs for my @RooConversionService

    Hello,

    I have added the following class in my Roo app:

    Code:
    package com.bignibou.converter;
    
    import org.springframework.format.FormatterRegistry;
    import org.springframework.format.support.FormattingConversionServiceFactoryBean;
    import org.springframework.roo.addon.web.mvc.controller.converter.RooConversionService;
    
    /**
     * A central place to register application converters and formatters.
     */
    @RooConversionService
    public class ApplicationConversionServiceFactoryBean extends FormattingConversionServiceFactoryBean {
    
    	@Override
    	protected void installFormatters(FormatterRegistry registry) {
    		super.installFormatters(registry);
    	}
    }
    I have registered the class as follows in webmvc-config.xml:
    Code:
    <mvc:annotation-driven conversion-service="applicationConversionService"/>
    and in applicationContext.xml:
    Code:
    <bean class="com.bignibou.converter.ApplicationConversionServiceFactoryBean" id="applicationConversionService"/>
    Note that I don't use JSP but Thymeleaf so that I have not run the "web mvc all" command at all.

    Can anyone please tell me why the ITDs for the RooConversionService are not generated??

    Regards,

    Julien.

  • #2
    Not completely sure you have the same problem as me but I'll stab in the dark.

    After following the pizza example using roo 1.2.4.release, I hit a problem where deployment to a tomcat server threw up errors complaining about not being able to resolve the applicationConversionService bean. So I'm assuming here that your claim that roo does not generate the itd is actually based on a deployment error similar to mine. If so then the itd are actually generated, which can be proven by looking in the ApplicationConversionServiceFactoryBean_Roo_Conver sionService.aj file, assuming you have a ApplicationConversionServiceFactoryBean.java class.

    After much cursing I found another post that proposed a solution which actually works and shows there is a bug in roo concerning this bean and surprisingly still seems to be there 2 years later http://forum.springsource.org/showth...245#post339245

    You have to add the following dependency to the pom file

    Code:
            <dependency>
                <groupId>org.springframework.roo</groupId>
                <artifactId>org.springframework.roo.addon.web.mvc.controller</artifactId>
                <version>${roo.version}</version>
                <scope>provided</scope>
            </dependency>
    Also, remove the bean definition in applicationContext.xml as the container will complain that the bean already exists, presumably due to the @RooConversionService annotation.

    Comment

    Working...
    X