Websphere路由到文件位置而不是Controller

时间:2016-03-03 20:36:30

标签: java spring websphere websphere-liberty

我有一个POST方法,看起来像这样:

[ERROR   ] SRVE0777E: Exception thrown by application class 'com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.service:1,624'
javax.servlet.ServletException: java.io.FileNotFoundException: SRVE0190E: File not found: /v2/mobile/message
    at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.service(DefaultExtensionProcessor.java:1624)
    at [internal classes]
    at org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler.handleRequest(DefaultServletHttpRequestHandler.java:122)
    at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:51)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1287)
    at [internal classes]
Caused by: java.io.FileNotFoundException: SRVE0190E: File not found: /v2/mobile/message
    at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:528)
    ... 12 more

并提供JSON有效负载。但是,不是按预期路由到正确的控制器,而是搜索文件并抛出给定的异常:

@RequestMapping(value="/v2/mobile/message",method=RequestMethod.POST)
    public ResponseEntity<String> mobileDeviceMessagev2(HttpServletRequest request) throws Exception {
        ...code here....
}

    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <context-param>
        <param-name>inauth.perapp.log4j.properties</param-name>
        <param-value>${log4j.properties.collector.path}</param-value>
    </context-param>

<context-param>
    <param-name>contextClass</param-name>
    <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
</context-param>

<context-param>
<param-name>contextConfigLocation</param-name>
    <param-value></param-value>
</context-param>

<context-param>
    <param-name>contextInitializerClasses</param-name>
    <param-value>com.inauth.fingerprint.collector.CollectorInitializer</param-value>
</context-param>

<servlet>
    <servlet-name>collector</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <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>com.inauth.fingerprint.collector.DispatcherConfig</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>collector</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>
<error-page>
    <error-code>404</error-code>
    <location>/WEB-INF/static/404.html</location>
</error-page>
<error-page>
    <error-code>500</error-code>
    <location>/WEB-INF/static/500.html</location>
</error-page>

我对Websphere很陌生,所以对此有任何帮助都会非常感激。此外,为了它的价值,我之前已经让它在Tomcat上正常工作,这使我相信它必须是Websphere的配置问题。

该应用程序位于servers / demoServer / dropins / war / demoapp

我在该位置提取了war文件的内容。

更新 HERE是请求的方法shell和web.xml:

onclick="Qdialog.open()"

0 个答案:

没有答案