在Solaris系统下调用webservices时报如题的异常,之前程序运行一直是好的没有任何异常发生 ,只是修改了部分逻辑代码从新执行就发生了这样的悲剧。
PS:详细的错误代码贴在了文章最后
从google等搜索的资料看基本说的是由于系统本身产生随机数UUID()引起的问题,从而分析出这个异常的发生应该不是所写程序引起的,与操
作系统本身的环境参数设置有关系,正好碰到同事说这台机器最近为了其他功能的运用,重新设置过一些random链接,和之前的分析基本一致,大概肯定了这次异常是由于系统设置更改引起的。所以赶紧恢复了之前的链接设置,调用webservices,经观察没有发生问题一切正常了,下面是详细的恢复过程:
PS:好在上次链接参数更改时同事做了备份,不然就悲剧了
下面是Unix恢复设置的详细过程:
1 2 3 4 5 6 7 8 9 10 11 |
bash-2.03# ls -Fl *random lrwxrwxrwx 1 root other 22 Sep 7 17:24 random -> /usr/kernel/drv/random* lrwxrwxrwx 1 root other 22 Sep 7 17:24 urandom -> /usr/kernel/drv/random* bash-2.03# rm -f *random bash-2.03# ln -s random ../devices/pseudo/random@0:random ln: cannot create ../devices/pseudo/random@0:random: File exists bash-2.03# ln -s ../devices/pseudo/random@0:random random bash-2.03# ln -s ../devices/pseudo/random@0:urandom urandom bash-2.03# ls -Fl *random lrwxrwxrwx 1 root other 33 Sep 9 12:03 random -> ../devices/pseudo/random@0:random lrwxrwxrwx 1 root other 33 Sep 9 12:03 urandom -> ../devices/pseudo/random@0:random |
详细的错误代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
java.security.ProviderException: nextBytes() failed at sun.security.provider.NativePRNG$RandomIO.implNextBytes(NativePRNG.java:270) at sun.security.provider.NativePRNG$RandomIO.access$200(NativePRNG.java:108) at sun.security.provider.NativePRNG.engineNextBytes(NativePRNG.java:97) at java.security.SecureRandom.nextBytes(SecureRandom.java:433) at java.util.UUID.randomUUID(UUID.java:162) at com.sun.xml.internal.ws.encoding.MtomCodec.createConteTypeHeader(MtomCodec.java:102) at com.sun.xml.internal.ws.encoding.MtomCodec.<init>(MtomCodec.java:93) at com.sun.xml.internal.ws.encoding.SOAPBindingCodec.<init>(SOAPBindingCodec.java:179) at com.sun.xml.internal.ws.encoding.SOAPBindingCodec.<init>(SOAPBindingCodec.java:170) at com.sun.xml.internal.ws.api.BindingID$SOAPHTTPImpl.createEncoder(BindingID.java:415) at com.sun.xml.internal.ws.binding.BindingImpl.createCodec(BindingImpl.java:127) at com.sun.xml.internal.ws.client.WSServiceDelegate.createPipeline(WSServiceDelegate.java:435) at com.sun.xml.internal.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:628) at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:331) at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:313) at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:295) at javax.xml.ws.Service.getPort(Service.java:92) at ResDispatcherClient.ref.BusinessWebserviceImplService.getBusinessWebserviceImplPort(BusinessWebserviceImplService.java:53) at service.ResIService.callByData(ResIService.java:215) at service.ResWebService.callByData(ResWebService.java:42) at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.xml.internal.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:235) at com.sun.xml.internal.ws.server.InvokerTube$2.invoke(InvokerTube.java:135) at com.sun.xml.internal.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:246) at com.sun.xml.internal.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:82) at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587) at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546) at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531) at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428) at com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232) at com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460) at com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233) at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95) at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65) at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68) at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65) at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.io.EOFException: /dev/[u]random closed? at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:187) at sun.security.provider.NativePRNG$RandomIO.ensureBufferValid(NativePRNG.java:247) at sun.security.provider.NativePRNG$RandomIO.implNextBytes(NativePRNG.java:261) ... 44 more |
原创文章,转载请注明: 转载自micmiu – 软件开发+生活点滴[ http://www.micmiu.com/ ]
本文链接地址: http://www.micmiu.com/exception/ws-exception-nextbytes-failed/
0 条评论。