我尝试了将战争嵌入码头的this example。
当我在eclipse上调试时,一切正常,并且Web服务在端口8080上正常部署,但是当我使用此程序制作jar并将其放入服务器时(我尝试了tomcat 5.5和码头7.4.1)该程序在我启动码头服务器时出现以下异常:
7641 [qtp21021313-35] ERROR configuration.EngineConfigurationFactoryServlet - Unable to find config file. Creating new servlet engine config file: /WEB-INF/server-config.wsdd
7641 [qtp21021313-35] WARN configuration.EngineConfigurationFactoryServlet - Unable to load/create servlet engine config file, attempting internal default (from jar).
仅部署默认的Web服务方法(AdminService和版本)
wsdd很好。如果我将这场战争部署到服务器上,则可以完美运行
最佳答案
您应该在没有servlet容器(Tomcat / Jetty)的情况下运行Java代码,并且已嵌入码头服务器,这就是为什么在Eclipse中代码可以正常工作的原因。
码头的口号:
“不要在Jetty中部署您的应用程序,请在您的应用程序中部署Jetty。”
您应该检查本教程:
http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty
有关更多信息:
http://wiki.eclipse.org/Jetty/Howto/Deploy_Web_Applications