Spring3-Maven3-CXF2.6.1-TOMCAT6构建项目
启动后访问http://localhost:8080/appname/userDo?wsdl报错,如下:
Allocate exception for servlet CXFServlet
java.lang.ClassCastException: org.apache.cxf.transport.servlet.CXFServlet cannot be cast to javax.servlet.Servlet
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1116)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
不用Maven构建项目可以成功访问,有没有大拿可以帮忙解决?感激不尽。
web.xml:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
applicationContext.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-xml.xml" />
<bean id="userDo" class="com.gavin.ws.UserDoImpl"></bean>
<jaxws:endpoint id="userService" implementor="#userDo"
address="/userDo" />
</beans>
pom.xml:
<properties>
<cxf.version>2.6.1</cxf.version>
<spring.version>3.0.5.RELEASE</spring.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>3.8.1</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-core</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-simple</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-databinding-aegis</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-local</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-jms</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-management</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-common-utilities</artifactId>
<version>2.5.10</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-asm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>
不用Maven构建项目可以成功访问,有没有大拿可以帮忙解决?感激不尽。
相关推荐
Maven 使用 tomcat8-maven-plugin 插件 Maven 是一个流行的构建自动化工具,它可以帮助开发者自动完成项目的编译、测试、打包、部署等任务。 Tomcat 是一个流行的 Web 服务器,Maven 提供了一个插件 tomcat8-maven-...
《深入解析修改版tomcat7-maven-plugin-2.2.jar》 在Java开发领域,Maven作为项目管理和构建工具,极大地简化了依赖管理和构建流程。而Tomcat,作为广泛使用的开源Servlet容器,是Java Web应用部署的首选平台。当...
maven-tomcat-plugin让maven与tomcat配合得很好。它可以把应用部署到Tomcat服务器,也可以把tomcat作为内嵌服务器启动,就像jetty一样。 使用JPDA启动tomcat的远程调试功能。这样就能与eclipse配合起来,轻松地实现...
java运行依赖jar包
解决tomcat8-maven-plugin-3.0-r1655215.jar阿里云同有的问题。放到路径org\apache\tomcat\maven\tomcat8-maven-plugin\3.0-r1655215\就可以了
java运行依赖jar包
java运行依赖jar包
赠送Maven依赖信息文件:spring-data-redis-2.6.1.pom; 包含翻译后的API文档:spring-data-redis-2.6.1-javadoc-API文档-中文(简体)版.zip; Maven坐标:org.springframework.data:spring-data-redis:2.6.1; 标签...
java运行依赖jar包
这里指定了`spring-boot-maven-plugin`插件的基本信息,包括其所在的组ID(`org.springframework.boot`)以及插件的ID(`spring-boot-maven-plugin`)。虽然没有显示具体的配置信息,但该插件默认会执行诸如添加...
tomcat6-maven-plugin-2.1插件包
标题中的"tomcat7-maven-plugin-2.2.jar.zip"是一个Maven插件的压缩文件,主要用于Java Web应用程序的部署和管理。Tomcat7是一个流行的开源应用服务器,它实现了Servlet和JSP规范,用于运行Java Web应用。而Maven是...
赠送Maven依赖信息文件:spring-data-keyvalue-2.6.1.pom; 包含翻译后的API文档:spring-data-keyvalue-2.6.1-javadoc-API文档-中文(简体)版.zip; Maven坐标:org.springframework.data:spring-data-keyvalue:...
赠送Maven依赖信息文件:spring-data-keyvalue-2.6.1.pom; 包含翻译后的API文档:spring-data-keyvalue-2.6.1-javadoc-API文档-中文(简体)-英语-对照版.zip; Maven坐标:org.springframework.data:spring-data-key...
maven-3.5.0版本的本地资源包,直接解压就可使用。 方式1 需要在系统环境变量中直接配置path中配置,路径是到bin目录。 方式2 新建配置(MAVEN_HOME),路径为是解压后的maven根目录,再在path中引用(%MAVEN_HOME%\...
apache-maven-3.6.3全部版本的下载文件: apache-maven-3.6.3-bin.tar.gz; apache-maven-3.6.3-bin.zip; apache-maven-3.6.3-src.tar.gz; apache-maven-3.6.3-src.zip;
ECLIPSE MAVEN3插件文件(eclipse-maven3-plugin工具)
1. 下载:从Apache官方网站获取最新版本的tarball文件,如`apache-maven-3.8.5-bin.tar`和`apache-tomcat-8.5.78.tar`。 2. 解压:使用`tar -zxvf 文件名.tar`命令解压文件到指定目录。 3. 配置环境变量:编辑`~/....