1.使用idea啟動jetty,jetty使用的本地的jetty,使用jetty預設8080端口,啟動沒問題。但業務需要80端口,所以修改了jetty的配置start.ini中的port為80.
2.再次啟動,怎麼也啟動不了,報錯信息如下:
"C:\Program Files\Java\jdk1.7.0_79\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60958,suspend=y,server=n -DSTOP.PORT=0 -Dcom.sun.management.jmxremote= -Dcom.sun.management.jmxremote.port=80 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -DOPTIONS=jmx -Dfile.encoding=GBK -classpath "D:\业务-五一联运\jetty-distribution-9.2.10.v20150310\jetty-distribution-9.2.10.v20150310\start.jar;C:\Program Files\Java\jdk1.7.0_79\lib\tools.jar;D:\IntelliJ IDEA 15.0.2\lib\idea_rt.jar" org.eclipse.jetty.start.Main --module=jmx C:\Users\yanrunni\AppData\Local\Temp\context8config\jetty-contexts.xml
[2017-04-05 07:40:37,658] Artifact aries-manage:war: Server is not connected. Deploy is not available.
Detected server http port: 80
Connected to the target VM, address: '127.0.0.1:60958', transport: 'socket'
2017-04-05 19:40:38.250:INFO::main: Logging initialized @471ms
2017-04-05 19:40:38.291:WARN:oejs.HomeBaseWarning:main: This instance of Jetty is not running from a separate {jetty.base} directory, this is not recommended. See documentation at http://www.eclipse.org/jetty/documentation/current/startup.html
2017-04-05 19:40:38.421:INFO:oejs.Server:main: jetty-9.2.10.v20150310
STOP.PORT=60970
STOP.KEY=1jlckpm3t5eyo
2017-04-05 19:40:38.442:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/D:/%E4%B8%9A%E5%8A%A1/17-%E4%BA%94%E4%B8%80%E8%81%94%E8%BF%90/jetty-distribution-9.2.10.v20150310/jetty-distribution-9.2.10.v20150310/webapps/] at interval 1
2017-04-05 19:40:38.445:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/C:/Users/yanrunni/AppData/Local/Temp/context8deploy/] at interval 1
2017-04-05 19:40:38.447:WARN:oejuc.AbstractLifeCycle:main: FAILED ServerConnector@7f156f46{HTTP/1.1}{0.0.0.0:80}: java.net.BindException: Address already in use: bind
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:321)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:366)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.xml.XmlConfiguration.run(XmlConfiguration.java:1255)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1174)
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:321)
at org.eclipse.jetty.start.Main.start(Main.java:817)
at org.eclipse.jetty.start.Main.main(Main.java:112)
2017-04-05 19:40:38.447:WARN:oejuc.AbstractLifeCycle:main: FAILED org.eclipse.jetty.server.Server@5efefc32: java.net.BindException: Address already in use: bind
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:321)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:366)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.xml.XmlConfiguration.run(XmlConfiguration.java:1255)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1174)
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:321)
at org.eclipse.jetty.start.Main.start(Main.java:817)
at org.eclipse.jetty.start.Main.main(Main.java:112)
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:321)
at org.eclipse.jetty.start.Main.start(Main.java:817)
at org.eclipse.jetty.start.Main.main(Main.java:112)
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:321)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:366)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.xml.XmlConfiguration.run(XmlConfiguration.java:1255)
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:60958', transport: 'socket'
Disconnected from server
Process finished with exit code -2
3.重啟電腦,還是啟動不了,不知道電腦為什麼這個80端口使用idea啟動不了
4.但是問題是,換eclipse,端口還是80,啟動卻成功,eclipse的附贈的jetty。但是,在別的電腦上,idea是可以啟動的(80埠)。也就是說,只有這台電腦的80埠老是被佔用,而且找不到解決方法!
5.實在不知道為什麼···············