麻烦大神帮忙看下 java.net.SocketException: Connection reset 不是经常出现间歇性出现

错误代码
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
at com.example.madame.service.JokeService.jokeGet(JokeService.java:86)
at com.example.madame.controller.OneSentencePerDayController.test35(OneSentencePerDayController.java:105)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

我的代码
public String joke() {
    try {
        //  String urlTypeName = java.net.URLEncoder.encode(city1, "utf-8");
        URL url = new URL("xxx");
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setConnectTimeout(5000);
        conn.setRequestMethod("GET");
        if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { //结果码=200
            InputStream is = conn.getInputStream();
            //内存流 ,
            ByteArrayOutputStream boas = new ByteArrayOutputStream();
            byte[] buffer = new byte[1024];
            int len = -1;
            while (is.available() != 0&&(len = is.read(buffer)) != -1) {
                boas.write(buffer, 0, len);
            }
            System.out.println("GET请求获取的数据:" + boas.toString());
            JSONObject jsonObject = JSONObject.fromObject(boas.toString());
            String reason = String.valueOf(jsonObject.get("reason"));
            if ("success".equals(reason)) {
                Object result = jsonObject.get("result");
                JSONArray jsonArray = JSONArray.fromObject(result.toString());
                int count = 0;
                String joke = "";

                if (jsonArray.size() > 0) {
                    for (int i = 0; i < jsonArray.size(); i++) {
                        String content = String.valueOf(JSONObject.fromObject(jsonArray.get(i)).get("content"));
                        count += 1;
                        joke += " <tr align=\"center\" style=\"text-indent:2em;\">\n" +
                                "            <td >" + count + "." + content + "</td>\n" +
                                "        </tr>";

                        if (count == 3) {
                            break;
                        }
                    }

                    boas.close();
                    is.close();
                    return joke;
                }


            }

        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    return null;
}

1个回答

很明显是网络的问题,如果时好时坏,那么考虑把timeout调整大一些

Telunsu01
试过调大也不行的 调到过 30000
6 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Jmeter做压力测试,报错:java.net.BindException: Address already in use: connect

Jmeter做压力测试,报错:java.net.BindException: Address already in use: connect 先是各种搜,修改了注册表的MaxUserPort,修改之后,请求次数可以达到63000左右了,但是依然还是有限制。 有没有什么办法可以突破这个限制,可以不限制这个请求数。 求各位大神指教

java网络编程错误java.net.ConnectException: Connection refused: connect求教

刚开始学习java网络编程,在书上看到一段代码,就动手试一下,结果出现下面错误: java.net.ConnectException: Connection refused: connect 源代码如下: import java.io.*; import java.net.*; class lx01 { public static void main(String[] args) { String host = "localhost"; BufferedReader br = null; PrintWriter pw = null; Socket s = null; try { s = new Socket(host, 10000); InputStreamReader isr; isr = new InputStreamReader(s.getInputStream()); br = new BufferedReader(isr); pw = new PrintWriter(s.getOutputStream(), true); pw.println("DATE"); System.out.println(br.readLine()); pw.println("PAUSE"); pw.println("DOW"); System.out.println(br.readLine()); pw.println("DOM"); System.out.println(br.readLine()); pw.println("DOY"); System.out.println(br.readLine()); } catch (IOException e) { System.out.println(e.toString()); } finally { try { if (br != null) br.close(); if (pw != null) pw.close(); if (s != null) s.close(); } catch (IOException e) { } } } } 求教各位大神这是啥原因,如何解决?

java.net.SocketTimeoutException: Read timed out

1、每次在进行批作业的时候,会构建http的请求 ``` * 定时发送监控信息到质检端 * * @return */ @Scheduled(fixedRate = 60000*5) public String sendMonitorInfo() throws IOException { List<Map> info = monitorService.getMonitorInfo(); logger.debug("monitor info{}",info); String result = HttpUtil.doPost(sendURL,JSONArray.toJSONString(info),10000,10000); logger.debug("send monitor result{}",result); return result; } ``` 2、在请求构建完成之后,会发送请求 ``` //发送请求 HttpResponse response = httpClient.execute(post); HttpEntity entityReaponse = response.getEntity(); if (entityReaponse != null) { inputStream = entityReaponse.getContent(); //转换为字节输入流 BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, Consts.UTF_8)); while ((body = br.readLine()) != null) { result.append(body); } } } catch (Throwable e) { e.printStackTrace(); logger.error("http post error:",e); return null; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { e.printStackTrace(); return null; } } } ``` 这个错应该是在 while ((body = br.readLine()) != null)方法中的,但是不知道为什么 debug的时候就显示read time out 求大神帮忙解答一下

java代码运行出现错误“Address already in use: Cannot bind”

这是数据接受端代码: import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.SocketException; public class ReceiveUDP { public static void main(String[] args) throws IOException { //定义Socket,并开放一个端口,用来接受数据 int port=10000; DatagramSocket ds = new DatagramSocket(port); //定义一个数据缓冲池,用来存放接收到的数据 byte bytes[] = new byte[1024]; DatagramPacket dp = new DatagramPacket(bytes,bytes.length); //用Receive方法将接收的内容放入数据缓冲池 ds.receive(dp); System.out.println(dp.getPort()+":"); System.out.println(new String(dp.getData())); ds.close(); } } 这是发送数据端代码: import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketException; import java.net.UnknownHostException; public class UDPSend { public static void main(String[] args) throws IOException { DatagramSocket ds = new DatagramSocket(10000,InetAddress.getByName("127.0.0.1")); byte bytes[] = "hello,UDP".getBytes(); DatagramPacket dp = new DatagramPacket(bytes,bytes.length); //发送数据 ds.send(dp); System.out.println("sent!"); ds.close(); } } 运行后出现问题: Exception in thread "main" java.net.BindException: Address already in use: Cannot bind at java.net.DualStackPlainDatagramSocketImpl.socketBind(Native Method) at java.net.DualStackPlainDatagramSocketImpl.bind0(Unknown Source) at java.net.AbstractPlainDatagramSocketImpl.bind(Unknown Source) at java.net.DatagramSocket.bind(Unknown Source) at java.net.DatagramSocket.<init>(Unknown Source) at java.net.DatagramSocket.<init>(Unknown Source) at UDPSend.main(UDPSend.java:11) 请各位大神帮忙看看是什么问题,怎么解决?

Software caused connection abort: recv failed

vm搭建了CentOS nginx vsftpd 目前使用ftp客户端可以实现文件传递,但使用java代码junit测试却报错,百思不得其解,求助大神 报错提示: java.net.SocketException: Software caused connection abort: recv failed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:150) at java.net.SocketInputStream.read(SocketInputStream.java:121) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177) at java.io.InputStreamReader.read(InputStreamReader.java:184) at java.io.BufferedReader.fill(BufferedReader.java:154) at java.io.BufferedReader.read(BufferedReader.java:175) at org.apache.commons.net.io.CRLFLineReader.readLine(CRLFLineReader.java:58) at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:314) at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:294) at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:483) at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:608) at org.apache.commons.net.ftp.FTP.port(FTP.java:932) at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:812) at org.apache.commons.net.ftp.FTPClient._storeFile(FTPClient.java:633) at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:624) at org.apache.commons.net.ftp.FTPClient.storeFile(FTPClient.java:1976) at com.taotao.controller.FTPTest.testFtpClient(FTPTest.java:32) 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:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) 测试类 @Test public void testFtpClient() throws Exception { //创建一个FtpClient对象 FTPClient ftpClient = new FTPClient(); //创建ftp连接。默认是21端口 ftpClient.connect("192.168.44.129", 21); //登录ftp服务器,使用用户名和密码 ftpClient.login("ftpuser", "ftpuser"); //上传文件。 //读取本地文件 FileInputStream inputStream = new FileInputStream(new File("E:\\BaiduDownload\\11.jpg")); //设置上传的路径 ftpClient.changeWorkingDirectory("/home/ftpuser/www/images"); //修改上传文件的格式 ftpClient.setFileType(FTP.BINARY_FILE_TYPE); //第一个参数:服务器端文档名 //第二个参数:上传文档的inputStream ftpClient.storeFile("11.jpg",inputStream); //关闭连接 inputStream.close(); ftpClient.logout();

Okhttp3 post请求报错,有大神知道解决办法吗?

![图片说明](https://img-ask.csdn.net/upload/202003/12/1583987817_691210.png) 有时候执行到红框部分便抛出以下异常 ``` java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:210) at java.net.SocketInputStream.read(SocketInputStream.java:141) at sun.security.ssl.InputRecord.readFully(InputRecord.java:465) at sun.security.ssl.InputRecord.read(InputRecord.java:503) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975) at sun.security.ssl.SSLSocketImpl.waitForClose(SSLSocketImpl.java:1761) ``` 但是有时候又可以正常运行,我一直觉得是网络不好才会报错,但不知还有没有其它原因???

jsch连接sftp问题 Session.connect: java.security.

公司使用的IBM的jdk,使用jsch做一个sftp连接上传下载文件的工具,当使用jsch 0.1.51版本时 连接报错Algorithm negotiation fail, 然后升级版本到0.1.54 连接报错 Session.connect: java.security.InvalidAlgorithmParameterException: Prime size must be multiple of 64, and can only range from 512 to 1024 (inclusive) 求大神教育

急急急。。Android 用wifi,3G网络访问报不同错

代码: public luntan_ResultComment selectFriend(){ luntan_ResultComment se_friend=new luntan_ResultComment(); final String url="http://169.254.10.92:8080/wancaiweb/SelectFriend"; try { urlConnection=new URL(url).openConnection(); urlConnection.setRequestProperty("connection","close"); inputStream = urlConnection.getInputStream(); String result=readStream(inputStream); try { JSONObject jsonObject=new JSONObject(result); se_friend.setTotal(jsonObject.getInt("total")); se_friend.setJsonArray(jsonObject.getJSONArray("comment")); } catch (JSONException e) { e.printStackTrace(); } } catch (IOException e) { e.printStackTrace(); } return se_friend; } 我的数据库是SQL2008,服务器是MyEclipse+Tomcat 我之间在学校是可以正常访问的,但是到家里就不能访问了 wifi访问报错: 07-20 20:59:42.410 14500-14657/java.net.SocketTimeoutException: failed to connect to /169.254.10.92 (port 8080) after 90000ms 07-20 20:59:42.410 14500-14657/com.example.wancai.Activity W/System.err: at libcore.io.IoBridge.connectErrno(IoBridge.java:176) 07-20 20:59:42.411 14500-14657/com.example.wancai.Activity W/System.err: at libcore.io.IoBridge.connect(IoBridge.java:112) 07-20 20:59:42.411 14500-14657/com.example.wancai.Activity W/System.err: at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192) 07-20 20:59:42.411 14500-14657/com.example.wancai.Activity W/System.err: at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459) 07-20 20:59:42.412 14500-14657/com.example.wancai.Activity W/System.err: at java.net.Socket.connect(Socket.java:857) 07-20 20:59:42.412 14500-14657/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpConnection.<init>(HttpConnection.java:76) 07-20 20:59:42.412 14500-14657/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50) 07-20 20:59:42.412 14500-14657/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340) 07-20 20:59:42.413 14500-14657/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87) 07-20 20:59:42.413 14500-14657/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpConnection.connect(HttpConnection.java:128) 07-20 20:59:42.413 14500-14657/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:316) 07-20 20:59:42.413 14500-14657/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpEngine.connect(HttpEngine.java:311) 07-20 20:59:42.414 14500-14657/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:290) 07-20 20:59:42.414 14500-14657/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:240) 07-20 20:59:42.414 14500-14657/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:292) 07-20 20:59:42.414 14500-14657/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpURLConnec 3G访问报错: java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer) 07-20 20:57:12.475 10200-13347/com.example.wancai.Activity W/System.err: at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:598) 07-20 20:57:12.475 10200-13347/com.example.wancai.Activity W/System.err: at libcore.io.IoBridge.recvfrom(IoBridge.java:560) 07-20 20:57:12.479 10200-13347/com.example.wancai.Activity W/System.err: at java.net.PlainSocketImpl.read(PlainSocketImpl.java:490) 07-20 20:57:12.480 10200-13347/com.example.wancai.Activity W/System.err: at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46) 07-20 20:57:12.482 10200-13347/com.example.wancai.Activity W/System.err: at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240) 07-20 20:57:12.482 10200-13347/com.example.wancai.Activity W/System.err: at java.io.InputStream.read(InputStream.java:163) 07-20 20:57:12.483 10200-13347/com.example.wancai.Activity W/System.err: at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142) 07-20 20:57:12.490 10200-13347/com.example.wancai.Activity W/System.err: at java.io.BufferedInputStream.read(BufferedInputStream.java:227) 07-20 20:57:12.491 10200-13347/com.example.wancai.Activity W/System.err: at libcore.io.Streams.readAsciiLine(Streams.java:201) 07-20 20:57:12.500 10200-13347/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:573) 07-20 20:57:12.501 10200-13347/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:821) 07-20 20:57:12.502 10200-13347/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:293) 07-20 20:57:12.502 10200-13347/com.example.wancai.Activity W/System.err: at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:185) 07-20 20:57:12.502 10200-13347/com.example.wancai.Activity W/System.err: at com.example.wancai.InternetData.Friend_Data.selectFriend(Friend_Data.java:39) 07-20 20:57:12.502 10200-13347/com.example.wancai.Activity W/System.err: at com.example.wancai.Discover.VerifyFriendNoti.getServerMessage(VerifyFriendNoti.java:165) 07-20 20:57:12.503 10200-13347/com.example.wancai.Activity W/System.err: at com.example.wancai.Discover.VerifyFriendNoti$MessageThrad.run(VerifyFriendNoti.java:107) 07-20 20:57:12.503 10200-13347/com.example.wancai.Activity W/System.err: Caused by: libcore.io.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer) 07-20 20:57:12.504 10200-13347/com.example.wancai.Activity W/System.err: at libcore.io.Posix.recvfromBytes(Native 不知道为什么会报这种错,大神帮帮我

socket编程发送消息出现socket closed求大神,急

import java.io.DataInputStream; import java.io.EOFException; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; public class Server { ServerSocket ss; Socket s ; Clients clients; DataInputStream dis; boolean startServer = false; public void startServer(){ try { ss = new ServerSocket(8888);//8888是TCP端口号 startServer = true; while(startServer){ s = ss.accept(); System.out.println(" connected!"); clients = new Clients(s); new Thread(clients).start(); } }catch(IOException e){ e.printStackTrace(); }finally{ try { ss.close(); } catch (IOException e) { e.printStackTrace(); } } } public static void main(String[] args) { new Server().startServer(); } } class Clients implements Runnable{//包装类,把外部连接的client包装 private Socket s; private boolean isConnected = false ; private DataInputStream dis; public Clients(Socket s) { this.s = s; try { isConnected = true; dis = new DataInputStream(s.getInputStream()); } catch (IOException e) { e.printStackTrace(); } } @Override public void run() { while(isConnected){ try { String str = dis.readUTF();//阻塞:它会一直等待 System.out.println(str); } catch (EOFException e){ System.out.println("Client is closed!"); }catch (IOException e1) { e1.printStackTrace(); }finally{ try { if(dis!=null) { dis.close(); }else{ ; } if(s!=null) { s.close(); }else{ ; } } catch (IOException e) { e.printStackTrace(); } } } } } import java.io.DataOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.net.Socket; import java.net.UnknownHostException; import java.util.Scanner; public class Client { Socket s; PrintWriter pw; DataOutputStream dos; String line = ""; Scanner reader = new Scanner(System.in); public void startClient(){ try { s = new Socket("127.0.0.1", 8888); dos = new DataOutputStream(s.getOutputStream()); System.out.println("connected"); do{ System.out.print("please input:"); line = reader.next(); dos.writeUTF(line); dos.flush(); }while(!line.equals("bye")); dos.close(); s.close(); } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] args) { new Client().startClient(); } } java.net.SocketException: socket closed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at java.io.DataInputStream.readUnsignedShort(Unknown Source) at java.io.DataInputStream.readUTF(Unknown Source) at java.io.DataInputStream.readUTF(Unknown Source) at Clients.run(Server.java:75) at java.lang.Thread.run(Unknown Source)

FTPClient上传storeFile报错,求救

今天要写一个很简单的ftp上传的代码,结果总是报错,请教各位大神来帮忙解决 这是我的代码 ``` public class UpLoadJSToFtp { /** * * @param url ftp服务器地址 * @param port ftp服务器端口号 * @param userName 登录账号 * @param password 登录密码 * @param path 服务器保存路径 * @param fileName 文件名 * @param input 输入流 * @return 上传成功返回true ,失败返回false */ public static boolean uploadFile(String url, int port, String userName, String password, String path, String fileName, InputStream input){ boolean isSuccess = false; FTPClient ftp = new FTPClient(); ftp.setControlEncoding("UTF-8"); try { int reply; ftp.connect(url);// 连接FTP服务器 // 如果采用默认端口,可以使用ftp.connect(url)的方式直接连接FTP服务器 boolean loginResualt = ftp.login(userName, password); reply = ftp.getReplyCode(); if(!loginResualt && !FTPReply.isPositiveCompletion(reply)){ ftp.disconnect(); return isSuccess; } ftp.setFileType(FTPClient.BINARY_FILE_TYPE); ftp.makeDirectory(path); ftp.changeWorkingDirectory(path); ftp.enterLocalPassiveMode(); ftp.storeFile(fileName, input); input.close(); ftp.logout(); isSuccess = true; } catch (SocketException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally { if(ftp.isConnected()) { try { ftp.disconnect(); } catch(IOException ioe) { } } } return isSuccess; } /** * 将本地文件上传到FTP服务器上 * */ public static void upLoadFromProduction(String url,// FTP服务器hostname int port,// FTP服务器端口 String username, // FTP登录账号 String password, // FTP登录密码 String path, // FTP服务器保存目录 String filename, // 上传到FTP服务器上的文件名 String pathName // 输入流文件路径 ) { try { FileInputStream in = new FileInputStream(new File(pathName)); boolean flag = uploadFile(url, port, username, password, path,filename, in); System.out.println(flag); } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { String url = "172.25.5.229"; int port = 22; String username = "etdftp"; String password = "123"; String path = "/caoyang"; String filename = "caoyangFTPTEST.js"; String pathName = "D:/FndData_1021.js"; upLoadFromProduction(url, port, username, password, path, filename, pathName); } } ``` 这是报的错误,求解 ``` java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:189) at java.net.SocketInputStream.read(SocketInputStream.java:121) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177) at java.io.InputStreamReader.read(InputStreamReader.java:184) at java.io.BufferedReader.fill(BufferedReader.java:154) at java.io.BufferedReader.read(BufferedReader.java:175) at org.apache.commons.net.io.CRLFLineReader.readLine(CRLFLineReader.java:58) at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:310) at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:290) at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:479) at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:552) at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:601) at org.apache.commons.net.ftp.FTP.pasv(FTP.java:952) at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:755) at org.apache.commons.net.ftp.FTPClient._storeFile(FTPClient.java:565) at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:557) at org.apache.commons.net.ftp.FTPClient.storeFile(FTPClient.java:1795) at stag.utils.UpLoadJSToFtp.uploadFile(UpLoadJSToFtp.java:54) at stag.utils.UpLoadJSToFtp.upLoadFromProduction(UpLoadJSToFtp.java:89) at stag.utils.UpLoadJSToFtp.main(UpLoadJSToFtp.java:104) false ```

jdbc连接不上 处理数据时有一段查询 一开始可以用 过一会就会报这个错 求大神指点一番!

``` org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. ### The error may exist in com/gaozhimo/collection/mapper/DemoMapper.java (best guess) ### The error may involve com.gaozhimo.collection.mapper.DemoMapper.findName ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:76) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:399) at com.sun.proxy.$Proxy14.selectOne(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:165) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:95) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40) at com.sun.proxy.$Proxy23.findName(Unknown Source) at com.gaozhimo.collection.service.impl.DemoServiceImpl$Task.handleSocket(DemoServiceImpl.java:545) at com.gaozhimo.collection.service.impl.DemoServiceImpl$Task.run(DemoServiceImpl.java:70) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. ### The error may exist in com/gaozhimo/collection/mapper/DemoMapper.java (best guess) ### The error may involve com.gaozhimo.collection.mapper.DemoMapper.findName ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:95) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:59) at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:386) ... 8 more Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82) at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68) at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:279) at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:69) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:56) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:141) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:101) ... 14 more Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2103) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46) at sun.reflect.GeneratedConstructorAccessor26.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:153) at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:144) at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:196) at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:159) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) ... 24 more Caused by: java.net.SocketException: No buffer space available (maximum connections reached?): connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.<init>(Unknown Source) at java.net.Socket.<init>(Unknown Source) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:253) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2026) ... 40 more org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. ### The error may exist in com/gaozhimo/collection/mapper/DemoMapper.java (best guess) ### The error may involve com.gaozhimo.collection.mapper.DemoMapper.findName ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:76) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:399) at com.sun.proxy.$Proxy14.selectOne(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:165) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:95) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40) at com.sun.proxy.$Proxy23.findName(Unknown Source) at com.gaozhimo.collection.service.impl.DemoServiceImpl$Task.handleSocket(DemoServiceImpl.java:545) at com.gaozhimo.collection.service.impl.DemoServiceImpl$Task.run(DemoServiceImpl.java:70) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. ### The error may exist in com/gaozhimo/collection/mapper/DemoMapper.java (best guess) ### The error may involve com.gaozhimo.collection.mapper.DemoMapper.findName ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:95) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:59) at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:386) ... 8 more Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82) at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68) at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:279) at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:69) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:56) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:141) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:101) ... 14 more Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2103) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46) at sun.reflect.GeneratedConstructorAccessor26.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:153) at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:144) at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:196) at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:159) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) ... 24 more Caused by: java.net.SocketException: No buffer space available (maximum connections reached?): connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.<init>(Unknown Source) at java.net.Socket.<init>(Unknown Source) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:253) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2026) ... 40 more ```

habse集群HRegionServer连接不到master

13-12-16 20:55:33,144 INFO org.apache.hadoop.hbase.regionserver.HRegionServer: Attempting connect to Master server at h1,60000,1387198505290 2013-12-16 20:55:43,164 WARN org.apache.hadoop.hbase.regionserver.HRegionServer: Unable to connect to master. Retrying. Error was: java.net.SocketException: 无效的参数 at sun.nio.ch.Net.connect0(Native Method) at sun.nio.ch.Net.connect(Net.java:465) at sun.nio.ch.Net.connect(Net.java:457) at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:666) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:192) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:489) at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupConnection(HBaseClient.java:392) at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:438) at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1141) at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:988) at org.apache.hadoop.hbase.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:87) 环境是:wind7 VMware Workstation CentOS h1,h2,h3 三个节点, hadoop1.2.1+zookeeper-3.4.5+hbase-0.94.1。 hadoop和zookeeper都已成功安装,且都正常。唯独hbase,虽然master,HregionServer都能启动起来,master已经在监听60000端口,但HReginServer报已上错误,不能正常工作。三个节点机的防火墙都已关闭,并且都强制使用ipv4,也试过hbase0.93,jdk6u45和jdk7u45,也把hadoop的hadoop-core.jar 覆盖到habse过,但都失败。 核心配置如下都已正确: <name>hbase.rootdir</name> <value>hdfs://h1:9000/hbase</value> <name>hbase.cluster.distributed</name> <value>true</value> <name>hbase.zookeeper.quorum</name> <value>h1,h2,h3</value> <name>hbase.tmp.dir</name> <value>home/grid/hadoop/hbase</value> 弄了很久了,未能查明原因,因sun.nio.ch.Net.connect0()方法是jdk6u45版本中从新编写的方法,且是native方法。希望哪位大神能否指导下,谢谢!!!

