2016-07-24 19 views
0

Ich benutze Maven, Eclipse. Alles ist in Ordnung, wenn man von Eclipse aus läuft. Aber gleich, wenn ich tomcat bereitstellen auf kehrt http Status 404. log sagt kein Frühlings WebApplicationInitializer Typen auf Classpath erkannt, aber ich bin mit web.xmlSpring-Anwendung funktioniert in Eclipse, aber funktioniert nicht, wenn auf Kater entfaltet 8

Ich bin nicht in der Lage, um herauszufinden, geht es hier, kann, wenn jemand helfen bitte . Es gibt kein Problem bei der Filter- und Servlet-Zuordnung.

web.xml

contextClass org.springframework.web.context.support.AnnotationConfigWebApplicationContext

<!-- Location of Java @Configuration classes that configure the components 
    that makeup this application --> 
<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>com.asuare.temapp</param-value> 
</context-param> 

<context-param> 
    <param-name>org.atmosphere.cpr.sessionSupport</param-name> 
    <param-value>true</param-value> 
</context-param> 

<!-- Specifies the default mode of this application, to be activated if 
    no other profile (or mode) is specified --> 
<context-param> 
    <param-name>spring.profiles.default</param-name> 
    <param-value>mysql</param-value> 
</context-param> 
<!-- Creates the Spring Container shared by all Servlets and Filters --> 
<listener> 
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
</listener> 
<!-- Secures the application --> 

securityFilter org.springframework.web.filter.DelegatingFilterProxy targetBeanName springSecurityFilterChain wahre

<filter-mapping> 
    <filter-name>securityFilter</filter-name> 
    <url-pattern>/*</url-pattern> 
    <async-supported>true</async-supported> 
</filter-mapping> 

<!-- Handles requests into the application --> 
<servlet> 

    <servlet-name>temapp</servlet-name> 
    <servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class> 
    <async-supported>true</async-supported> 
    <init-param> 
     <param-name>org.atmosphere.servlet</param-name> 
     <param-value>org.springframework.web.servlet.DispatcherServlet</param-value> 
    </init-param> 
    <!-- No explicit configuration file reference here: everything is configured 
      in the root container for simplicity --> 
    <init-param> 
     <param-name>contextClass</param-name> 
     <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext 
     </param-value> 
    </init-param> 
    <init-param> 
     <param-name>contextConfigLocation</param-name> 
     <param-value></param-value> 
    </init-param> 
    <load-on-startup>1</load-on-startup> 

</servlet> 

<servlet-mapping> 
    <servlet-name>temapp</servlet-name> 
    <url-pattern>/</url-pattern> 
    <async-supported>true</async-supported> 
</servlet-mapping> 

<filter> 
    <filter-name>sitemesh</filter-name> 
    <filter-class> 
     com.opensymphony.module.sitemesh.filter.PageFilter 
    </filter-class> 
    <async-supported>true</async-supported> 
</filter> 

<filter-mapping> 
    <filter-name>sitemesh</filter-name> 
    <url-pattern>/*</url-pattern> 
    <dispatcher>FORWARD</dispatcher> 
    <dispatcher>REQUEST</dispatcher> 
    <async-supported>true</async-supported>  
</filter-mapping> 

<error-page> 
    <error-code>403</error-code> 
    <location>/denied</location> 
</error-page> 

<error-page> 
    <error-code>401</error-code> 
    <location>/restapi/denied</location> 
</error-page> 

Serverprotokoll:

24-Jul-2016 13: 20: 57,816 INFO [localhost-Start-Stopp-1] org.apache.catalina .core.ApplicationContext.log Nein Spring WebApplicationInitializertypen, die auf dem Klassenpfad erkannt wurden 24-Jul-2016 13: 20: 58.331 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Feder root WebApplicationContext 24-Jul-2016 13: 21: 25,913 INFO [localhost-Start-Stopp-1] org.apache.catalina.core.ApplicationContext.log Initializing Feder FrameworkServlet 'sportingEasy' 24-Jul-2016 13: 21: 42,699 INFO [localhost-Start-Stopp-1] org.apache.catalina.core.ApplicationContext.log No Feder Typen WebApplicationInitializer detektiert auf classpath 24-Jul-2016 13: 22: 02.971 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Kein Spring WebApplicationInitializertypen, die auf Klassenpfad erkannt werden 24-Jul-2016 13: 22: 03.034 INFO [localhost-sta rtStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized(), 24-Jul-2016 13: 22: 03,034 INFO [localhost-Start-Stopp-1] org.apache.catalina.core. ApplicationContext.log SessionListener: contextInitialized(), 24-Jul-2016 13: 22: 48,611 INFO [localhost-Start-Stopp-1] org.apache.catalina.core.ApplicationContext.log No Feder WebApplicationInitializer Typen auf classpath detektiert

+0

Verwenden Sie Spring-Boot? –

+0

nein ohne federschuh. – Rajj

+0

Ja, ich habe versucht, saubere Installation, Build, Prozess-Klassen .. – Rajj

Antwort

1

Ich hatte auch das gleiche Problem. Mein Maven hatte Tomcat7-Plugin, aber die JRE-Umgebung war 1,6. Ich habe meinen tomcat7 zu tomcat6 gewechselt und der Fehler ist weg. Könnten Sie einmal Ihre JRE-Umgebung überprüfen und versuchen. Bitte fügen Sie auch die 'maven-war-plugin' Version 2.6 in Ihre pom.xml ein

+0

Sie wollen sagen, es funktionierte in Eclipse, aber nicht in Standalone Kater? und nach diesen Schritten begann es im Standalone-Tomcat zu arbeiten. – Rajj

+0

Problem war mit dem Tomcat Verison – Panky031