Vert.x 3.3 server.js失败的尝试(怎么就没NodeJS好使呢?)

Server.js内容:

// server.js  
load('vertx.js');  
  
vertx.createHttpServer().requestHandler(function(req){  
    req.response.end("hello vertx!");  
}).listen(8080, 'localhost'); 


尝试运行:

D:\vertx>bin\vertx run server.js
Failed to create the vert.x instance
java.lang.IllegalStateException: failed to create a child event loop
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:88)
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:58)
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:47)
        at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:58)
        at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:75)
        at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:70)
        at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:57)
        at io.vertx.core.impl.VertxImpl.<init>(VertxImpl.java:129)
        at io.vertx.core.impl.VertxImpl.<init>(VertxImpl.java:119)
        at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:42)
        at io.vertx.core.Vertx.vertx(Vertx.java:90)
        at io.vertx.core.impl.launcher.commands.ClasspathHandler.create(ClasspathHandler.java:114)
        at io.vertx.core.impl.launcher.commands.BareCommand.startVertx(BareCommand.java:194)
        at io.vertx.core.impl.launcher.commands.BareCommand.run(BareCommand.java:132)
        at io.vertx.core.impl.launcher.commands.RunCommand.run(RunCommand.java:249)
        at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:230)
        at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:365)
        at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:328)
        at io.vertx.core.Launcher.main(Launcher.java:49)
Caused by: io.netty.channel.ChannelException: failed to open a new selector
        at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:150)
        at io.netty.channel.nio.NioEventLoop.<init>(NioEventLoop.java:141)
        at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:116)
        at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:34)
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84)
        ... 18 more
Caused by: java.io.IOException: Unable to establish loopback connection
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:101)
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:68)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:170)
        at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:50)
        at java.nio.channels.Pipe.open(Pipe.java:155)
        at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:127)
        at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:44)
        at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:148)
        ... 22 more
Caused by: java.net.ConnectException: Connection timed out: connect
        at sun.nio.ch.Net.connect0(Native Method)
        at sun.nio.ch.Net.connect(Net.java:454)
        at sun.nio.ch.Net.connect(Net.java:446)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648)
        at java.nio.channels.SocketChannel.open(SocketChannel.java:189)
        at sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(PipeImpl.java:130)
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:83)
        ... 30 more

Exception in thread "Thread-2" java.lang.NullPointerException
        at io.vertx.core.impl.launcher.commands.BareCommand$1.run(BareCommand.java:308)

难不成是防火墙在搞鬼?还是说load('vertx.js');  这一句有问题??


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值