java错误:Connection refused:connect

这是我主界面,我想在这点开文件,然后可以发送给连接的人,目前的测试就是自己给自己发。
package com.fastSendFile;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetAdapter;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Vector;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableColumnModel;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;

public class SendWindow {

// private static final SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd:HH:mm:ss");
// private static Object lock1 = new Object();
private Object[] columnNames = { "用户名", "工作组","主机名","优先级", "IP地址", "port","" };
private String myName = "";
private UDP udpService;
private static SendWindow sendWindow;

int add =0; 
int         count=0,flag=0;
JFrame      frame;
File f;
File file;

JButton reFresh;
JButton send;
JButton file_btn;
JButton open_file;

JLabel  userOnline;
JLabel  userCount;

JCheckBox packaging; 
JCheckBox lock;

JTable table;
JTextArea inputArea;

JScrollPane scrollPaneTable;
JScrollPane scrollPaneFile;
JSplitPane jSplitPane; 
JPanel panelSouth;
JPanel panelSouthNorth;
JPanel panelSouthSouth;
JPanel panelNorth;
JPanel panelNorthEast;

private JFileChooser filechooser;
private AddFileWindow addFileWindow;    
String filename = "",filePath = "",filepath="";
long fileSize = 0;
int d = 0,port;
public Vector fileVector = new Vector();  

private void createWindow() {

    //分割容器
            jSplitPane=new JSplitPane();//创建一个分割容器类               
            jSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);//设置分割线方向        
            jSplitPane.setDividerSize(5);
            jSplitPane.setDividerLocation(50);//设置分割线位于中央




            //上半部分整体布局  
            panelNorth = new JPanel(new BorderLayout());
            panelNorthEast = new JPanel(new BorderLayout());
            panelNorth.add(panelNorthEast,BorderLayout.EAST);    
            jSplitPane.setTopComponent(panelNorth);

            //下半部分整体布局
            panelSouth = new JPanel(new BorderLayout());
            panelSouthNorth = new JPanel();
            panelSouthSouth = new JPanel();

            inputArea = new JTextArea();
            scrollPaneFile = new JScrollPane(inputArea);
            scrollPaneFile.setPreferredSize(new Dimension(500, 150));
            scrollPaneFile.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);


             file_btn = new JButton();
            // panelSouthNorth.add(fileName);
             file_btn.setVisible(false);


            FlowLayout flowLayout2 = new FlowLayout(FlowLayout.CENTER , 10 , 10); 
            panelSouthSouth.setLayout(flowLayout2);

            panelSouth.add(file_btn,BorderLayout.NORTH);
            panelSouth.add(scrollPaneFile,BorderLayout.CENTER);
            panelSouth.add(panelSouthSouth,BorderLayout.SOUTH);
            jSplitPane.setBottomComponent(panelSouth);




    DefaultTableModel tableModel = new DefaultTableModel(null, columnNames);
    table = new JTable(tableModel){
        private static final long serialVersionUID = 1L;
        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }

    };

    scrollPaneTable = new JScrollPane();
    scrollPaneTable.setPreferredSize(new Dimension(500, 150));
    //scrollPaneTable.setPreferredSize(panelNorth.getPreferredSize());
    scrollPaneTable.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    //scrollPane.setBounds(new Rectangle(76, 35, 257, 193));
    //table.setFillsViewportHeight(true);
    //panelNorth.add(table.getTableHeader(), BorderLayout.PAGE_START);
    panelNorth.add(scrollPaneTable,BorderLayout.WEST);
//  JScrollPane tableScroll = new JScrollPane();
    JTableHeader header = table.getTableHeader();
    header.setBounds(0, 0, 400, 20);
    table.setBounds(0, 20, 400, 180);
    DefaultTableColumnModel columnModel = (DefaultTableColumnModel) table.getColumnModel();
    columnModel.removeColumn(columnModel.getColumn(6));
    scrollPaneTable.setViewportView(header);
    scrollPaneTable.setViewportView(table);
    scrollPaneTable.setBounds(0, 0, 400, 200);
    scrollPaneTable.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    scrollPaneTable.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);



    //scrollPaneTable = new JScrollPane(table);
    //scrollPaneTable.setPreferredSize(new Dimension(500, 150));
    //scrollPaneTable.setPreferredSize(panelNorth.getPreferredSize());
    //scrollPaneTable.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    //scrollPane.setBounds(new Rectangle(76, 35, 257, 193));
    //table.setFillsViewportHeight(true);
    //panelNorth.add(table.getTableHeader(), BorderLayout.PAGE_START);
    panelNorth.add(scrollPaneTable,BorderLayout.WEST);

    //上半部分标签和按钮
    userOnline = new JLabel("在线用户",JLabel.CENTER);
    userCount = new JLabel("0",JLabel.CENTER);
    reFresh = new JButton("刷新(R)");
    panelNorthEast.add(userOnline,BorderLayout.NORTH);
    panelNorthEast.add(userCount,BorderLayout.CENTER);
    panelNorthEast.add(reFresh,BorderLayout.SOUTH);

    //下半部分拖拽
    DropTargetAdapter kgd=new DropTargetAdapter()
    {
        @Override
        public void drop(DropTargetDropEvent dtde)
        {
            try
            {
                Transferable tf=dtde.getTransferable();
                if(tf.isDataFlavorSupported(DataFlavor.javaFileListFlavor))
                {
                    dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
                    List lt=(List)tf.getTransferData(DataFlavor.javaFileListFlavor);
                    Iterator itor=lt.iterator();
                    while(itor.hasNext())
                    {
                        f=(File)itor.next();                      
                        filename = f.getName();
                        fileSize = f.length();
                        filePath = f.getPath();
                        file_btn.setText(f.getName());
                       // fileName.setText(f.getPath());
                        //fileName.setText(f.getPath().substring(filePath.lastIndexOf("\\") + 1));
                        file_btn.setVisible(true);
                        fileVector.add(f);  
                        add = 0;
                      //  flag+=1;
                        //frame.removeAll();
                       // frame.repaint();
                        if(fileSize>0)
                        {
                            open_file.setEnabled(false);
                        }
                    }
                    dtde.dropComplete(true);
                 }
                 else
                 {
                    dtde.rejectDrop();
                 }
             }
             catch(Exception e)
             {
                 e.printStackTrace();
             }
          }
    };

        new DropTarget(inputArea,DnDConstants.ACTION_COPY_OR_MOVE,kgd);


    file_btn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {    
             addFileWindow = AddFileWindow.createWindow(getInstance());
            addFileWindow.frame.setVisible(true);
            System.out.println("file_btn:"+f.getName()+f.length()+f.getPath());
            addFileWindow.showFile(f.getName(),f.length(),f.getPath());
        }
    });



    //下半部分按钮和复选按钮
    open_file = new JButton("添加文件");
    send = new JButton("发送(S)");
    packaging = new JCheckBox("封装(E)");
    packaging.setSelected(true);
    lock = new JCheckBox("上锁(K)");
    panelSouthSouth.add(open_file);
    panelSouthSouth.add(send);
    panelSouthSouth.add(packaging);
    panelSouthSouth.add(lock);



    open_file.addActionListener(new ActionListener()
    {
        public void actionPerformed(ActionEvent e)
        {
            filechooser = new JFileChooser();
            filechooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            int option = filechooser.showDialog(null, "选择文件");
            if (option == 0) {
                file = filechooser.getSelectedFile();
                filePath = file.getPath();
                 file_btn.setText(file.getName());   
                    file_btn.setVisible(true);
                    add = 0;
            }
        }
    });


    packaging.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {    
            if(packaging.isSelected()==false)
            {
                lock.setSelected(false);
                lock.setEnabled(false);
            }
        }
    });




    //整个布局
    frame = new JFrame("FastSend");
    frame.setSize(595, 420);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
    frame.setResizable(true); 
    frame.setContentPane(jSplitPane);
    jSplitPane.setDividerLocation(0.5);
    //frame.pack();






    frame.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent event) {
            try {
                udpService.broadcast("offline#");
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    });

    reFresh.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            frame.repaint();
        }
    });




    send.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            String msg = inputArea.getText();
            if(add==1)
            {
                filepath = "";
            }
            else
            {
                filepath = filePath;
            }

                System.out.println("1111filepath:"+filepath);
                if ((msg != null && msg.length() > 0) || (filepath != null && filepath.length() > 0)) 
                {
                    List<Map<String, String>> selected = getSelected();
                    if (selected == null) 
                    {
                        JOptionPane.showMessageDialog(null, "请选择发送对象!", "注意", JOptionPane.INFORMATION_MESSAGE);
                        return;
                    }

                    for (Map<String, String> map : selected) 
                    {
                        String addr = map.get("addr");
                        int port = Integer.parseInt(map.get("port"));
                        try {
                            StringBuffer sb = new StringBuffer("msg#");
                            sb.append(myName);
                            msg = (msg != null && msg.length() > 0) ? msg : "null";
                            sb.append("#" + msg.replaceAll("#", "*"));
                            filepath = (filepath != null && filepath.length() > 0) ? filepath : "null";
                            sb.append("#" + filepath);
                            //if(addFileWindow.)
                            udpService.send(addr, port, sb.toString());
                            Vector sendList = new Vector(  );
                            sendList.add(fileVector);
                            int[] selectRows = table.getSelectedRows();
                            InetAddress  sendAddress;
                            DefaultTableModel model = (DefaultTableModel) table.getModel();
                        //  for (int i = 0; i < selectRows.length; i++) {
                            //  String addr = model.getValueAt(selectRows[i], 3).toString();
                            sendAddress=InetAddress.getByName( ( String ) model.getValueAt (selectRows[0] ,3 ) );
                             Thread clientThread=new Thread(new Client( sendList ,sendAddress));
                                clientThread.setPriority(6);
                                clientThread.start();
                        //  }

                        } catch (IOException e1) {
                            e1.printStackTrace();
                        }
                    }
                    inputArea.setText(null);
                    file_btn.setVisible(false);
                    file_btn.setText("");
                    sendWindow.setVisible(false);
                    //filepath = "";
                    filename =  "";
                    fileSize =  0;
                    filePath =  "";
                    d= 1;
                    System.out.println("哈哈"+filepath);
                }
                else
                {
                    System.out.println("wode..");
                    JOptionPane.showMessageDialog(null, "请输入内容或选择文件!", "注意", JOptionPane.INFORMATION_MESSAGE);
                }
        }
    });
}

