在 Jspresso 10 分钟教程顺利之后,我开始尝试 5 分钟教程,但无法让它工作。将 webapp 部署到 tomcat6/tomcat7 时,我总是遇到以下异常。
**** MessageBrokerServlet in application 'Example Application' failed to initialize due to runtime exception: Exception: flex.messaging.config.ConfigurationException: Please specify a valid 'services.configuration.file' in web.xml. You specified '/WEB-INF/flex/services-config.xml'. This is not a valid file system path reachable via the app server and is also not a path to a resource in your J2EE application archive.
at flex.messaging.config.ServletResourceResolver.isAvailable(ServletResourceResolver.java:54)
at flex.messaging.config.FlexConfigurationManager.setupConfigurationPathAndResolver(FlexConfigurationManager.java:202)
at flex.messaging.config.FlexConfigurationManager.getMessagingConfiguration(FlexConfigurationManager.java:78)
at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:109)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
我的设置:Win7、jdk1.7.0_55、Eclipse Luna Service Release 2 (4.4.2)、来自 www.jspresso.org/external/updates/e44/ 的 Jspresso Developer Studio
我是 Jspresso 的新手,不幸的是不太习惯 Maven。对我有什么提示吗?
更新: 文森特的回答是正确的,并解决了部署问题,但现在当我打开 localhost:8080/helloworld-webapp/flex/index.html 和尝试 localhost:8080/helloworld-webapp/html5/ 时出现一个空白页面index.html 我得到一个 404。@Vincent:对这个问题也有什么想法吗?
UPDATE2: 我在控制台上做了一个 mvn 包(在 eclipse 中我没有成功),不知何故我不得不用 mvn jetty:run-exploded 启动应用程序一次。之后从 eclipse 内部部署到 tomcat6 是成功的,现在它正在工作。