當我嘗試從命令行碼頭啓動它的失敗:錯誤無法訪問jarfile start.jar。我已經添加到$ path環境變量jetty bun沒有發生任何事情的路徑。 之前,我想我跑碼頭上的應用程序,但在的IntelliJ的輸出控制檯與此相撞:從命令行不能啓動碼頭
"C:\Program Files\Java\jdk1.7.0_25\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:16231,suspend=y,server=n -DSTOP.PORT=0 -Dcom.sun.management.jmxremote= -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -DOPTIONS=jmx -Dfile.encoding=windows-1251 -classpath "start.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.0\lib\idea_rt.jar" org.eclipse.jetty.start.Main etc/jetty-jmx.xml C:\Users\Grigoriy\AppData\Local\Temp\context4870587588634592162config\jetty-contexts.xml
[2013-11-25 03:17:23,756] Artifact sandbox:war exploded: Server is not connected. Press 'Deploy' to start deployment.
Connected to the target VM, address: '127.0.0.1:16231', transport: 'socket'
2013-11-25 03:17:25.237:WARN:oejx.XmlConfiguration:main: Config error at <Call name="addBean"><Arg>| <New class="org.eclipse.jetty.monitor.ThreadMonitor"><Set name="scanInterval">2000</Set><Set name="busyThreshold">90</Set><Set name="stackDepth">3</Set><Set name="trailLength">2</Set></New>| </Arg></Call> java.lang.ClassNotFoundException: org.eclipse.jetty.monitor.ThreadMonitor in file:/D:/servers/jetty907/jetty-distribution-9.0.7.v20131107/etc/jetty-monitor.xml
java.lang.reflect.InvocationTargetException
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.eclipse.jetty.start.Main.invokeMain(Main.java:509)
at org.eclipse.jetty.start.Main.start(Main.java:651)
at org.eclipse.jetty.start.Main.main(Main.java:99)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.monitor.ThreadMonitor
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.jetty.util.Loader.loadClass(Loader.java:100)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.nodeClass(XmlConfiguration.java:364)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:754)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1125)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:1030)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.call(XmlConfiguration.java:721)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:417)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:354)
at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:262)
at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1238)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1174)
... 7 more
Usage: java -jar start.jar [options] [properties] [configs]
java -jar start.jar --help # for more information
Disconnected from the target VM, address: '127.0.0.1:16231', transport: 'socket'
Disconnected from server
Process finished with exit code -2
更新。 這是我的碼頭,deploy.xml`
<Call id="webappprovider" name="addAppProvider">
<Arg>
<New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
<Set name="monitoredDirName"><Property name="jetty.home" default="." />/webapps</Set>
<Set name="defaultsDescriptor"><Property name="jetty.home" default="." />/etc/webdefault.xml</Set>
<Set name="scanInterval">1</Set>
<Set name="extractWars">true</Set>
<Set name="configurationManager">
<New class="org.eclipse.jetty.deploy.PropertiesConfigurationManager">
</New>
</Set>
</New>
</Arg>
</Call>`
所以,我不明白在什麼時間以及爲什麼ContextProvider更換WebAppProvider。
我決定排除從碼頭碼頭監視器intellij中的配置。現在,當我啓動我的應用程序時,它會在類ContextProvider的jetty-contexts.xml中拋出ClassNotFoundException異常。當我嘗試在具有相同服務器的另一臺計算機上啓動我的應用程序時,它成功完成並在碼頭環境中完成。XML我發現WebAppProvider而不是ContextProvider。 –
當我嘗試在命令行中驗證碼頭版本時,我看到「D:\ servers \ jetty907 \ jetty-distribution-9.0.7.v20131107未被識別爲內部或外部命令,可操作程序或批處理文件」 –
'java -jar start.jar --version'命令必須從'cmd'(命令行)運行,並且你必須首先轉換到你的分發目錄才能工作。 –