private void addRow(String userName,String hostGroup,String hostName,String Priority,String hostAddr, int hostPort) {
    DefaultTableModel model = (DefaultTableModel) table.getModel();
    model.addRow(new Object[] { userName,hostGroup,hostName, Priority,hostAddr, hostPort });
}

private void rmRow(String addr) {
    DefaultTableModel model = (DefaultTableModel) table.getModel();
    for (int i = 0, j = table.getRowCount(); i < j; i++) {
        String taddr = model.getValueAt(i, 2).toString();
        if (taddr.equals(addr)) {
            model.removeRow(i);
            break;
        }
    }
}


private List<Map<String, String>> getSelected() {
    int[] selectRows = table.getSelectedRows();
    if (selectRows.length == 0) {
        return null;
    }
    List<Map<String, String>> selected = new ArrayList<Map<String, String>>();
    DefaultTableModel model = (DefaultTableModel) table.getModel();
    for (int i = 0; i < selectRows.length; i++) {
        String addr = model.getValueAt(selectRows[i], 3).toString();
         port = Integer.parseInt(model.getValueAt(selectRows[i], 5).toString());
        Map<String, String> map = new HashMap<String, String>();
        map.put("addr", addr);
        map.put("port", port + "");
        selected.add(map);
    }
    return selected;
}

public void setInpuArea(String str) {
    this.inputArea.setText(str);
}


public void setVisible(boolean b) {
    frame.setVisible(b);
}

private SendWindow() throws IOException {
    this.createWindow();
    myName = System.getProperty("user.name");
    udpService = new UDP();
    ReceiveThread thread = new ReceiveThread();
    thread.start();
    udpService.broadcast("online#" + myName);
    count++;
    userCount.setText(count+"");
    frame.repaint();
//  TCP.init();
}