HttpUrlConnection socks5 代理问题

代码如下: InetSocketAddress inetSocketAddress = new InetSocketAddress(proxyIp, 1080); Proxy proxy = new Proxy(Proxy.Type.SOCKS, inetSocketAddress); URL url = new URL("https://XXXX"); HttpURLConnection conn = (HttpURLConnection)url.openConnection(proxy); conn.setRequestMethod("POST"); 报错如下: java.net.SocketException: SOCKS : authentication failed at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at sun.net.NetworkClient.doConnect(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.<init>(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) 如何设置不需要用户密码验证。求大神!!!

求大神抽时间看看,java连接本地mysql数据库出现connection reset错误

小弟弄这个小问题弄了好久,通过各种渠道找方法最后实在是没有办法了,望大神抽时间帮忙看看,谢谢 代码如下 import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; public class MysqlConnection { public static void main(String[] args) { try { Class.forName("com.mysql.jdbc.Driver"); String url="jdbc:mysql://localhost:3306/test"; Connection con=DriverManager.getConnection(url, "root",""); Statement stmt=con.createStatement(); String sql="select * from msg"; boolean m=stmt.execute(sql); if(m){ System.out.println("succ"); }else System.out.println("false"); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } } } 出现如下错误: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Connection reset STACKTRACE: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:105) at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:148) at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:176) at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1899) at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:481) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:964) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2544) at com.mysql.jdbc.Connection.<init>(Connection.java:1474) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:264) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at com.iotek.mysql.MysqlConnection.main(MysqlConnection.java:16) ** END NESTED EXCEPTION ** Last packet sent to the server was 27 ms ago. at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:552) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:964) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2544) at com.mysql.jdbc.Connection.<init>(Connection.java:1474) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:264) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at com.iotek.mysql.MysqlConnection.main(MysqlConnection.java:16)

