java - "Invalid content was found starting with element ' http :basicAuthSupplier '" while building Apache CXF project

标签 java xml spring cxf

您好,我正在使用 Maven、Eclipse、Tomcat 构建 Web 应用程序。 解决我的依赖关系后,我收到此错误。谁能帮忙解决这个问题吗?

cvc-complex-type.2.4.a: Invalid content was found starting with element 'http:basicAuthSupplier'.One of '{"http://cxf.apache.org/transports/http/configuration":client, "http://cxf.apache.org/transports/http/configuration":authorization, "http://cxf.apache.org/transports/http/configuration":proxyAuthorization,"http://cxf.apache.org/transports/http/configuration":tlsClientParameters, "http://cxf.apache.org/transports/http/configuration":authSupplier, "http://cxf.apache.org/transports/http/configuration":trustDecider}' is expected.  jaxws-web-context.xml 

这是出现此错误的代码:

<http:conduit name="*.http-conduit">
    <http:basicAuthSupplier class="org.skyway.spring.util.webservice.cxf.HttpBasicAuthenticationSupplier" />
</http:conduit>

最佳答案

错误消息列出了所有允许的 XML 元素。

正如您在列表中看到的,没有前缀 basicAuthSupplier。尝试使用 authSupplier 代替:

<http:authSupplier class="org.skyway.spring.util.webservice.cxf.HttpBasicAuthenticationSupplier" />

相关:

关于java - "Invalid content was found starting with element ' http :basicAuthSupplier '" while building Apache CXF project,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18527146/

相关文章:

android - 是否可以使用android :inputType with a string resource

java - 使用 Javanet 从 .NET System.DrawingImage 获取 Java 对象中的 Image 对象

java - 使用 REST 访问 JPA 数据失败 找不到合适的 HttpMessageConverter

java - 2个链表集之间的并集和交集,java

c# - 无需 Linq 即可解析和访问 XML

MySQL:从格式异常的 XML 文件中提取数据

java - Swagger 文档中缺少参数端点的 Spring boot GET 和 GET

java - Spring Boot Pojo 的 Pojo 验证不起作用

java - 通过postman测试上传端点

java - 单元测试模拟服务实现