应用程序上下文在初始化后不断重新加载

时间:2015-09-21 12:47:07

标签: java spring tomcat

我在使用Struts2,spring和Apache Tomcat在我的Web应用程序中启动StandardContext时遇到问题。服务器继续重新加载并且不会自行停止。以下代码不断重复。

set 21, 2015 2:26:40 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/My_Web_Service] has started
set 21, 2015 2:26:40 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
set 21, 2015 2:26:44 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

我必须加载一个属性文件,我使用它但不起作用:

<bean id="placeHolderBean"
        class="org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer">
        <constructor-arg ref="configurationEncryptor" />
        <property name="ignoreUnresolvablePlaceholders" value="true" />
        <property name="locations">
            <list>
                <value>classpath:myFile.properties</value>
            </list>
        </property>
        <property name="order" value="1"/>
    </bean>

    <bean id="replacerBean" class="it.vptech.util.editor.PasswordPlaceholderReplacer">
        <constructor-arg ref="configurationEncryptor" />
        <property name="locations">
            <list>
                <value>classpath:myFile.properties</value>
            </list>
        </property>
        <property name="order" value="0"/>
    </bean>

1 个答案:

答案 0 :(得分:0)

如果您确实需要写入文件,请将“reloadable”设置为 false。

在“可重新加载”部分阅读此内容 > https://tomcat.apache.org/tomcat-9.0-doc/config/context.html “如果您希望 Catalina 监视 /WEB-INF/classes/ 和 /WEB-INF/lib 中的类的更改,并在检测到更改时自动重新加载 Web 应用程序,请设置为 true。”

原谅我的简短,从手机发送