jdbc连接数据库的com.mysql.jdbc.CommunicationsException问题

我使用jdbc连接数据库,连接不上,上网搜了很多,有人说是数据库请求超时问题,也有说是数据库url,账号或者密码配置错误,我检查了都没有问题。还有一点奇怪的是,我用jdbc-odbc桥连接又可以连上数据库,用可视化工具也可以连上,但是用jdbc方式连接不上。。。我现在想着应该是哪里的配置有问题,请教各位大神,看看有谁知道或者遇到过,谢谢大家了 这是我的程序 ``` public static void main(String[] args) { Connection ct = null; Statement sm = null; ResultSet rs = null; try { //1、加载驱动(作用是把需要的驱动程序加入内存) Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //2、得到连接(指定连接到哪个数据源) //如果配置数据源选择的是Windows nt验证方式,则不需要用户名和密码 ct = DriverManager.getConnection("jdbc:odbc:MyTest", "root", "root"); //3、创建Statement或者PreparedStatement[区别] //Statement用处是,用于发送sql语句 sm = ct.createStatement(); //4、执行(crud、备份数据库、删除数据库......) //查询,显示所有部门信息 //ResultSet结果集,可以理解成一个表行的结果集 rs = sm.executeQuery("select * from dept"); //因为rs指向结果集的第一行的前一行, //循环取出 while (rs.next()) { int deptno = rs.getInt(1); String dname = rs.getString(2); String loc = rs.getString(3); System.out.println(deptno+" "+dname+" "+loc); } } catch(Exception e) { e.printStackTrace(); } finally { //关闭资源 //关闭顺序是谁后创建谁先关闭 try { //为了程序健壮 if (rs != null) { rs.close(); } if (sm != null) { sm.close(); } if (ct != null) { ct.close(); } } catch (SQLException e) { e.printStackTrace(); } } } ``` 这些是报的异常 ``` com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Permission denied: recv failed STACKTRACE: java.net.SocketException: Permission denied: recv failed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:152) at java.net.SocketInputStream.read(SocketInputStream.java:122) at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:105) at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:148) at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:176) at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1899) at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:481) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:964) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2544) at com.mysql.jdbc.Connection.<init>(Connection.java:1474) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:264) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:146) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:195) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:184) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:648) ** END NESTED EXCEPTION ** Last packet sent to the server was 0 ms ago. at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:552) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:964) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2544) at com.mysql.jdbc.Connection.<init>(Connection.java:1474) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:264) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:146) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:195) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:184) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:648) ```

