为什么我无法访问 tomcat 中的服务 CXF:HTTP 状态 500 - 内部服务器错误

Why i cannot access to services CXF in tomcat : HTTP Status 500 - Internal Server Error

当我 运行 它在 tomcat 服务器上 returns 服务页面出现以下错误我无法访问 WSDL 和 SOAP

我有这个错误:

HTTP Status 500 - Internal Server Error

Type Exception Report

"Servlet.init ()" message for servlet [CXFServlet] raised an exception

description The server encountered an internal error that prevented it from satisfying the request.

exception javax.servlet.ServletException: "Servlet.init ()" for servlet [CXFServlet] raised an exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:748)

文件内容:

cxf-servlet.xml

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
    xmlns:cxf="http://cxf.apache.org/core"
    xmlns:soap="http://cxf.apache.org/bindings/soap"
    xsi:schemaLocation="http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd 
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/bindings/soap 
    http://cxf.apache.org/schemas/configuration/soap.xsd 
    http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

  <jaxws:server id="hallo" address="/hallo">
  <jaxws:serviceBean>
   <bean class="CXF-Maven.DemoClass"/>
  </jaxws:serviceBean>
  </jaxws:server>

</beans>

http://localhost:8080/ 工作正常 但是http://localhost:8080/CXF-Maven/services我不能通过

当我在文件上使用旧版本的依赖项时,我遇到了一个问题 pom.xml 将文件配置 pom.xml 更新为新版本,现在一切正常。谢谢

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.demowb</groupId>
  <artifactId>demowb</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>cxfweb Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
  <dependencies>
  <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-frontend-jaxws -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>3.2.4</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-transports-http -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>3.2.4</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>5.0.5.RELEASE</version>
        </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>demoweb</finalName>
  </build>
</project>