public static SendWindow getInstance() {
//  synchronized (lock1) {
        if (sendWindow == null) {
            try {
                sendWindow = new SendWindow();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return sendWindow;
//  }
}

class ReceiveThread extends Thread {
    @Override
    public void run() {
        try {
            while (true) {
                Map<String, String> recMap = udpService.receive();
                if (recMap != null && recMap.size() > 0) {
                    handlData(recMap);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    void handlData(Map<String, String> recMap) throws IOException {
        String data = recMap.get("data").trim();
        String hostName = recMap.get("hostName");
        String hostGroup = "";
        String hostAddr = recMap.get("hostAddr");
        String Priority = "";
        int hostPort = Integer.parseInt(recMap.get("hostPort"));
        String[] dataArr = data.split("#");
        if (dataArr[0].equals("online")) {// 收到上线消息后回复发消息给我的人
            String userName = dataArr[1];
            addRow(userName,hostGroup,hostName, Priority,hostAddr, hostPort);
            udpService.send(hostAddr, hostPort, "reply#" + dataArr[1]);
            return;
        }

        if (dataArr[0].equals("reply")) {// 更新在线table
            if(!hostAddr.equals(InetAddress.getLocalHost().getHostAddress())){
                String userName = dataArr[1];
                addRow(userName,hostGroup,hostName, Priority,hostAddr, hostPort);
                count++;
                userCount.setText(count+"");
                frame.repaint();
            }
            return;
        }

        if (dataArr[0].equals("offline")) {// 下线消息,更新table
            rmRow(hostAddr);
            count--;
            userCount.setText(count+"");
            frame.repaint();
            return;
        }

        if (dataArr[0].equals("msg")) {// 接收文本消息
            ReceiveWindow receiveWindow = ReceiveWindow.createWindow(getInstance());
            String msg = dataArr[2].equals("null") ? "":dataArr[2];
            String file = dataArr[3].equals("null") ? "":dataArr[3];
            System.out.println("hhfilename"+file);
            receiveWindow.showMsg(dataArr[1] + "/" + hostName, msg, file, hostAddr);
            //addFileWindow.showFile( filename,fileSize,filePath);
            return;
        }
    }
}





public static void main(String[] args) throws IOException {
    SendWindow sendWindow = SendWindow.getInstance();
}

}
这是接收客户端,是端口选择的问题吗,我要怎么改呢T T

package com.fastSendFile;

import java.awt.GridLayout;
import java.util.*;
import java.net.*;
import java.io.*;
import javax.swing.*;
public class Client implements Runnable
{
private Vector Vname=new Vector();
private InetAddress address;
private Vector sendDir = new Vector();
private Vector fileVector = new Vector();
private long totalSize;
private long fileSize;
private String fileName;
private long receivedSize;
private long skipSize;
SendWindow sendWindow;

    Client( Vector file , InetAddress address)
    {
        fileVector.addAll ( file ) ; 
        this.address = address;
    }
    public  void getFiles(File file,String lastDir ,String localPath)
    {
        if(file.isFile())
        {
            totalSize += file.length();
            sendDir.add (localPath);
    Vname.add(new String(lastDir + "/"+file.getName()));
        }
        else if(file.isDirectory())
        {
    lastDir = lastDir + "/" + file.getName();
    String strs[] = file.list();
    for(int i = 0 ;i < strs.length; i ++)
    {
        File newfile = new File( file.getAbsolutePath() + "/" + strs[i] );
        getFiles( newfile , lastDir , localPath );
    }
        }
    }
public void run()
{    
           totalSize = 0;
           String send = "";

           try
    {
               byte[] buffer = new byte[1024];
               Socket sendSocket = new Socket(address, 20);
               DataInputStream  in = new  DataInputStream(sendSocket.getInputStream());
               BufferedOutputStream  outb = new BufferedOutputStream(sendSocket.getOutputStream(),512);
               DataOutputStream  out = new  DataOutputStream(outb);

               ObjectOutputStream oout = new ObjectOutputStream (out);
               oout.writeObject ( fileVector );  
               oout.flush ();
               ObjectInputStream oin = new ObjectInputStream ( in );               
               Vector accVector = (Vector) oin.readObject ();
               if ( sendWindow.d ==1)
               JOptionPane.showMessageDialog(null, "消息已发送","提示",JOptionPane.DEFAULT_OPTION);
               for (int i = 0 ; i < accVector .size (); i ++)
               {  
                   File temp = (File) accVector.get ( i );
                   send += "   " + temp.getName ();
                   getFiles( temp ,"",temp.getParent ());
               }
               //receive file
               out.writeLong(totalSize);
               out.flush();
               int rSize;


            File tempFile;
            String tempString;
            long count ;
            JFrame frame = new JFrame();
            frame.setTitle("正在发送文件");
            JLabel lable1 = new JLabel();
            JLabel lable2 = new JLabel();
            JLabel lable3 = new JLabel();
            frame.add( lable1,"North" );
            frame.add( lable3,"South" );
            receivedSize = 0;
            JProgressBar bar = new JProgressBar ( 0 , (int)(totalSize/1024));
            JProgressBar bar1 = new JProgressBar ();
            bar.setForeground(new java.awt.Color(102, 255, 102));
            bar.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204)), "\u603b\u8fdb\u5ea6", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 13), new java.awt.Color(0, 0, 255)));
            bar.setDoubleBuffered(true);
            bar.setStringPainted ( true ) ;
            bar1.setSize (320,20);
            bar.setSize (320,20);
            bar1.setForeground(new java.awt.Color(102, 255, 102));
            bar1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204)), "当前进度", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 13), new java.awt.Color(0, 0, 255)));
            bar1.setDoubleBuffered(true);
            bar1.setStringPainted ( true );
            JPanel jp = new JPanel();
            jp.setLayout ( new GridLayout( 3 , 1 ));

// jp.add ( new JLabel ("总进度: "));
jp.add ( bar );
// jp.add ( new JLabel( "当前进度: " ));
jp.add ( bar1 );
jp.add ( lable2 );
frame.add ( jp );

            String  Lmessage1 = "总共要发送:  "+String.valueOf( totalSize / 1024) + "  KB";
            String  Lmessage2 = "速度: 0";
            lable1.setText( Lmessage1 );
            lable2.setText( Lmessage2 );
            lable3.setText ( "共" + Vname.size () + "个文件,已完成" + 0 + "个");
            RandomAccessFile inFile;
            frame.setBounds( 250 , 200 ,  400 , 200);
            frame.setResizable ( false );
            frame.setVisible(true);
            long baseTime = new Date().getTime();
            for(int i = 0;i < Vname.size();i++)
            {   

                count = 0;
                lable3.setText ( "共" + Vname.size () + "个文件,已完成" + i + "个");
                bar1.setMinimum ( 0 );
                tempString = ( String ) Vname.get(i);
                tempFile = new File( sendDir.get(i) + tempString);
                fileSize = tempFile.length();
                jp.setToolTipText ( "正发送:" + tempString.substring ( 1 ) );
                out.writeLong(fileSize); 
                int locate = new Random().nextInt ( 1000 );
                byte [] fileRandom = new byte [10];
                if ( tempFile.length () < 1024 )
                    locate = -1 ;
                else
                fileRandom = getFile( locate,tempFile );
                out.writeInt ( locate );
                out.write ( fileRandom );
                frame.setTitle ( "正发送文件:" + tempString.substring ( 1 ) );
                bar1.setMaximum ( ( int )fileSize / 1024 );
                bar1.setValue ( 0 );
                byte data2[] = tempString.getBytes( "UTF-8" );
                out.write(data2);
                out.flush();

                skipSize = in.readLong();
                rSize = in.read(buffer);
                String reBack = new String(buffer,0,rSize,"UTF-8");
                if("S".equals(reBack))
                {
                    receivedSize += fileSize;
                    count = fileSize;
                    bar.setValue ( (int) receivedSize / 1024);
                    bar1.setValue ((int) count / 1024);
                    continue;
                }
                else
                {
                    if("C".equals(reBack))
                    {
                        receivedSize += skipSize;
                        count = skipSize;
                        bar.setValue ( ( int )receivedSize / 1024 );
                        bar1.setValue ( ( int )count /1024 );
                        inFile = new RandomAccessFile(tempFile, "r");
                        inFile.seek( skipSize );

                    }
                    else
                    {
                        inFile=new RandomAccessFile(tempFile, "r");
                    }

                    while((rSize = inFile.read(buffer)) != -1)
                    {
                        receivedSize += rSize;
                        count += rSize;
                        bar.setValue ( ( int )receivedSize / 1024 );
                        bar1.setValue ( ( int )count / 1024 );
                        lable2.setText("速度: "+
                                String.valueOf(receivedSize * 1000 / (new Date().getTime() - baseTime + 1) / 1024 )+"  KB/s");
                        outb.write( buffer, 0 ,rSize );
                    }
                    outb.flush();
                    inFile.close();
                }
            }
            fileSize = -1;
            out.writeLong(fileSize);
            out.writeInt ( -1 );
            out.write( new byte [10]);
            byte data3[] = "#发送完毕#".getBytes("UTF-8");
            out.write(data3);
            out.flush();
            frame.setVisible(false);
            JOptionPane.showMessageDialog(null, "发送完成!","提示", JOptionPane.DEFAULT_OPTION);    

               in.close();
               out.close();
               sendSocket.close();
    }
    catch(Exception e) 
    {
        JOptionPane.showMessageDialog(null, "发送文件出错l:"+e,"错误", JOptionPane.ERROR_MESSAGE);
    } 
}

 public static  byte [] getFile( int n , File file)
 { 
      byte [] b = new byte [10];
     try
     {

         RandomAccessFile rf = new RandomAccessFile(file,"r");
         rf.seek ( n );
         rf.read ( b, 0 ,b.length);
         rf.close ();
     }
     catch (Exception e)
     {

     }
 return b;
 }

}