j-Interop调用64位系统的WMI获取信息报错

报如下错误,有没有大神用过,给下解决办法. Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 16 at jcifs.util.Encdec.dec_uint32le(Encdec.java:90) at ndr.NdrBuffer.dec_ndr_long(NdrBuffer.java:146) at ndr.NetworkDataRepresentation.readUnsignedLong(NetworkDataRepresentation.java:64) at org.jinterop.dcom.core.JIRemoteSCMActivator$RemoteCreateInstance.read(JIRemoteSCMActivator.java:642) at ndr.NdrObject.decode(NdrObject.java:36) at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137) at rpc.Stub.call(Stub.java:113) at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:645) at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:496) at org.jinterop.dcom.core.JIComServer.(JIComServer.java:429) at systeminfo.util.WMIUtil.connect(WMIUtil.java:93) at systeminfo.util.WMIUtil.main(WMIUtil.java:35) package systeminfo.util; import java.net.UnknownHostException; import java.util.logging.Level; import org.jinterop.dcom.common.JIException; import org.jinterop.dcom.common.JISystem; import org.jinterop.dcom.core.IJIComObject; import org.jinterop.dcom.core.JIArray; import org.jinterop.dcom.core.JIComServer; import org.jinterop.dcom.core.JIProgId; import org.jinterop.dcom.core.JISession; import org.jinterop.dcom.core.JIString; import org.jinterop.dcom.core.JIVariant; import org.jinterop.dcom.impls.JIObjectFactory; import org.jinterop.dcom.impls.automation.IJIDispatch; import org.jinterop.dcom.impls.automation.IJIEnumVariant; public class WMIUtil { private JIComServer m_ComStub = null; private IJIComObject m_ComObject = null; private IJIDispatch m_Dispatch = null; private JISession m_Session = null; private IJIDispatch m_WbemServices = null; private static final String WMI_CLSID = "76A6415B-CB41-11d1-8B02-00600806D9B6"; private static final String WMI_PROGID = "WbemScripting.SWbemLocator"; private String m_Host = null; private String m_Domain = "ROOT\\CIMV2"; private String m_Username; private String m_Password; public static void main(String[] args) { WMIUtil wmiService = new WMIUtil("","192.168.9.9","Administrator","cloudsino"); wmiService.connect();// 系统信息 wmiService.query("SELECT * FROM Win32_ComputerSystem");// CPU信息 wmiService.query("SELECT * FROM Win32_PerfFormattedData_PerfOS_Processor WHERE Name != '_Total'");// 内存信息 wmiService.query("SELECT * FROM Win32_PerfFormattedData_PerfOS_Memory");// 磁盘信息 wmiService.query("SELECT * FROM Win32_PerfRawData_PerfDisk_PhysicalDisk Where Name != '_Total'"); wmiService.disconnect(); } public WMIUtil(String domain,String host,String username, String password) { JISystem.setAutoRegisteration(true); JISystem.getLogger().setLevel(Level.WARNING); this.m_Host = host; this.m_Domain = domain; this.m_Username = username; this.m_Password = password; } public void query(String strQuery) { System.out.println("query:" + strQuery); JIVariant results[] = new JIVariant[0]; try { results = m_WbemServices.callMethodA("ExecQuery", new Object[] { new JIString(strQuery), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM() }); IJIDispatch wOSd = (IJIDispatch) JIObjectFactory .narrowObject((results[0]).getObjectAsComObject()); int count = wOSd.get("Count").getObjectAsInt(); IJIComObject enumComObject = wOSd.get("_NewEnum") .getObjectAsComObject(); IJIEnumVariant enumVariant = (IJIEnumVariant) JIObjectFactory .narrowObject(enumComObject .queryInterface(IJIEnumVariant.IID)); IJIDispatch wbemObject_dispatch = null; for (int c = 0; c < count; c++) { Object[] values = enumVariant.next(1); JIArray array = (JIArray) values[0]; Object[] arrayObj = (Object[]) array.getArrayInstance(); for (int j = 0; j < arrayObj.length; j++) { wbemObject_dispatch = (IJIDispatch) JIObjectFactory .narrowObject(((JIVariant) arrayObj[j]) .getObjectAsComObject()); } String str = (wbemObject_dispatch.callMethodA("GetObjectText_", new Object[] { 1 }))[0].getObjectAsString2(); System.out.println("(" + c + "):"); System.out.println(str); System.out.println(); } } catch (JIException e) { e.printStackTrace(); } } public void connect() { try { m_Session = JISession.createSession(m_Domain, m_Username, m_Password); m_Session.useSessionSecurity(false); m_Session.setGlobalSocketTimeout(6000); m_ComStub = new JIComServer(JIProgId.valueOf(WMI_PROGID), m_Host,m_Session); IJIComObject unknown = m_ComStub.createInstance(); m_ComObject = unknown.queryInterface(WMI_CLSID); m_Dispatch = (IJIDispatch) JIObjectFactory.narrowObject(m_ComObject .queryInterface(IJIDispatch.IID)); JIVariant results[] = m_Dispatch.callMethodA( "ConnectServer", new Object[] { new JIString(m_Host), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), 0, JIVariant.OPTIONAL_PARAM() }); m_WbemServices = (IJIDispatch) JIObjectFactory .narrowObject((results[0]).getObjectAsComObject()); } catch (JIException e) { e.printStackTrace(); if (m_Session != null) { try { JISession.destroySession(m_Session); } catch (JIException e1) { e.printStackTrace(); } } } catch (UnknownHostException e) { if (m_Session != null) { try { JISession.destroySession(m_Session); } catch (JIException e1) { e1.printStackTrace(); } } } } public void disconnect() { try { JISession.destroySession(m_Session); } catch (JIException e) { e.printStackTrace(); } } }

JAVA  ftp listfiles 出错

package com.yinzhijie.ebill.test; import java.io.IOException; import java.net.SocketException; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPClientConfig; import org.apache.commons.net.ftp.FTPFile; import org.apache.commons.net.ftp.FTPReply; public class _1 { FTPClient ftp=null; public _1(){ try { ftp=new FTPClient(); ftp.connect("127.0.0.1",21); ftp.setControlEncoding("utf-8"); FTPClientConfig conf = new FTPClientConfig(FTPClientConfig.SYST_NT); conf.setServerLanguageCode("zh"); ftp.login("123", "123"); //ftp.changeWorkingDirectory("/SDK/"); // if(!FTPReply.isPositiveCompletion(ftp.getReplyCode())){ // // System.out.println(ftp.getReplyCode()); // } System.out.println(ftp.getReplyCode()); // ftp.enterLocalPassiveMode(); FTPFile[] ss= ftp.listFiles(); } catch (SocketException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static void main(String[] argv){ new _1(); } } java课设,实现简单的连接FTP下载文件的功能,在自己电脑搭建的FTP服务器 能连接上FTP服务器,但使用listfiles时出错,弄了一下午了,没辙了,求大神帮帮忙

myeclipse中tomcat8.0启动报错,大神们知道怎么解决吗?

2016-06-26 18:55:30,718 [localhost-startStop-1] ERROR [com.alibaba.druid.pool.DruidDataSource] - init datasource error, url: jdbc:oracle:thin:@localhost:1521:orcl java.sql.SQLRecoverableException: IO 错误: Software caused connection abort: socket write error at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:428) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148) at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1377) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:632) 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) Caused by: java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) at java.net.SocketOutputStream.write(SocketOutputStream.java:159) at oracle.net.ns.Packet.send(Packet.java:386) at oracle.net.ns.ConnectPacket.send(ConnectPacket.java:182) at oracle.net.ns.NSProtocol.connect(NSProtocol.java:284) at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1054) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:308) ... 87 more 2016-06-26 18:55:30,732 [localhost-startStop-1] ERROR [com.alibaba.druid.pool.DruidDataSource] - dataSource init error java.sql.SQLRecoverableException: IO 错误: Software caused connection abort: socket write error at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:428) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148) at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1377) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:632) 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) 今天我用tomcat启动项目时,启动过程中就报错,这种情况前几天也出现过,我把oracle数据库卸载后重新装,又重启几次电脑,第二天到公司上班又能正常启动了,现在又出现这种问题,请各位师兄帮我看下,非常感谢!

