MAVEN搭建WEB环境问题
来源:互联网 发布:算法导论书在线观看 编辑:程序博客网 时间:2024/06/05 08:45
问题一:搭建完成后启动tomcat总是 No bean named 'cxf' is defined错误,在网上找了好多资料,终于搞定了该问题。下面是具体需要检查的内容:
解决方案:
1、需要将工程的Spring配置文件放到 src/main/resources下(千万不能和web.xml文件一起放到WEB-INF下面,之前就是因为放到这个下面了,配置文件一直没有加载上,导致一直报错,太蛋疼了);
2、web.xml配置文件(注意加粗的地方)
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="web" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Archetype Created Web Application</display-name><context-param><param-name>contextConfigLocation</param-name><param-value>classpath:applicationContext-*.xml</param-value></context-param><!-- Spring配置 --><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener><!-- Spring的log4j监听器 --><listener><listener-class>org.springframework.web.util.Log4jConfigListener</listener-class></listener><!-- CXF配置 --><servlet><servlet-name>CXFService</servlet-name><servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>CXFService</servlet-name><url-pattern>/webservice/*</url-pattern></servlet-mapping>
</web-app>
3、spring配置文件applicationContext-base.xml(注意加粗的地方)
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.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-extension-xml.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<bean id="CXFDemoImpl" class="com.deppon.fims.inter.uums.CXFDemoImpl" />
<jaxws:endpoint id="cxfDemo" implementor="#CXFDemoImpl" address="/cxfdemo" />
<context:annotation-config /><context:component-scan base-package="com.deppon" />
</beans>
以上三步可搞定这个问题,如果还搞不定就只能找度娘了
0 0
- MAVEN搭建WEB环境问题
- maven环境搭建问题
- maven的环境搭建以及maven搭建web项目
- birt+maven+web运行环境搭建
- birt+maven+web运行环境搭建
- 搭建maven结构的web工程的时候,出现各种环境的问题的解决
- eclipse+maven环境搭建问题总结
- Maven 搭建Maven环境
- IntelliJ IDEA+maven+perforce+tomcat部署(web环境搭建)
- 搭建eclipse+maven+scala-ide的scala web开发环境
- 从零开始搭建maven+eclipse+tomcat的web开发环境
- Spring + Maven + Dubbo + MyBatis + Linner + Handlebars-Web开发环境搭建
- Maven搭建Servlet环境(2)-添加web模块
- 一步到位、Maven搭建 SSH环境 动态web项目
- maven项目开发环境搭建之四导入maven、web转maven
- 【MAVEN】 Maven开发环境搭建
- Maven教程-搭建Maven环境
- Maven(一)Maven环境搭建
- 算法设计与分析——活动安排问题——C语言
- JavaScript和CSS实现详情图片显示大图特效
- 在ZeroMQ中使用SSL加密
- 合成聚合复用原则
- UIKit---UIButton状态,平移,缩放,代码方式动态添加控件
- MAVEN搭建WEB环境问题
- Apache shiro(3)-认证过程
- ZeroMQ指南:第1章:基本概念
- cocos2dx中的AndroidManifest.xml文件详解
- POJ1201 HDU1384 Intervals【SPFA】【差分约束】
- 设计模式之单例模式
- Dom4j解析xml
- 使用Eclipse构建Maven的SpringMVC项目
- bbb u-boot 验证 emmc