springboot整合cxf框架启动报错

异常信息:

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 1 of constructor in org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration required a bean of type 'org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath' that could not be found.

The following candidates were found but could not be injected:
    - Bean method 'dispatcherServletRegistration' in 'DispatcherServletAutoConfiguration.DispatcherServletRegistrationConfiguration' not loaded because DispatcherServlet Registration found non dispatcher servlet dispatcherServlet


Action:

Consider revisiting the entries above or defining a bean of type 'org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath' in your configuration.
 


解决方法:

由于springboot使用了2.1.2及以上版本,在官方中并未找到整合cxf框架的配置,所以导入cxf-spring-boot-starter-jaxws启动会报错;

将springboot版本调到2.1.2.RELEASE以下即可正常启动。

配上pom.xml:



    4.0.0
    
        org.springframework.boot
        spring-boot-starter-parent
        
        2.0.1.RELEASE
         
    
    com.demo
    springboot-cxf-demo
    0.0.1-SNAPSHOT
    springboot-cxf-demo
    Demo project for Spring Boot

    
        1.8
        UTF-8
        UTF-8
    

    
        
            org.springframework.boot
            spring-boot-starter
        

        
        
            org.apache.cxf
            cxf-spring-boot-starter-jaxws
            3.2.4
        
        

        
            org.springframework.boot
            spring-boot-starter-test
            test
        
    

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
        
    


 

你可能感兴趣的:(异常)