cxf之Caused by: java.lang.RuntimeException: Soap 1.1 endpoint already registered on address /rest
发布rest服务
但是spring-cxf-rest.xml中配置的却是
<jaxws:server address="/weather"....................................
应当是
<jaxrs:server address="/weather".....................................
===========================羞耻的分割线(真正元凶)=============================
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<display-name>Archetype Created Web Application</display-name>
<!--Spring配置-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>SpringMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>SpringMVC</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping> <!-- CXF框架的配置 -->
<servlet>
<servlet-name>cxf</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/ws/*</url-pattern>
</servlet-mapping> <welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
spring.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
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.xsd">
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
</list>
</property>
</bean>
<!--<import resource="classpath*:spring-mvc.xml" />-->
<import resource="classpath*:spring-mybatis.xml" />
<import resource="classpath*:spring-cxf-rest.xml" /> </beans>
以上字体红色加粗加大部分是更正后的配置~(编辑器原因显示不出来,不过,上面的web.xml和spring.xml是正确的配置).
更正前:
web.xml中SpringMVC的配置:<param-value>classpath:spring.xml</param-value>
Spring.xml中引入spring-mvc.xml的配置:<import resource="classpath*:spring-mvc.xml" />
也并未注释, 这是配置springmvc时相当于加载了spring的配置文件一次(拆分Spring配置文件时不明确web.xml配置导致)
而web.xml上部引入spring.xml及配置监听器也已经引入了一次,相当于二次加载spring.xml, 这样一来必然会报如题错误.
总结:
磨刀不误砍柴工, 基础性的东西不吃透必然多走弯路, 而且是重复性的弯路.
cxf之Caused by: java.lang.RuntimeException: Soap 1.1 endpoint already registered on address /rest的更多相关文章
- Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 18
工程启动的时候有报下面这个错误的,更新下工程的jar包依赖,然后在工程的pom文件里加上下面的jar包 Caused by: java.lang.RuntimeException: java.io.I ...
- hive Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
Exception in thread "main" java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata. ...
- Caused by: java.net.ConnectException: Connection refused/Caused by: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
1.使用sqoop技术将mysql的数据导入到Hive出现的错误如下所示: 第一次使用命令如下所示: [hadoop@slaver1 sqoop--cdh5.3.6]$ bin/sqoop impor ...
- ambari-server启动出现Caused by: java.lang.RuntimeException:java.lang.ClassNotFoundEception:com.mysql.jdbc.Driver问题解决办法(图文详解)
不多说,直接上干货! 问题详解 启动ambari-server出现 Caused by: java.lang.RuntimeException:java.lang.ClassNotFoundEcept ...
- RxVolley报错:Caused by: java.lang.RuntimeException: RequestQueue-> DiskBasedCache cache dir error
Caused by: java.lang.RuntimeException: RequestQueue-> DiskBasedCache cache dir error 这是因为SD卡动态权限导 ...
- sqoop导出hive数据到mysql错误: Caused by: java.lang.RuntimeException: Can't parse input data
Sqoop Export数据到本地数据库时出现错误,命令如下: sqoop export \ --connect 'jdbc:mysql://202.193.60.117/dataweb?useUni ...
- Caused by: java.lang.RuntimeException: JxBrowser license check failed: No valid license found
使用jxbrower报错,原因时证书检验失败, 解决方案: 1.首先创建证书,下面是我在IDEA maven项目中创建的位置,Java项目中在src/目录下创建, META-INF/teamdev.l ...
- Caused by: java.lang.RuntimeException: by java.lang.OutOfMemoryError: PermGen space(tomcat 启动时提示内存溢出)
设置MaxPermSize大小TOMCAT_HOME/bin/catalina.bat 文件头加set JAVA_OPTS='-Xms512m -Xmx1024m -XX:MaxPermSize=51 ...
- hive脚本出现Error: java.lang.RuntimeException: Error in configuring object和Caused by: java.lang.IndexOutOfBoundsException: Index: 9, Size: 9
是在reduce阶段报的错误,详细错误信息是 朱传豪 19:04:48 Diagnostic Messages for this Task: Error: java.lang.RuntimeExcep ...
随机推荐
- 最小二乘法least square
上研究生的时候接触的第一个Loss function就是least square.最近又研究了一下,做个总结吧. 定义看wiki就够了.公式如下 E(w)=12∑n=1N{y−xWT}2E(w)=12 ...
- Android安卓手机游戏开发
成都传智播客Java培训,免费学Android安卓手机游戏开发,安卓android开发课程包括Android安卓应用开发和Android安卓游戏开发两个方向,可是偏向游戏开发. 依据"199 ...
- find-k-pairs-with-smallest-sums
// https://discuss.leetcode.com/topic/50527/java-10ms-solution-no-priority-queue class Solution { pu ...
- 附6 hystrix metrics and monitor
一.基本方式 hystrix为每一个commandKey提供了计数器 二.实现流程 https://raw.githubusercontent.com/wiki/Netflix/Hystrix/ima ...
- 第二章 Jackson属性名转换+属性忽略
@Data @JsonIgnoreProperties(ignoreUnknown = true) public class MyRecord { private boolean succeed; p ...
- 用VLC读取摄像头产生RTSP流,DSS主动取流转发(一)(二) 【转】
http://blog.csdn.net/fm0517/article/details/38110633 http://blog.csdn.net/fm0517/article/details/381 ...
- Android中的树状(tree)列表
树状列表前端挺常用的,还有人专门写过Ztree,Android中有的时候也需要使用到树状列表,上篇文章写了一下ExpandableListView,ExpandableListView最多支持两级结构 ...
- Sql Server-查询一列的数据进行拼接
select convert(VARCHAR(10),memberid) +',' from t_member where teamid = 1009 for xml path('')
- 解决ArcEngine开发程序“假死”现象
在GIS数据处理中,数据量大是一个非常伤脑筋的问题.最近,在写一个CAD注记转Shapefile文件时,又遇到这个问题. 曾经处理一次数据,达130万个点,即测试区域内的栅格转成点全部处理,程序是写好 ...
- Memcached 的一些用法
public interface ICache { object Get(string key); /// <summary> /// 根据 key 从缓存中读取数据 /// </s ...