3个回答

先检查下防火墙有没有关闭,端口有没有占用

gqylzyt
青圆子 查了,都是没问题的T T
4 年多之前 回复

代码没贴全啊,没有UDP和ReceiveWindow类。
测试的时候,先启动服务器端代码,然后启动client端代码。

、连接不成功呀!

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
java.net.ConnectException: Connection refused: connect

昨天遇到了这个错,到现在没解决,求大佬帮助 1.服务器安装了一个8082的项目,网页访问服务器ip:8082没有任何问题 2.本地装了个node,启动了一个前端项目 localhost:3000,后端接口配的就是http://服务器ip:8082 然后本地掉服务器接口就一直报 java.net.ConnectException: Connection refused: connect, 3.前端是通过jsonp掉的接口 之前都是好的,请问怎么解决啊 spring boot 项目 服务器windows的,防火墙是关闭的,端口也没占用 错误信息 ``` java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at sun.net.NetworkClient.doConnect(NetworkClient.java:180) at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) at sun.net.www.http.HttpClient.<init>(HttpClient.java:211) at sun.net.www.http.HttpClient.New(HttpClient.java:308) at sun.net.www.http.HttpClient.New(HttpClient.java:326) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1167) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1103) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:997) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:931) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1281) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1256) at com.sunline.utils.HttpUtil.httpRequest(HttpUtil.java:62) at com.sunline.utils.HttpUtil.httpRequest(HttpUtil.java:30) at com.sunline.web.controller.XlrLoginController.oauthLogin(XlrLoginController.java:134) at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:877) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:783) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) 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:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:158) at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:126) at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:111) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:209) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) 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:107) 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:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:613) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) ```

初学者关于 java.net.ConnectException: Connection refused: connect的问题?

javase初学者一名,在看到head first java的网络联机这一节中遇到了问题。 用eclipse测试该语句时报错: java.net.ConnectException: Connection refused: connect ``` Socket s=new Socket("127.0.0.1",5000); ``` 搜索了一些处理 java.net.ConnectException: Connection refused: connect的方法,大多都是说Tomcat的问题,刚刚接触java不久对这些javaweb的东西一无所知,看了一部分帖子后,我猜测可能是我没有Tomcat的原因,我尝试了下在eclipse上装了server,并且载入了Tomcat,但是启动服务器失败了。![图片说明](https://img-ask.csdn.net/upload/201908/30/1567102922_739107.png) 所以我想问这里的 ``` Socket s=new Socket("127.0.0.1",5000); ``` 到底是什么原因导致了connection refused。是否是因为与网络相关就必须要载入服务器,还是别的原因。《head frist java》并没有说需要载入服务器,Tomcat什么的操作。 以下是错误提示 ![图片说明](https://img-ask.csdn.net/upload/201908/30/1567103184_669305.png) 程序代码 ``` import java.io.*; import java.net.*; public class DailyAdviceClient { public void go () { try { Socket s=new Socket("127.0.0.1",5000); InputStreamReader streamReader=new InputStreamReader(s.getInputStream()); BufferedReader reader=new BufferedReader(streamReader); String advice=reader.readLine(); System.out.println("Today you should "+advice); }catch(IOException ex) { ex.printStackTrace(); } } public static void main(String[] args) { DailyAdviceClient client =new DailyAdviceClient(); client.go(); } } ```

tomcat:Connection refused: connect什么原因

我的tomcat.startup.bat后,客户端同时启动1000个以上线程去请求它时,开始运行会有 java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(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) 抛出,大家帮分析下是什么原因呢? 我的server.xml中设置maxThreads="500" acceptCount="500"

java.net.ConnectException: Connection refused

org.apache.commons.httpclient.HttpClient请求页面,在windows上是好的,但是在linux上始终报错误:java.net.ConnectException: Connection refused。 而且,在linux上,用java原生的Http Connection可以请求到数据,用curl也可以请求到数据。 问题新进展: 之前,是通过new HttpClient(new HttpClientParams(), new MultiThreadedHttpConnectionManager());构造HttpClient的;现在改为new HttpClient(new HttpClientParams());就没问题了。MultiThreadedHttpConnectionManager为什么会导致Connection refused呢?

RMI异常,java.rmi.ConnectException: Connection refused to host

[code="java"] String name = "Compute"; HelloWorldCompute engine = new HelloWorldEngine(); HelloWorldCompute stub = (HelloWorldCompute) UnicastRemoteObject.exportObject(engine, 8888); Registry registry = LocateRegistry.getRegistry(); registry.rebind(name, stub);[/code] 执行最后一句,抛出异常 java.rmi.ConnectException: Connection refused to host: 10.200.1.184; nested exception is: java.net.ConnectException: Connection refused: connect 什么原因啊

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) { } } } } 求教各位大神这是啥原因,如何解决?

基于AXIS调用webservice报错:Connection refused: connect

