2016-07-24 21 views
0

私はmaven、eclipseを使用しています。日食から走っているときはすべてうまいです。 しかし、同じ、私はTomcat上で展開した場合、それは誰も助けてくださいことができる場合、私は、ここでの問題を把握することはできませんよ、HTTPステータス404 ログがクラスパス上で検出なし春WebApplicationInitializerの種類を言いますが、私はweb.xmlのSpringアプリケーションはEclipseで動作しますが、Tomcat 8にデプロイすると動作しません。

を使用しています返します。 フィルタとサーブレットのマッピングに問題はありません。

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 真

<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> 

サーバ・ログ:

24 07月2016 13:20:57.816 INFO [ローカルホスト-startStop-1] org.apache.catalina .core.ApplicationContext.logいいえSpring クラスパス上でWebApplicationInitializerタイプが検出されました2012年7月24日 13:20:58.331 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Springの初期化 ルートWebApplicationContext 24-Jul-2016 13:21:25.913 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Springの初期化 FrameworkServlet 'sportingEasy' 24 07月2016 13:21:42.699 INFO [ローカルホスト-startStop-1]クラスパス24 07月2016 で検出org.apache.catalina.core.ApplicationContext.logなしスプリング WebApplicationInitializerタイプ13:22:02.971 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.logいいえSpring クラスパス上でWebApplicationInitializerタイプが検出されました2012年7月24日 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-startStop-1] org.apache.catalina.core。 ApplicationContext.log SessionListener: contextInitialized()24 07月2016 13:22:48.611 INFO [ローカルホスト-startStop-1]クラスパス

で検出org.apache.catalina.core.ApplicationContext.logなしスプリング WebApplicationInitializerタイプ
+0

スプリングブートを使用していますか? –

+0

スプリングブーツを使用していません。 – Rajj

+0

はい私はクリーンインストール、ビルド、プロセスクラスを試しました.. – Rajj

答えて

1

私も同じ問題がありました。私のmavenはtomcat7プラグインを持っていましたが、JRE環境は1.6でした。私はtomcat7をtomcat6に変更しました。エラーはなくなりました。あなたのJRE環境を一度チェックしてみてください。 また、pom.xmlに 'maven-war-plugin'バージョン2.6を追加してください。

+0

あなたはEclipseで動作していたが、スタンドアロンのTomcatでは動作していないと言っているのですか?これらのステップの後、スタンドアローンのTomcatで作業を開始しました。 – Rajj

+0

問題はtomcat verisonで発生しました – Panky031

関連する問題