【问题标题】:Bounded mismatch with ServletRegistrationBean<MessageDispatcherServlet>与 ServletRegistrationBean<MessageDispatcherServlet> 的边界不匹配
【发布时间】:2023-01-13 16:27:06
【问题描述】:

我尝试编写返回的 ServletRegistrationBean 方法 MessageDispatcherServlet 实例,我收到有界不匹配错误。

这是我写的方法:

public ServletRegistrationBean<MessageDispatcherServlet> requestDispatcher (ApplicationContext conext){
        MessageDispatcherServlet msd = new MessageDispatcherServlet();
        msd.setApplicationContext(conext);
        msd.setTransformWsdlLocations(true);
servletContext.addServlet("MessageDispatcherServlet",msd);
        return new ServletRegistrationBean<MessageDispatcherServlet>(msd, "/soap/*");
    }

我究竟做错了什么?

【问题讨论】:

  • 您使用的是哪个 Spring Boot 版本?请添加您在构建文件中的依赖项。

标签: java spring web-services


【解决方案1】:

我解决了这个

 issue by configuring pom file with the next dependancy:
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

代替 :

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter</artifactId>
</dependency>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多