我的调用方法: public static void main(String[] args) throws Exception { String client_id = "HeYiApp"; String orderNum = "2"; List numberList = new ArrayList(); numberList.add("120719"); numberList.add("120746"); numberList.add("113095"); String webUrl = "https://10.218.132.26/api/openapi/employee/getBatchEmpInfoList.json";// 服务端url地址 String webMethod = "getBatchEmpInfoList";// 调用方法名称 Service service = new Service(); // 建服务 Call call; try { call = (Call) service.createCall(); try { call.setTargetEndpointAddress(new URL(webUrl)); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); }// 设置访问地址 call.setOperationName(webMethod);// 设置访问方法 call.addParameter("arg0", XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);// 定义参数 call.addParameter("arg1", XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);// 定义参数 call.addParameter("arg2", XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);// 定义参数 call.setReturnType(XMLType.XSD_STRING);// 定义返回值格式 //List<Map<String, Object>> workersInfo= (List<Map<String, Object>>) call.invoke(new Object[] { client_id, numberList, orderNum }); //for(Map m:workersInfo){ // System.out.println(m.get("name")); //} JSONArray jsonObject = (JSONArray) call.invoke(new Object[] { client_id, numberList, orderNum }); System.out.println(jsonObject.toString()); } catch (ServiceException e) { // TODO Auto-generated catch block e.printStackTrace(); } // 建对话 } 报错: Exception in thread "main" AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.net.ConnectException: Connection refused: connect faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) at sun.security.ssl.SSLSocketImpl.&lt;init&gt;(SSLSocketImpl.java:427) at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:88) at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92) at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at webservice.Test.main(Test.java:52) {http://xml.apache.org/axis/}hostname:zhangxl java.net.ConnectException: Connection refused: connect at org.apache.axis.AxisFault.makeFault(AxisFault.java:101) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at webservice.Test.main(Test.java:52) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) at sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:427) at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:88) at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92) at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138) ... 10 more

(已解决)紧急求助!springboot启动服务,提示: java.net.ConnectException: Connection refused: connect

## 这个服务昨晚还可以运行的,今早启动后, 一开始提示:could not be registered. A bean with that name has already been 根据网友的说法,我设置了:_allow-bean-definition-overriding: true _ ## 然后就开始报这个错了,现在把上面这个配置注释掉也不行。。。 请大神指教! +++ ![图片说明](https://img-ask.csdn.net/upload/202002/04/1580782392_321522.png) +++ ``` com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187) ~[jersey-apache-client4-1.19.1.jar:1.19.1] at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123) ~[jersey-client-1.19.1.jar:1.19.1] at com.netflix.discovery.EurekaIdentityHeaderFilter.handle(EurekaIdentityHeaderFilter.java:27) ~[eureka-client-1.9.13.jar:1.9.13] at com.sun.jersey.api.client.Client.handle(Client.java:652) ~[jersey-client-1.19.1.jar:1.19.1] at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682) ~[jersey-client-1.19.1.jar:1.19.1] at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74) ~[jersey-client-1.19.1.jar:1.19.1] at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:509) ~[jersey-client-1.19.1.jar:1.19.1] at com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient.getApplicationsInternal(AbstractJerseyEurekaHttpClient.java:194) ~[eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient.getApplications(AbstractJerseyEurekaHttpClient.java:165) ~[eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.decorator.MetricsCollectingEurekaHttpClient.execute(MetricsCollectingEurekaHttpClient.java:73) ~[eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.executeOnNewServer(RedirectingEurekaHttpClient.java:118) ~[eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.execute(RedirectingEurekaHttpClient.java:79) ~[eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:120) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry(DiscoveryClient.java:1069) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:983) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:430) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:276) [eureka-client-1.9.13.jar:1.9.13] at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:272) [eureka-client-1.9.13.jar:1.9.13] at org.springframework.cloud.netflix.eureka.CloudEurekaClient.<init>(CloudEurekaClient.java:67) [spring-cloud-netflix-eureka-client-2.1.4.RELEASE.jar:2.1.4.RELEASE] at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration.eurekaClient(EurekaClientAutoConfiguration.java:322) [spring-cloud-netflix-eureka-client-2.1.4.RELEASE.jar:2.1.4.RELEASE] at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration$$EnhancerBySpringCGLIB$$fdd1bb83.CGLIB$eurekaClient$2(<generated>) [spring-cloud-netflix-eureka-client-2.1.4.RELEASE.jar:2.1.4.RELEASE] at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration$$EnhancerBySpringCGLIB$$fdd1bb83$$FastClassBySpringCGLIB$$45c98188.invoke(<generated>) [spring-cloud-netflix-eureka-client-2.1.4.RELEASE.jar:2.1.4.RELEASE] at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) [spring-core-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) [spring-context-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration$$EnhancerBySpringCGLIB$$fdd1bb83.eurekaClient(<generated>) [spring-cloud-netflix-eureka-client-2.1.4.RELEASE.jar:2.1.4.RELEASE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) [spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) [spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:607) [spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321) [spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160) [spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) [spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) [spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$1(AbstractBeanFactory.java:356) [spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.cloud.context.scope.GenericScope$BeanLifecycleWrapper.getBean(GenericScope.java:389) ~[spring-cloud-context-2.1.4.RELEASE.jar:2.1.4.RELEASE] at org.springframework.cloud.context.scope.GenericScope.get(GenericScope.java:186) ~[spring-cloud-context-2.1.4.RELEASE.jar:2.1.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:353) [spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35) ~[spring-aop-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaRegistration.getTargetObject(EurekaRegistration.java:129) ~[spring-cloud-netflix-eureka-client-2.1.4.RELEASE.jar:2.1.4.RELEASE] at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaRegistration.getEurekaClient(EurekaRegistration.java:117) ~[spring-cloud-netflix-eureka-client-2.1.4.RELEASE.jar:2.1.4.RELEASE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181] at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) ~[spring-core-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.cloud.context.scope.GenericScope$LockedScopedProxyFactoryBean.invoke(GenericScope.java:499) ~[spring-cloud-context-2.1.4.RELEASE.jar:2.1.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaRegistration$$EnhancerBySpringCGLIB$$ea0a2add.getEurekaClient(<generated>) ~[spring-cloud-netflix-eureka-client-2.1.4.RELEASE.jar:2.1.4.RELEASE] at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaServiceRegistry.maybeInitializeClient(EurekaServiceRegistry.java:57) ~[spring-cloud-netflix-eureka-client-2.1.4.RELEASE.jar:2.1.4.RELEASE] at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaServiceRegistry.register(EurekaServiceRegistry.java:38) ~[spring-cloud-netflix-eureka-client-2.1.4.RELEASE.jar:2.1.4.RELEASE] at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaAutoServiceRegistration.start(EurekaAutoServiceRegistration.java:83) ~[spring-cloud-netflix-eureka-client-2.1.4.RELEASE.jar:2.1.4.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182) ~[spring-context-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53) ~[spring-context-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360) ~[spring-context-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158) ~[spring-context-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122) ~[spring-context-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:893) ~[spring-context-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162) ~[spring-boot-2.1.10.RELEASE.jar:2.1.10.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) ~[spring-context-5.1.11.RELEASE.jar:5.1.11.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.10.RELEASE.jar:2.1.10.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) ~[spring-boot-2.1.10.RELEASE.jar:2.1.10.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) ~[spring-boot-2.1.10.RELEASE.jar:2.1.10.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-2.1.10.RELEASE.jar:2.1.10.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.1.10.RELEASE.jar:2.1.10.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) ~[spring-boot-2.1.10.RELEASE.jar:2.1.10.RELEASE] at com.myfeign.MyFeignConsumer_8888.main(MyFeignConsumer_8888.java:14) ~[classes/:na] Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) ~[na:1.8.0_181] at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85) ~[na:1.8.0_181] at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_181] at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_181] at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_181] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) ~[na:1.8.0_181] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_181] at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_181] at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117) ~[httpclient-4.5.1.jar:4.5.1] at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177) ~[httpclient-4.5.1.jar:4.5.1] at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144) ~[httpclient-4.5.1.jar:4.5.1] at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:131) ~[httpclient-4.5.1.jar:4.5.1] at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611) ~[httpclient-4.5.1.jar:4.5.1] at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446) ~[httpclient-4.5.1.jar:4.5.1] at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882) ~[httpclient-4.5.1.jar:4.5.1] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:117) ~[httpclient-4.5.1.jar:4.5.1] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55) ~[httpclient-4.5.1.jar:4.5.1] at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:173) ~[jersey-apache-client4-1.19.1.jar:1.19.1] ... 79 common frames omitted ```

java.net.ConnectException: Connection refused: connect异常

1描述问题 我在做一个简单的练习项目,要学习掌握socket的基本用法。 我的问题出现在demo(客户端)的java文件里,虽然我按照老师的讲解写了代码, //socket("IP地址",端口号); Socket s=new Socket("192.168.43.224",8888); 但是程序出现了异常 2贴上相关代码 ``` public static void main(String[] args) throws Exception { Socket s=new Socket("192.168.43.224",8888); while (true){ System.out.println("请选择操作"); System.out.println("1增加2删除3更改4查询5退出"); Scanner sc=new Scanner(System.in); int choose=sc.nextInt(); switch (choose){ case 1: add(s); break; case 2:break; case 3:break; case 4:break; case 5:s.close();return; } } } ``` 3报错信息 Exception in thread "main" java.net.ConnectException: Connection refused: connect at java.base/java.net.PlainSocketImpl.connect0(Native Method) at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:101) at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403) at java.base/java.net.Socket.connect(Socket.java:591) at java.base/java.net.Socket.connect(Socket.java:540) at java.base/java.net.Socket.<init>(Socket.java:436) at java.base/java.net.Socket.<init>(Socket.java:213) at homework.itheima.client.Demo.main(Demo.java:11) 4尝试过的方法 搜索了“java.net.ConnectException: Connection refused: connect”,但是 还是无从下手 5相关截图 ![图片说明](https://img-ask.csdn.net/upload/202006/12/1591934007_310224.png) ![图片说明](https://img-ask.csdn.net/upload/202006/12/1591934038_989292.png) ![图片说明](https://img-ask.csdn.net/upload/202006/12/1591934051_559865.png)

测试报错,Connection refused: connect,求解?

代码: ``` public class ItfTest { /** * @param args */ public static void main(String[] args) { try { String out = testbiz(); System.out.println(out); } catch (IOException e) { e.printStackTrace(); } } public static String testbiz() throws HttpException, IOException { HttpClient httpClient = new HttpClient(); PostMethod post = new PostMethod( "http://localhost:8001/itf/OI_AddSaleByParameter"); // PostMethod post = new PostMethod( "https://rryx.sinovatech.com/itf/OI_QueryEShopOrder"); post.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); String key = "123321abc"; String channel="ch_shenxun"; Map<String, Object> req = new HashMap<>(); String instr ="{\"body\": \"{\\\"startTime\\\":\\\"2019-01-01 14:43:19\\\",\\\"endTime\\\":\\\"2019-01-12 15:14:42\\\",\\\"phone\\\":\\\"18309858042\\\"}\",\"head\": {} }"; /* String instr ="6351"; req.put("loginCode",instr);*/ Map<String, Object> header = new HashMap<>(); header.put("appId", channel); header.put("tid", UUID.randomUUID().toString()); header.put("timestamp", System.currentTimeMillis()); header.put("ver", "1.0"); Map<String, Object> reMap = new HashMap<>(); reMap.put("header", header); reMap.put("req", req); req.put("saleName","123"); req.put("goodIds","ff8080815e562c4d015e6103956700b6"); req.put("orderValue","1"); req.put("createName","管理员"); System.out.println(JSONObject.toJSON(reMap)); String reqdata = JSONObject.toJSONString(reMap); String sign = DigestUtils.md5Hex(reqdata + key); NameValuePair[] param = { new NameValuePair("sign", sign), new NameValuePair("reqdata", reqdata) }; post.setRequestBody(param); int result = httpClient.executeMethod(post); System.out.println("返回结果=" + result); InputStream in = post.getResponseBodyAsStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); StringBuilder sb = new StringBuilder(); String line = reader.readLine(); while (line != null) { sb.append(line); line = reader.readLine(); } reader.close(); return sb.toString(); } } //以上代码传参测试,但是运行后报错 java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:286) at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80) at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122) at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) 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.sinovatech.test.ItfTest.testbiz(ItfTest.java:95) at com.sinovatech.test.ItfTest.main(ItfTest.java:52) 求大神指点 ```

tomcat启动报:Connection refused

Tomcat启动时报如下错误: WARN : com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@118d1a82 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: (com.mchange.v2.resourcepool.BasicResourcePool#run ) 2018年05月04日17点02分 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at sun.reflect.GeneratedConstructorAccessor52.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1129) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:358) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2498) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2535) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2320) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46) at sun.reflect.GeneratedConstructorAccessor45.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:244) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:308) ... 19 more 说明: 1.刚开始查看mysql的运行状态是关闭的,然后启动mysql,启动成功; ![图片说明](https://img-ask.csdn.net/upload/201805/04/1525426214_452274.jpg) 2.再次启动tomcat还是失败,然后查看防火墙,发现tomcat的8080端口,和mysql的3306端口未添加进去,然后添加了后重启防火墙,显示添加成功; ![图片说明](https://img-ask.csdn.net/upload/201805/04/1525426151_518295.png) 3.再次启动还是失败,检查db.properties,测试通过,正确; 4.数据库权限:我的是用root账户连接数据库的,检查数据库发现也都有权限 注:tomcat和mysql在同一服务器中

java 我执行一个非常简单的socket程序都出错!java.net.ConnectException: Connection refused:

<div class="iteye-blog-content-contain" style="font-size: 14px;"> <p>java  网络编程</p> <p> </p> <p>我执行一个非常简单的socket程序都出错!要崩溃了!我关闭了防火墙也不行,试了Ping 127.0.0.1是可以的,而且我查了这个端口也没有被占用,怎么解决?</p> <p>java.net.ConnectException: Connection refused: connect</p> <p>at java.net.DualStackPlainSocketImpl.connect0(Native Method)</p> <p>at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)</p> <p>at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)</p> <p>at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)</p> <p>at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)</p> <p>at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)</p> <p>at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)</p> <p>at java.net.Socket.connect(Socket.java:579)</p> <p>at java.net.Socket.connect(Socket.java:528)</p> <p>at java.net.Socket.&lt;init&gt;(Socket.java:425)</p> <p>at java.net.Socket.&lt;init&gt;(Socket.java:208)</p> <p>at com.hxw.socket.SimpleSocketClient.main(SimpleSocketClient.java:22)</p> <p>java.lang.NullPointerException</p> <p>at com.hxw.socket.SimpleSocketClient.main(SimpleSocketClient.java:37)</p> <p> </p> <p><span style="font-size: 24px;">源码在此:</span></p> <pre name="code" class="java">package com.hxw.socket; import java.io.*; import java.net.*; /** * 简单的Socket客户端 功能为:发送字符串“Hello”到服务器端,并打印出服务器端的反馈 */ public class SimpleSocketClient { public static void main(String[] args) { Socket socket = null; InputStream is = null; OutputStream os = null; // 服务器端IP地址 String serverIP = "127.0.0.1"; // 服务器端端口号 int port = 10002; // 发送内容 String data = "Hello"; try { // 建立连接 socket = new Socket(serverIP, port); // 发送数据 os = socket.getOutputStream(); os.write(data.getBytes()); // 接收数据 is = socket.getInputStream(); byte[] b = new byte[1024]; int n = is.read(b); // 输出反馈数据 System.out.println("服务器反馈:" + new String(b, 0, n)); } catch (Exception e) { e.printStackTrace(); // 打印异常信息 } finally { try { // 关闭流和连接 is.close(); os.close(); socket.close(); } catch (Exception e2) { e2.printStackTrace(); } } } } </pre> <p> </p> </div>

IDEA连接服务器远程调试报 "Connection refused: connect"

IntelliJ IDEA连接tomcat服务器远程调试报Unable to open debugger port : java.net.ConnectException "Connection refused: connect"错误怎么解决;而且有时候是可以连接的,有时候又不行了。。。求各位大神解答一下,谢谢。。。。。。。

connect() failed (111: Connection refused) while connecting to upstream,

![图片说明](https://img-ask.csdn.net/upload/201909/17/1568686105_833721.png) 这是啥错误啊。。网上都是些什么php。。。。。

连接hbase Connection refused: no further information

server环境: 在virtualbox里安装了ubuntu,然后装了了hadoop2.7.5,hbase1.3.1,然后hadoop和hbase的环境都配置好了 启动了hbase,然后本机里通过scala访问虚拟机里的hbase时,connection能获取到,但是在执行tableExists时,卡一会后就报超时了,client的代码和server的配置如: server配置(其中zookeeper用的hbase自己管理的): hbase-site.xml ![图片说明](https://img-ask.csdn.net/upload/201804/02/1522641879_341754.png) client的代码: ``` class HbaseUtil { def GetHbaseConfiguration(ip:String):Unit={ var conf = HBaseConfiguration.create; //这个是远程hbase的ip地址 conf.set("hbase.zookeeper.quorum",ip) //conf.set("zookeeper.znode.parent", "/hbase-unsecure") //2181是hbase里zookeeper的默认端口号 conf.set("hbase.zookeeper.property.clientPort","2181") println(ip+":habse connention success...") val tableName = "jndata" conf.set(TableInputFormat.INPUT_TABLE, tableName) val con= ConnectionFactory.createConnection(conf) val hBaseAdmin = con.getAdmin//new HBaseAdmin(conf); val tn = TableName.valueOf(tableName); // hBaseAdmin.disableTable(tn) // println(tableName + " is exist,detele....") //创建表 if (hBaseAdmin.tableExists(tn)) { println(tableName + " is exist,....") }else{ println(tableName + " is not exist,....") } } } ``` 然后server端的zookeeper的log如下: ![图片说明](https://img-ask.csdn.net/upload/201804/02/1522640993_389812.png) client端的异常如下: ``` Exception in thread "main" org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions: Mon Apr 02 11:30:11 CST 2018, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=76915: Connection refused: no further information row 'jndata,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=simon-virtualbox,16201,1522631406769, seqNum=0 at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.throwEnrichedException(RpcRetryingCallerWithReadReplicas.java:276) at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:210) at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:60) at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:212) at org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:314) at org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:289) at org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:164) at org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:159) at org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:796) at org.apache.hadoop.hbase.MetaTableAccessor.fullScan(MetaTableAccessor.java:602) at org.apache.hadoop.hbase.MetaTableAccessor.tableExists(MetaTableAccessor.java:366) at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:408) at rxb.flinkDemo.hbase.HbaseUtil.GetHbaseConfiguration(HbaseUtil.scala:42) at rxb.flinkDemo.MyDemo$.main(FlinkDemo.scala:27) at rxb.flinkDemo.MyDemo.main(FlinkDemo.scala) Caused by: java.net.SocketTimeoutException: callTimeout=60000, callDuration=76915: Connection refused: no further information row 'jndata,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=simon-virtualbox,16201,1522631406769, seqNum=0 at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:171) at org.apache.hadoop.hbase.client.ResultBoundedCompletionService$QueueingFuture.run(ResultBoundedCompletionService.java:65) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.net.ConnectException: Connection refused: no further information at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:531) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:495) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.setupConnection(RpcClientImpl.java:416) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.setupIOstreams(RpcClientImpl.java:722) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.writeRequest(RpcClientImpl.java:909) at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.tracedWriteRequest(RpcClientImpl.java:873) at org.apache.hadoop.hbase.ipc.RpcClientImpl.call(RpcClientImpl.java:1244) at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:227) at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:336) at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$BlockingStub.scan(ClientProtos.java:35396) at org.apache.hadoop.hbase.client.ScannerCallable.openScanner(ScannerCallable.java:404) at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:211) at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:65) at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:212) at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:364) at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:338) at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:137) ... 4 more ``` 好多办法都试过了还是不行: 1.server和client的防火墙都关了 2.client的host里也配置了server的ip和hostname

关于CXF的client调用server,出现Connection refused: connect

环境描述 jdk7 cxf.version = 3.0.0 Spring.version = 3.2.4 图片详细描述:http://www.oschina.net/question/1027522_2138367#answers 出的问题: 以前没设置防火墙,访问http://IP/services/服务名,请求没有问题 现在有设置防火墙了,不能IP访问,只能通过域名,http://yx.hello.comIP/services/服务名 然后就经常Connection refused: connect 请问是哪个环节需要改进?公司明确了就是要通过网址调用,求各位大神解救啊

Connection refused: connect: localhost" [90067-168])

连接远程oracle报了一个连接拒绝的错,我是win7的,下面是错误,那位大神指导下吧: apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-168]) at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:224) at $Proxy4.getMetaData(Unknown Source) at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDatabaseType(ProcessEngineConfigurationImpl.java:517) at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDataSource(ProcessEngineConfigurationImpl.java:478) at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:323) at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:300) at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:60) at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:56) at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1442) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:305) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061) at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

