0

I have integrated resteasy with spring boot for our backend web application. My application.java file looks like below

@ComponentScan(basePackages = "<basepackage>")
@EnableAutoConfiguration
@EnableWebMvc
@ImportResource(value = { "classpath:springmvc-resteasy.xml" })
public class Application {
  public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
  }
}

In order to serve static content from my web application, it was suggested @https://stackoverflow.com/questions/24661289/spring-boot-not-serving-static-content to extend WebMvcAutoConfigurationAdapter. Once I did the same, I got the following exception

java.lang.IllegalStateException: could not find the type for bean named faviconRequestHandler
    at org.jboss.resteasy.plugins.spring.SpringBeanProcessor.getBeanClass(SpringBeanProcessor.java:437) ~[resteasy-spring-3.0.8.Final.jar:na]
    at org.jboss.resteasy.plugins.spring.SpringBeanProcessor.processBean(SpringBeanProcessor.java:294) ~[resteasy-spring-3.0.8.Final.jar:na]
    at org.jboss.resteasy.plugins.spring.SpringBeanProcessor.postProcessBeanFactory(SpringBeanProcessor.java:272) ~[resteasy-spring-3.0.8.Final.jar:na]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:265) ~[spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:170) ~[spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609) ~[spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) ~[spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120) ~[spring-boot-1.1.5.RELEASE.jar:1.1.5.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) [spring-boot-1.1.5.RELEASE.jar:1.1.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) [spring-boot-1.1.5.RELEASE.jar:1.1.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:952) [spring-boot-1.1.5.RELEASE.jar:1.1.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:941) [spring-boot-1.1.5.RELEASE.jar:1.1.5.RELEASE]
    at com.xactly.insights.app.Application.main(Application.java:33) [classes/:na]

I package my application as executable jar. Can anyone throw some light on how to avoid the above exception while serving the static content?

João Dias
  • 16,277
  • 6
  • 33
  • 45
Gowri Shankar
  • 161
  • 1
  • 3
  • 12
  • You should need `@EnableWebMvc`. What is in your `springmvc-reasteasy.xml` file, make sure you aren't fighting with Spring Boots auto configuration. – M. Deinum Dec 02 '14 at 18:43
  • springmvc-resteasy.xml is provided by resteasy framework to integrate with spring's dispatcherservlet. Its content is present here https://github.com/resteasy/Resteasy/blob/master/jaxrs/resteasy-spring/src/main/resources/springmvc-resteasy.xml – Gowri Shankar Dec 03 '14 at 01:25

0 Answers0