关于java 调用web api 的一个问题,别吞了,我真的是来问问题的

是这样,现在我遇到一个问题,我用java 调用web api,然后在写了一个测试方法,一切通过OK url 是http://192.168.1.1/test 然后我换到java web程序里面就出问题了,同样的路径,同样的代码, 报的错是 java.net.socketException : sockets error 0 :connect ,请教一下各位大神,有谁遇到过这种问题吗? 难道是端口问题,还是别的什么问题

定量遥感中文版 梁顺林著 范闻捷译

这是梁顺林的定量遥感的中文版,由范闻捷等翻译的,是电子版PDF,解决了大家看英文费时费事的问题,希望大家下载看看,一定会有帮助的

Java 最常见的 200+ 面试题:面试必备

这份面试清单是从我 2015 年做了 TeamLeader 之后开始收集的,一方面是给公司招聘用,另一方面是想用它来挖掘在 Java 技术栈中,还有那些知识点是我不知道的,我想找到这些技术盲点,然后修复它,以此来提高自己的技术水平。虽然我是从 2009 年就开始参加编程工作了,但我依旧觉得自己现在要学的东西很多,并且学习这些知识,让我很有成就感和满足感,那所以何乐而不为呢? 说回面试的事,这份面试...

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

远程工具,免费

远程工具,免费