jdbc连接远程的oracle数据库报错,Connection refused

通过jdbc连接远程的oracle数据库,报错连接被拒绝: java.sql.SQLRecoverableException: IO 错误: Connection refused at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:458) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at com.yzj.taf.Mytest.test(Mytest.java:36) 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:483) 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:89) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209) Caused by: oracle.net.ns.NetException: Connection refused at oracle.net.ns.NSProtocol.connect(NSProtocol.java:395) at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1102) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:320) ... 30 more 写的测试代码如下: public void test() { Connection conn = null; Statement stmt = null; ResultSet rs = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); String url = "jdbc:oracle:thin:@192.168.1.155:1521:orcl"; String dbUsername = "test"; String dbPassword = "test"; conn = DriverManager.getConnection(url, dbUsername, dbPassword); System.out.println("正常"); } catch (Exception e) { e.printStackTrace(); System.out.println("异常"); } finally { if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } } } 用sqlDeverloper工具可以连接,但是写代码就不行,其他的电脑同样的开发工具和代码可以连接,求大神!!!!!

socket通信发生了CONNECTION REFUSED 怎么办

package exercise; import java.io.*; import java.net.*; import java.util.*; public class clientSocket { public clientSocket() { try { InetAddress ia = InetAddress.getByName("127.0.0.1"); Socket soc = new Socket(ia,8000); InputStream is = soc.getInputStream(); InputStreamReader isr = new InputStreamReader(is); InputStreamReader user_isr = new InputStreamReader(System.in); BufferedReader user_br = new BufferedReader(user_isr); BufferedReader br = new BufferedReader(isr); OutputStream os = soc.getOutputStream(); PrintStream ps = new PrintStream(os); System.out.println("这里是客户端: "); String s; while(true) { System.out.println("输入你想要的文件: "); ps.println(user_br.readLine()); if(user_br.readLine().equals("Bye")) { break; } } soc.close(); } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } public static void main(String args[]) { clientSocket cs = new clientSocket(); } } package exercise; import java.net.*; import java.io.*; import java.util.*; public class serverSocket { public serverSocket() { try { ServerSocket ss = new ServerSocket(8000); Socket soc = ss.accept(); InputStream is = soc.getInputStream(); OutputStream os = soc.getOutputStream(); PrintStream ps = new PrintStream(os); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String s1; System.out.println("服务器端: "); while(true) { s1 = br.readLine(); if(s1.equals("Bye")) { break; } File f = new File(s1); if(!f.exists()) { ps.println("文件不存在"); } else if(f.exists()) { FileInputStream fis = new FileInputStream(s1); InputStreamReader ipsr = new InputStreamReader(fis); BufferedReader bfr = new BufferedReader(ipsr); ps.println(bfr.readLine()); System.out.println("文件内容已发送"); } } soc.close(); ss.close(); } catch (IOException e) { e.printStackTrace(); } } public static void main(String args) { serverSocket SS = new serverSocket(); } }

