提供弹簧靴和静音的静态内容

时间:2014-12-02 13:58:15

标签: spring spring-mvc spring-boot resteasy

我已经为我们的后端Web应用程序集成了resteasy和spring boot。我的application.java文件如下所示

@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);
    }

为了从我的Web应用程序提供静态内容,建议@ Spring Boot not serving static content扩展 WebMvcAutoConfigurationAdapter 。一旦我做了同样的事情,我得到了以下异常

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]

我将我的应用程序打包为可执行jar。任何人都可以在提供静态内容时如何避免上述异常?

0 个答案:

没有答案