java jdk 8 帮助文档 中文 文档 chm 谷歌翻译

JDK1.8 API 中文谷歌翻译版 java帮助文档 JDK API java 帮助文档 谷歌翻译 JDK1.8 API 中文 谷歌翻译版 java帮助文档 Java最新帮助文档 本帮助文档是使用谷

csma/ca和csma/cd的matlab仿真源代码带有详细的注释

csma/ca和csma/cd的matlab仿真源代码带有详细的注释,载波侦听,随意设置节点数,带有炫酷的图形展示效果。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

软件测试入门、SQL、性能测试、测试管理工具

软件测试2小时入门,让您快速了解软件测试基本知识,有系统的了解; SQL一小时,让您快速理解和掌握SQL基本语法 jmeter性能测试 ,让您快速了解主流来源性能测试工具jmeter 测试管理工具-禅道,让您快速学会禅道的使用,学会测试项目、用例、缺陷的管理、

pokemmo的资源

pokemmo必须的4个rom 分别为绿宝石 火红 心金 黑白 还有汉化补丁 资源不错哦 记得下载

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

无线通信中的智能天线:IS-95和第3代CDMA应用_.pdf

无线通信中的智能天线:IS-95和第3代CDMA应用_.pdf

设计模式(JAVA语言实现)--20种设计模式附带源码