MySQL 8.0.19安装教程(windows 64位)

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

Python+OpenCV计算机视觉

Python+OpenCV计算机视觉系统全面的介绍。

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

navicat(内含激活码)

navicat支持mysql的可视化操作,内涵激活码,不用再忍受弹框的痛苦。

HTML期末大作业

这是我自己做的HTML期末大作业,花了很多时间,稍加修改就可以作为自己的作业了,而且也可以作为学习参考

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答疑

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

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

基于STM32的电子时钟设计

时钟功能 还有闹钟功能,温湿度功能,整点报时功能 你值得拥有

学生成绩管理系统(PHP + MYSQL)

做的是数据库课程设计,使用的php + MySQL,本来是黄金搭配也就没啥说的,推荐使用wamp服务器,里面有详细的使用说明,带有界面的啊!呵呵 不行的话,可以给我留言!

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

程序员的兼职技能课

获取讲师答疑方式: 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元,今日仅需39元!购课添加小助手(微信号:itxy41)按提示还可领取价值800元的编程大礼包! 讲师介绍: 苏奕嘉&nbsp;前阿里UC项目工程师 脚本开发平台官方认证满级(六级)开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金? 零基础程序定制脚本开发课程,是完全针对零脚本开发经验的小白而设计,课程内容共分为3大阶段: ①前期将带你掌握Q开发语言和界面交互开发能力; ②中期通过实战来制作有具体需求的定制脚本; ③后期将解锁脚本的更高阶玩法,打通任督二脉; ④应用定制脚本合法赚取额外收入的完整经验分享,带你通过程序定制脚本开发这项副业,赚取到你的第一桶金!

