birk 发表于 2017-1-29 11:21:28

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>
页: [1]
查看完整版本: tomcat中部署camel后启动出错