【问题标题】:Running maven project on tomcat在tomcat上运行maven项目
【发布时间】:2013-08-30 10:24:39
【问题描述】:

我正在使用 tomcat 7,当我运行我的 web 应用程序(maven 项目)时,它给了我这个错误:

Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:hr_demo-security-context.xml]

有人可以帮忙吗?提前致谢。

hr_demo-security-context.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security" 
    xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:lang="http://www.springframework.org/schema/lang"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/security 
        http://www.springframework.org/schema/security/spring-security-3.0.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-3.0.xsd">

</beans:beans>

【问题讨论】:

  • 能把hr_demo-security-context.xml的完整内容展示出来吗?
  • 这是完整的内容。这就是我在 hr_demo-security.xml 中的全部内容

标签: java spring maven tomcat


【解决方案1】:

您的hr_demo-security-context.xml 存在syntax 问题。

【讨论】:

【解决方案2】:

您对 XML 文件的代码内引用在部署后不再引用该文件(由于文件在打包后被移动),或者您发布的 xml 文件正在被引用,但其中没有条目 Spring越来越糊涂了。

【讨论】:

    猜你喜欢
    • 2012-10-05
    • 2019-12-13
    • 2020-10-30
    • 2019-03-30
    • 1970-01-01
    • 2010-10-29
    • 1970-01-01
    • 2011-06-27
    • 1970-01-01
    相关资源
    最近更新 更多