jetty 无法编译java,Jetty Web Server无法启动“java.io.IOException:无法读取文件:..”...

015-04-08 12:56:30 Commons Daemon procrun stderr initialized

java.io.IOException: Cannot read file: C:\Streem\web\modules\annotations.mod

at org.eclipse.jetty.start.Modules.registerModule(Modules.java:549)

at org.eclipse.jetty.start.Modules.registerAll(Modules.java:486)

at org.eclipse.jetty.start.Main.processCommandLine(Main.java:608)

at org.eclipse.jetty.start.Main.main(Main.java:111)

I checked that installed Java version 1.7.0_25 and npn-1.7.0_25.mod do exist under web\modules\protonego-impl\

I am using jetty-9.2.5.v20141112 on windows 2008 R2 server

Does annotations.mod need something special regarding this case?

解决方案

We found the same problem on Windows Server 2008. It happens when Jetty is trying to read the module configuration files and is due to a fault in the check for readability.

In the jetty source file FS.java line 39 a check is made using java.nio, to see if the file is readable:

public static boolean canReadFile(Path path)

{

return Files.exists(path) && Files.isRegularFile(path) && Files.isReadable(path);

}

The file itself is in fact readable and can be successfully read from Java, but the isReadable incorrectly returns false.

There are two possible workarounds:

Upgrade to Java 8

Remove the check for isReadable from the Jetty source (in any case if the file wasn't readable the reading will fail with an exception).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值