Jetty Startup问题:WebAppContext:上下文启动失败o.e.j.w.WebAppContext {/,null}

时间:2013-09-03 15:20:39

标签: eclipse spring maven jetty

我正在尝试与maven开始一场新的项目大战并进入Spring Tool Suite IDE,我从Git Hub下载了该项目,该项目是在Mac上进行的,我在windows中工作。

这是我在尝试启动Jetty服务器时得到的结果:

2013-09-03 10:01:47.161:INFO:oejs.Server:jetty-8.1.12.v20130726
2013-09-03 10:01:47.179:INFO:oejdp.ScanningAppProvider:Deployment monitor C:\Users\HP\Documents\workspace-sts-3.3.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps at interval 1
2013-09-03 10:01:47.183:INFO:oejdp.ScanningAppProvider:Deployment monitor C:\Users\HP\Documents\workspace-sts-3.3.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\contexts at interval 1
2013-09-03 10:01:47.187:INFO:oejd.DeploymentManager:Deployable added: C:\Users\HP\Documents\workspace-sts-3.3.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\contexts\moca-console.xml
2013-09-03 10:01:47.238:WARN:oejw.WebInfConfiguration:Web application not found C:\Users\HP\Documents\workspace-sts-3.3.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0/wtpwebapps/moca-console
2013-09-03 10:01:47.239:WARN:oejw.WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,null},C:\Users\HP\Documents\workspace-sts-3.3.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0/wtpwebapps/moca-console
java.io.FileNotFoundException: C:\Users\HP\Documents\workspace-sts-3.3.0.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0/wtpwebapps/moca-console
    at org.eclipse.jetty.webapp.WebInfConfiguration.unpack(WebInfConfiguration.java:502)
    at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:71)
    at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:457)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:493)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:39)
    at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:186)
    at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:494)
    at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:141)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:145)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:56)
    at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:615)
    at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:540)
    at org.eclipse.jetty.util.Scanner.scan(Scanner.java:403)
    at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:337)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:121)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:555)
    at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:230)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.util.component.AggregateLifeCycle.doStart(AggregateLifeCycle.java:81)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:96)
    at org.eclipse.jetty.server.Server.doStart(Server.java:282)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1259)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1182)
    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:601)
    at org.eclipse.jetty.start.Main.invokeMain(Main.java:473)
    at org.eclipse.jetty.start.Main.start(Main.java:615)
    at org.eclipse.jetty.start.Main.main(Main.java:96)
2013-09-03 10:01:47.277:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080

我尝试了一堆可能的解决方案而没有成功。欢迎提出任何建议。

2 个答案:

答案 0 :(得分:5)

您的eclipse STS工作区似乎与服务器中发布的内容不同步。尝试清理服务器,清理工作目录,清理所有项目并将项目重新发布到服务器中。

如果这不起作用,请尝试以下步骤重新生成eclipse工作区:

  • 关闭eclipse并从命令行执行maven clean install
  • 删除所有与eclipse相关的文件:.project,.classpath和.settings
  • 重新打开eclipse,并将maven配置为使用与命令行相同的maven
  • 使用'Import as Maven Project'
  • 导入项目
  • 废弃您的码头并重新下载干净的码头
  • 创建一个新的Jetty服务器,将其指向新的Jetty并将应用程序添加到其中
  • 重新发布应用程序并启动服务器

答案 1 :(得分:1)

是不是看起来像插件有问题。所以只需关闭STS即可。 删除工作区或插件并不是一个好主意。它可能会给其他项目带来问题。

然后按照以下步骤进行操作 -

  1. 右键单击项目资源管理器中的项目。
  2. 选择maven-> update->勾选所有启用复选框的>按确定
  3. 这将更新所有正在创建问题的插件。
  4. 最好的运气