课程亮点: 课程培训详细的笔记以及实例代码,让学员开始掌握设计模式知识点 课程内容: 工厂模式、桥接模式、组合模式、装饰器模式、外观模式、享元模式、原型模型、代理模式、单例模式、适配器模式 策略模式、模板方法模式、观察者模式、迭代器模式、责任链模式、命令模式、备忘录模式、状态模式、访问者模式 课程特色: 笔记设计模式,用笔记串连所有知识点,让学员从一点一滴积累,学习过程无压力 笔记标题采用关键字标识法,帮助学员更加容易记住知识点 笔记以超链接形式让知识点关联起来,形式知识体系 采用先概念后实例再应用方式,知识点深入浅出 提供授课内容笔记作为课后复习以及工作备查工具 部分图表(电脑PC端查看):

Java8零基础入门视频教程

这门课程基于主流的java8平台,由浅入深的详细讲解了java SE的开发技术,可以使java方向的入门学员,快速扎实的掌握java开发技术!

玩转Linux:常用命令实例指南

人工智能、物联网、大数据时代,Linux正有着一统天下的趋势,几乎每个程序员岗位,都要求掌握Linux。本课程零基础也能轻松入门。 本课程以简洁易懂的语言手把手教你系统掌握日常所需的Linux知识,每个知识点都会配合案例实战让你融汇贯通。课程通俗易懂,简洁流畅,适合0基础以及对Linux掌握不熟练的人学习; 【限时福利】 1)购课后按提示添加小助手,进答疑群,还可获得价值300元的编程大礼包! 2)本月购买此套餐加入老师答疑交流群,可参加老师的免费分享活动,学习最新技术项目经验。 --------------------------------------------------------------- 29元=掌握Linux必修知识+社群答疑+讲师社群分享会+700元编程礼包。 &nbsp;

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

