2016-05-22 5 views
3

Ich habe meine Anwendung in meiner Linux-Box bereitgestellt. Ich benutze einfach apache tomcat 7 Version. Ich bin in der Lage zu sehen, mein Kater context is initializedaber sofort nach der Initialisierung, Kontext wird zerstört. Ich sehe keine Ausnahme in der Protokolldatei.Tomcat-Anwendung gestartet, aber sofort zerstören

[Loaded org.springframework.util.ConcurrentReferenceHashMap $ EntryIterator aus Datei: /var/cache/easy-tomcat7/work/Catalina/web.com/web-1.0.0-BUILD-SNAPSHOT/WEB -INF/lib/spring-core-4.2.1.RELEASE.jar] DEBUG: org.springframework.web.context.ContextLoader - Stammverzeichnis publiziert WebApplicationContext als ServletContext-Attribut mit dem Namen [org.springframework.web.context.WebApplicationContext .ROOT] INFO: org.springframework.web.context.ContextLoader - Root WebApplicationContext: Initialisierung in 7637 ms abgeschlossen INFO: org.springframework.web.context.support.XmlWebAppl icationContext - Closing Root WebApplicationContext: Startdatum [So 22. Mai 07:58:10 UTC 2016]; Wurzel Kontexthierarchie DEBUG: org.springframework.core.env.PropertySourcesPropertyResolver - Searching for key 'spring.liveBeansView.mbeanDomain' in [servletConfigInitParams] DEBUG: org.springframework.core.env.PropertySourcesPropertyResolver - für Schlüssel Searching 'spring.liveBeansView.mbeanDomain' in [servletContextInitParams] DEBUG: org.springframework.core.env.PropertySourcesPropertyResolver - gefunden key 'spring.liveBeansView.mbeanDomain' in [servletContextInitParams] mit Typ [Zeichenfolge] und den Wert 'dev' DEBUG: org.springframework.beans.factory.support.DefaultListableBeanFactory - Zurückgegebene zwischengespeicherte Instanz von Singleton Bean 'lifecycleProce SSOR-‘ DEBUG: org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying Singletons in org.s[email protected]2b48a930:

Dies ist die Datei web.xml .

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> 
    <display-name>web</display-name> 
    <context-param> 
    <param-name>log4jConfigLocation</param-name> 
    <param-value>/WEB-INF/config/log4j.xml</param-value> 
    </context-param> 
    <context-param> 
    <param-name>spring.profiles.active</param-name> 
    <param-value>dev</param-value> 
</context-param> 
<context-param> 
    <param-name>spring.profiles.default</param-name> 
    <param-value>dev</param-value> 
</context-param> 
<context-param> 
    <param-name>spring.liveBeansView.mbeanDomain</param-name> 
    <param-value>dev</param-value> 
</context-param> 
    <listener> 
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> 
    </listener> 
    <filter> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> 
    </filter> 
    <filter-mapping> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <url-pattern>/*</url-pattern> 
    </filter-mapping> 
    <filter-mapping> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <url-pattern>/login/auth</url-pattern> 
    <dispatcher>FORWARD</dispatcher> 
    </filter-mapping> 
    <filter> 
    <filter-name>hiddenHttpMethodFilter</filter-name> 
    <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class> 
    </filter> 
    <filter-mapping> 
    <filter-name>hiddenHttpMethodFilter</filter-name> 
    <url-pattern>/*</url-pattern> 
    </filter-mapping> 
    <context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value> 
      /WEB-INF/spring/root-context.xml    
      /WEB-INF/spring/appServlet/security-context.xml 
     </param-value> 
    </context-param> 
    <listener> 
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
    </listener> 
    <servlet> 
    <servlet-name>web</servlet-name> 
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
    <init-param> 
     <param-name>contextConfigLocation</param-name> 
     <param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value> 
    </init-param> 
    <load-on-startup>1</load-on-startup> 
    </servlet> 
    <servlet-mapping> 
    <servlet-name>web</servlet-name> 
    <url-pattern>/</url-pattern> 
    </servlet-mapping> 
</web-app> 

Wurzel context.xml

<beans:beans xmlns="http://www.springframework.org/schema/mvc" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" 
    xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" 
    xmlns:jdbc="http://www.springframework.org/schema/jdbc" 
    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd 
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd 
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd 
     http://www.springframework.org/schema/jdbc 
     http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">   


</beans:beans> 
+0

Haben Sie Glück mit diesem Problem? – EpicPandaForce

Antwort

0

Haben Sie in Ihrem @Configuration Klassen definiert Profil spezifische Konfiguration haben, wie

@Configuration 
public class MyConfig { 

    @Configuration 
    @Profile(value="dev") 
    public static class DevConfiuration { 
     @Bean 
     ///some bean methods here 
    } 
} 

wenn nicht, versuchen Sie unten angegebenen Tags Profile Entfernen insgesamt und sehen, ob es bereitgestellt wird.

<context-param> 
    <param-name>spring.profiles.active</param-name> 
    <param-value>dev</param-value> 
</context-param> 
<context-param> 
    <param-name>spring.profiles.default</param-name> 
    <param-value>dev</param-value> 
</context-param> 
<context-param> 
    <param-name>spring.liveBeansView.mbeanDomain</param-name> 
    <param-value>dev</param-value> 
</context-param> 
+0

Ich habe das gleiche versucht, aber es hat nicht geholfen. – jdeveloper