tomcat中部署camel后启动出错

将通过spring控制camel的程序部署到tomcat启动时遇到两个问题,首先是启动时提示找不到org.springframework.web.context.ContextLoaderListener这个类,发现是spring-web-xx.jar这个jar包未添加。添加后又出第二个问题,提示spring加载类时找不到配置文件的异常,后查明是因为applicationContext.xml、log4j.properties等配置文件放在了classes目录,需要在web.xml中加入如下配置:

<context-param>

<param-name>contextConfigLocation</param-name>

<param-value>classpath*:/context*.xml</param-value>

</context-param>

猜你喜欢

转载自hylxsfh.iteye.com/blog/1749431