Search code examples
javaspringspring-mvcspring-roobirt

Conversion-service class in spring


I have a class called ApplicationConversionServiceFactoryBean which is configured inside webmvc-config.xml as conversion-service:

ApplicationConversionServiceFactoryBean

@RooConversionService
public class ApplicationConversionServiceFactoryBean extends FormattingConversionServiceFactoryBean {

    @SuppressWarnings("deprecation")
    @Override
    protected void installFormatters(FormatterRegistry registry) {
        super.installFormatters(registry);
        // Register application converters and formatters
    }

}

part of webmvc-config.xml

<mvc:annotation-driven  conversion-service="applicationConversionService"/> 
<bean class="com.palak.uauth.web.ApplicationConversionServiceFactoryBean" id="applicationConversionService"/>

I have Eclipse Birt integrated with my application which forces me to remove that <mvc annotaion-driven /> line.

So what do i do to register my conversion-service by any other way,so that, i dont have that mvc annotaion tag anymore?


Solution

  • I'd suggest solving the root cause, i.e. BIRT fighting with your XML namespaces. Either check what the exact namespace error is and address that, or alternatively, configure Spring MVC using an @Configuration class with an @EnableWebMvc annotation.

    You can easily mix XML and Java configuration, you simply need to component scan your @Configuration class in your XML files.