spring 3.2 + jetty 8.1.2 - 未调用控制器/路由

时间:2015-01-16 07:02:10

标签: spring-mvc jetty runjettyrun

目前,应用程序在Tomcat 7上正常运行。

然而,当我尝试使用run-jetty-run eclipse集成在jetty上启动时,我面临以下问题。

应用程序启动正常,数据源,webappcontext,控制器都初始化正常。

2015-01-16 12:01:49.220:INFO:oejs.Server:jetty-8.1.2.v20120308
2015-01-16 12:02:21.622:INFO:oejsh.ContextHandler:started o.e.j.w.WebAppContext{/my-spring-services,[file:/home/jaya/Projws/app1/my-spring-services/src/main/webapp/]}
2015-01-16 12:02:22.094:INFO:/my-spring-services:Spring WebApplicationInitializers detected on classpath: [com.jaya.ex1.config.WebAppInitializer@647a64e]
2015-01-16 12:02:22.248:INFO:/my-spring-services:Initializing Spring FrameworkServlet 'dispatcher'
2015-01-16 12:02:29.121:INFO:oejsh.ContextHandler:started o.e.j.w.WebAppContext{/my-spring-services,[file:/home/jaya/Projws/app1/my-spring-services/src/main/webapp/]}
2015-01-16 12:02:29.121:INFO:oejsh.ContextHandler:started o.e.j.w.WebAppContext{/my-spring-services,[file:/home/jaya/Projws/app1/my-spring-services/src/main/webapp/]}
2015-01-16 12:02:29.121:INFO:oejsh.ContextHandler:started o.e.j.w.WebAppContext{/my-spring-services,[file:/home/jaya/Projws/app1/my-spring-services/src/main/webapp/]}
2015-01-16 12:02:29.121:INFO:/my-spring-services:Initializing Spring root WebApplicationContext
2015-01-16 12:02:30.455:INFO:oejsh.ContextHandler:started o.e.j.w.WebAppContext{/my-spring-services,[file:/home/jaya/Projws/app1/my-spring-services/src/main/webapp/]}
2015-01-16 12:02:30.464:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:18080

我也在日志中收到有关此内容的消息,与Tomcat 7相同:

2015-01-16 12:02:28 [INFO] (AbstractHandlerMethodMapping.java:registerHandlerMethod:179) Mapped "{[/api/inposts],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto ...

我正在使用openjdk7。 Jetty-run config:[context=/my-spring-services, webappdir=src/main/webapp]

然而,服务器正在运行,因为我可以src/main/webapp/index.html使用GET http://localhost:18080/my-spring-services

通过这种方式,我希望POST http://localhost:18080/my-spring-services/api/inposts能够发挥作用。

但是,当我调用这个API时,我得到标准的404 - 找不到(这在Tomcat 7中再次有用)。

不确定我是否正确调用 run-jetty-run 。 非常感谢任何帮助。感谢.JB

0 个答案:

没有答案