代码之家  ›  专栏  ›  技术社区  ›  AF ik

Spring、Tomcat、Java

  •  1
  • AF ik  · 技术社区  · 9 年前

    当我在tomcat中运行.war文件时,日志显示

    错误[com.configleon.configurer.WebPropertyConfigurer]-JVM设置中未指定“configLocation”变量!

    错误[org.springframework.web.context.ContextLoader]-上下文初始化失败

    这是我的代码:

    <!-- configlion property configurator -->
    <bean class="com.configleon.configurer.WebPropertyConfigurer">
        <property name="propertyResources">
            <bean class="com.configleon.resource.WebPropertyResources"/>
        </property>
    </bean>
    

    有人能帮我吗?

    1 回复  |  直到 4 年前
        1
  •  1
  •   Greesh Kumar    9 年前

    第一个错误[com.configleon.configurer.WebPropertyConfigurer]

    请参见 here

    第二个

    ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
    

    在部署环境中,只需确保您的服务器类路径包含Springjar库(例如Spring-2.5.6.jar)。

    对于Spring3,ContextLoaderListener将移动到spring web。jar,您可以从Maven中央存储库获取该库。

    加成

    <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>3.0.5.RELEASE</version>
        </dependency>