http://yulimin.javaeye.com/blog/27418
Eclipse Jetty JettyLauncher java.net.SocketException: Unrecognized Windows Sockets error: 10106: create
刚开始还好好的,突然间出然这个错误,于启动不了了。
XP SP2、Eclipse 3.1.2、Jetty-5.1.11RC0、JettyLauncher 1.3.0
XP SP2、Eclipse 3.2.0、Jetty-5.1.11RC0、JettyLauncher 1.4.1
都不行。
谷歌与摆渡后,看到应当与此无关,而是与网络协议有关的问题,但是没有看到方便的解决办法,怪事,难道真的得重装系统?
launching Jetty webapp: /xxx on address: 127.0.0.1:8088 using dir: [F:/JavaProject/xxx]
10:27:28.640 INFO [main] org.mortbay.log.LogImpl.add(LogImpl.java:109) >16> added org.mortbay.log.OutputStreamLogSink@120a47e
10:27:28.625 INFO [main] org.mortbay.log.LogImpl.reset(LogImpl.java:228) >11> reset
10:27:28.640 INFO [main] org.mortbay.log.LogImpl.add(LogImpl.java:109) >11> added org.mortbay.log.OutputStreamLogSink@789144
org.mortbay.util.MultiException[java.net.SocketException: Unrecognized Windows Sockets error: 10106: create]
at org.mortbay.http.HttpServer.doStart(HttpServer.java:686)
at org.mortbay.util.Container.start(Container.java:72)
at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
java.net.SocketException: Unrecognized Windows Sockets error: 10106: create
at java.net.ServerSocket.createImpl(ServerSocket.java:254)
at java.net.ServerSocket.getImpl(ServerSocket.java:205)
at java.net.ServerSocket.bind(ServerSocket.java:318)
at java.net.ServerSocket.(ServerSocket.java:185)
at org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer.java:391)
at org.mortbay.util.ThreadedServer.open(ThreadedServer.java:477)
at org.mortbay.util.ThreadedServer.start(ThreadedServer.java:503)
at org.mortbay.http.SocketListener.start(SocketListener.java:204)
at org.mortbay.http.HttpServer.doStart(HttpServer.java:716)
at org.mortbay.util.Container.start(Container.java:72)
at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
java.net.SocketException: Unrecognized Windows Sockets error: 10106: create
at java.net.ServerSocket.createImpl(ServerSocket.java:254)
at java.net.ServerSocket.getImpl(ServerSocket.java:205)
at java.net.ServerSocket.bind(ServerSocket.java:318)
at java.net.ServerSocket.(ServerSocket.java:185)
at org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer.java:391)
at org.mortbay.util.ThreadedServer.open(ThreadedServer.java:477)
at org.mortbay.util.ThreadedServer.start(ThreadedServer.java:503)
at org.mortbay.http.SocketListener.start(SocketListener.java:204)
at org.mortbay.http.HttpServer.doStart(HttpServer.java:716)
at org.mortbay.util.Container.start(Container.java:72)
at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
问题解决:
Run ==> Run ... ==> Jetty Web ==> Environment
由于我在这里新增加了一个变量,下面默认是
Append environment to native environment,选择这个就可以正常启动的
但是我选择下面的
Replace native environment with specified environment,于是,启动就报错。改选上面的就OK了。
其它问题及技巧:
1、如果JSP出现无法编译:Unable to find a javac compiler时,记得把JDK里的tools.jar加进JRE里去。
即:%JAVA_HOME%/jre/lib/ext/目录下去即可;
2、Jetty、JettyLauncher的配置与使用看自带的文档;
3、网上一些技术文章:
Jetty的配置
http://forum.javaeye.com/viewtopic.php?t=1630
在 Jetty 中用 jikes 替代 tools.jar 来编译 JSP 文件
http://forum.javaeye.com/viewtopic.php?t=12907
Java的一些开发工具
http://forum.javaeye.com/viewtopic.php?t=18624