想学好JAVA必须要报两万的培训班吗? Java大神勿入 如果你: 零基础想学JAVA却不知道从何入手 看了一堆书和视频却还是连JAVA的环境都搭建不起来 囊中羞涩面对两万起的JAVA培训班不忍直视 在职没有每天大块的时间专门学习JAVA 那么恭喜你找到组织了,在这里有: 1. 一群志同道合立志学好JAVA的同学一起学习讨论JAVA 2. 灵活机动的学习时间完成特定学习任务+每日编程实战练习 3. 热心助人的助教和讲师及时帮你解决问题,不按时完成作业小心助教老师的家访哦 上一张图看看前辈的感悟: &nbsp; &nbsp; 大家一定迫不及待想知道什么是极简JAVA学习营了吧,下面就来给大家说道说道: 什么是极简JAVA学习营? 1. 针对Java小白或者初级Java学习者; 2. 利用9天时间,每天1个小时时间; 3.通过 每日作业 / 组队PK / 助教答疑 / 实战编程 / 项目答辩 / 社群讨论 / 趣味知识抢答等方式让学员爱上学习编程 , 最终实现能独立开发一个基于控制台的‘库存管理系统’ 的学习模式 极简JAVA学习营是怎么学习的? &nbsp; 如何报名? 只要购买了极简JAVA一:JAVA入门就算报名成功! &nbsp;本期为第四期极简JAVA学习营,我们来看看往期学员的学习状态: 作业看这里~ &nbsp; 助教的作业报告是不是很专业 不交作业打屁屁 助教答疑是不是很用心 &nbsp; 有奖抢答大家玩的很嗨啊 &nbsp; &nbsp; 项目答辩终于开始啦 &nbsp; 优秀者的获奖感言 &nbsp; 这是答辩项目的效果 &nbsp; &nbsp; 这么细致的服务,这么好的氛围,这样的学习效果,需要多少钱呢? 不要1999,不要199,不要99,只要9.9 是的你没听错,只要9.9以上所有就都属于你了 如果你: 1、&nbsp;想学JAVA没有基础 2、&nbsp;想学JAVA没有整块的时间 3、&nbsp;想学JAVA没有足够的预算 还等什么?赶紧报名吧,抓紧抢位,本期只招300人,错过只有等时间待定的下一期了 &nbsp; 报名请加小助手微信:eduxy-1 &nbsp; &nbsp;

Python数据清洗实战入门

本次课程主要以真实的电商数据为基础,通过Python详细的介绍了数据分析中的数据清洗阶段各种技巧和方法。

董付国老师Python全栈学习优惠套餐

购买套餐的朋友可以关注微信公众号“Python小屋”,上传付款截图,然后领取董老师任意图书1本。

linux下利用/proc进行进程树的打印

在linux下利用c语言实现的进程树的打印,主要通过/proc下的目录中的进程文件,获取status中的进程信息内容,然后利用递归实现进程树的打印

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

HoloLens2开发入门教程

本课程为HoloLens2开发入门教程,讲解部署开发环境,安装VS2019,Unity版本,Windows SDK,创建Unity项目,讲解如何使用MRTK,编辑器模拟手势交互,打包VS工程并编译部署应用到HoloLens上等。

150讲轻松搞定Python网络爬虫

【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

MySQL 8.0.19安装教程(windows 64位)

话不多说直接开干 目录 1-先去官网下载点击的MySQL的下载​ 2-配置初始化的my.ini文件的文件 3-初始化MySQL 4-安装MySQL服务 + 启动MySQL 服务 5-连接MySQL + 修改密码 先去官网下载点击的MySQL的下载 下载完成后解压 解压完是这个样子 配置初始化的my.ini文件的文件 ...

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

网络工程师小白入门--【思科CCNA、华为HCNA等网络工程师认证】

本课程适合CCNA或HCNA网络小白同志,高手请绕道,可以直接学习进价课程。通过本预科课程的学习,为学习网络工程师、思科CCNA、华为HCNA这些认证打下坚实的基础! 重要!思科认证2020年2月24日起,已启用新版认证和考试,包括题库都会更新,由于疫情原因,请关注官网和本地考点信息。题库网络上很容易下载到。

Ubuntu18.04安装教程

Ubuntu18.04.1安装一、准备工作1.下载Ubuntu18.04.1 LTS2.制作U盘启动盘3.准备 Ubuntu18.04.1 的硬盘空间二、安装Ubuntu18.04.1三、安装后的一些工作1.安装输入法2.更换软件源四、双系统如何卸载Ubuntu18.04.1新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列...

sql语句 异常 Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your

在我们开发的工程中,有时候会报 [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ------ 这种异常 不用多想,肯定是我们的sql语句出现问题,下面...

西南交通大学新秀杯数学建模试题

题目比较难,如果符合大家的口味欢迎大家下载哈,提高你的思维想象能力

Windows版YOLOv4目标检测实战:训练自己的数据集

课程演示环境:Windows10; cuda 10.2; cudnn7.6.5; Python3.7; VisualStudio2019; OpenCV3.4 需要学习ubuntu系统上YOLOv4的同学请前往:《YOLOv4目标检测实战:训练自己的数据集》 课程链接:https://edu.csdn.net/course/detail/28745 YOLOv4来了!速度和精度双提升! 与 YOLOv3 相比,新版本的 AP (精度)和 FPS (每秒帧率)分别提高了 10% 和 12%。 YOLO系列是基于深度学习的端到端实时目标检测方法。本课程将手把手地教大家使用labelImg标注和使用YOLOv4训练自己的数据集。课程实战分为两个项目:单目标检测(足球目标检测)和多目标检测(足球和梅西同时检测)。 本课程的YOLOv4使用AlexyAB/darknet,在Windows系统上做项目演示。包括:安装软件环境、安装YOLOv4、标注自己的数据集、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算)和先验框聚类分析。还将介绍改善YOLOv4目标检测性能的技巧。 除本课程《Windows版YOLOv4目标检测实战:训练自己的数据集》外,本人将推出有关YOLOv4目标检测的系列课程。请持续关注该系列的其它视频课程,包括: 《Windows版YOLOv4目标检测实战:人脸口罩佩戴检测》 《Windows版YOLOv4目标检测实战:中国交通标志识别》 《Windows版YOLOv4目标检测:原理与源码解析》

Spring Boot -01- 快速入门篇(图文教程)

Spring Boot -01- 快速入门篇 今天开始不断整理 Spring Boot 2.0 版本学习笔记,大家可以在博客看到我的笔记,然后大家想看视频课程也可以到【慕课网】手机 app,去找【Spring Boot 2.0 深度实践】的课程,令人开心的是,课程完全免费! 什么是 Spring Boot? Spring Boot 是由 Pivotal 团队提供的全新框架。Spring Boot...

相关热词 c#对文件改写权限 c#中tostring c#支付宝回掉 c#转换成数字 c#判断除法是否有模 c# 横向chart c#控件选择多个 c#报表如何锁定表头 c#分级显示数据 c# 不区分大小写替换
立即提问
相关内容推荐