实用主义学Python(小白也容易上手的Python实用案例)

原价169,限时立减100元! 系统掌握Python核心语法16点,轻松应对工作中80%以上的Python使用场景! 69元=72讲+源码+社群答疑+讲师社群分享会&nbsp; 【哪些人适合学习这门课程?】 1)大学生,平时只学习了Python理论,并未接触Python实战问题; 2)对Python实用技能掌握薄弱的人,自动化、爬虫、数据分析能让你快速提高工作效率; 3)想学习新技术,如:人工智能、机器学习、深度学习等,这门课程是你的必修课程; 4)想修炼更好的编程内功,优秀的工程师肯定不能只会一门语言,Python语言功能强大、使用高效、简单易学。 【超实用技能】 从零开始 自动生成工作周报 职场升级 豆瓣电影数据爬取 实用案例 奥运冠军数据分析 自动化办公:通过Python自动化分析Excel数据并自动操作Word文档,最终获得一份基于Excel表格的数据分析报告。 豆瓣电影爬虫:通过Python自动爬取豆瓣电影信息并将电影图片保存到本地。 奥运会数据分析实战 简介:通过Python分析120年间奥运会的数据,从不同角度入手分析,从而得出一些有趣的结论。 【超人气老师】 二两 中国人工智能协会高级会员 生成对抗神经网络研究者 《深入浅出生成对抗网络:原理剖析与TensorFlow实现》一书作者 阿里云大学云学院导师 前大型游戏公司后端工程师 【超丰富实用案例】 0)图片背景去除案例 1)自动生成工作周报案例 2)豆瓣电影数据爬取案例 3)奥运会数据分析案例 4)自动处理邮件案例 5)github信息爬取/更新提醒案例 6)B站百大UP信息爬取与分析案例 7)构建自己的论文网站案例

Java8零基础入门视频教程

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

Python数据挖掘简易入门

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

零基础学C#编程—C#从小白到大咖

本课程从初学者角度出发,提供了C#从入门到成为程序开发高手所需要掌握的各方面知识和技术。 【课程特点】 1 由浅入深,编排合理; 2 视频讲解,精彩详尽; 3 丰富实例,轻松易学; 4 每章总结配有难点解析文档。 15大章节,228课时,1756分钟与你一同进步!

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

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

多功能数字钟.zip

利用数字电子计数知识设计并制作的数字电子钟(含multisim仿真),该数字钟具有显示星期、24小时制时间、闹铃、整点报时、时间校准功能

极简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程序设计(第2版)》、《Python可以这样学》配套视频,讲解Python 3.5.x和3.6.x语法、内置对象用法、选择与循环以及函数设计与使用、lambda表达式用法、字符串与正则表达式应用、面向对象编程、文本文件与二进制文件操作、目录操作与系统运维、异常处理结构。

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

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

机器学习实战系列套餐(必备基础+经典算法+案例实战)

机器学习实战系列套餐以实战为出发点,帮助同学们快速掌握机器学习领域必备经典算法原理并结合Python工具包进行实战应用。建议学习顺序:1.Python必备工具包:掌握实战工具 2.机器学习算法与实战应用:数学原理与应用方法都是必备技能 3.数据挖掘实战:通过真实数据集进行项目实战。按照下列课程顺序学习即可! 课程风格通俗易懂,用最接地气的方式带领大家轻松进军机器学习!提供所有课程代码,PPT与实战数据,有任何问题欢迎随时与我讨论。

Java面试题大全(2020版)

发现网上很多Java面试题都没有答案,所以花了很长时间搜集整理出来了这套Java面试题大全,希望对大家有帮助哈~ 本套Java面试题大全,全的不能再全,哈哈~ 一、Java 基础 1. JDK 和 JRE 有什么区别? JDK:Java Development Kit 的简称,java 开发工具包,提供了 java 的开发环境和运行环境。 JRE:Java Runtime Environ...

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

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

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

HoloLens2开发入门教程

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

几率大的Redis面试题(含答案)

本文的面试题如下: Redis 持久化机制 缓存雪崩、缓存穿透、缓存预热、缓存更新、缓存降级等问题 热点数据和冷数据是什么 Memcache与Redis的区别都有哪些? 单线程的redis为什么这么快 redis的数据类型,以及每种数据类型的使用场景,Redis 内部结构 redis的过期策略以及内存淘汰机制【~】 Redis 为什么是单线程的,优点 如何解决redis的并发竞争key问题 Red...

MFC一站式终极全套课程包

该套餐共包含从C小白到C++到MFC的全部课程,整套学下来绝对成为一名C++大牛!!!

【数据结构与算法综合实验】欢乐连连看(C++ & MFC)案例

这是武汉理工大学计算机学院数据结构与算法综合实验课程的第三次项目:欢乐连连看(C++ & MFC)迭代开发代码。运行环境:VS2017。已经实现功能:开始游戏、消子、判断胜负、提示、重排、计时、帮助。

YOLOv3目标检测实战:训练自己的数据集

YOLOv3是一种基于深度学习的端到端实时目标检测方法,以速度快见长。本课程将手把手地教大家使用labelImg标注和使用YOLOv3训练自己的数据集。课程分为三个小项目:足球目标检测(单目标检测)、梅西目标检测(单目标检测)、足球和梅西同时目标检测(两目标检测)。 本课程的YOLOv3使用Darknet,在Ubuntu系统上做项目演示。包括:安装Darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 Darknet是使用C语言实现的轻型开源深度学习框架,依赖少,可移植性好,值得深入探究。 除本课程《YOLOv3目标检测实战:训练自己的数据集》外,本人推出了有关YOLOv3目标检测的系列课程,请持续关注该系列的其它课程视频,包括: 《YOLOv3目标检测实战:交通标志识别》 《YOLOv3目标检测:原理与源码解析》 《YOLOv3目标检测:网络模型改进方法》 敬请关注并选择学习!

u-boot-2015.07.tar.bz2

uboot-2015-07最新代码,喜欢的朋友请拿去

相关热词 c# 按行txt c#怎么扫条形码 c#打包html c# 实现刷新数据 c# 两个自定义控件重叠 c#浮点类型计算 c#.net 中文乱码 c# 时间排序 c# 必备书籍 c#异步网络通信
立即提问