测试报错,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)
    求大神指点

2个回答

说明端口没有启动,确认一下 http://localhost:8001 应用是否已经启动。

newclassgood
天过无痕 我没有运行主方法,所以报地错,这个我有点智障了,感谢
7 个月之前 回复

第三方服务没有开启吧,或者对方防火墙未关闭

newclassgood
天过无痕 我没有运行主方法,所以报地错,这个我有点智障了,感谢
7 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
基于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

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: 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(); } } ```

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

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

关于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 请问是哪个环节需要改进?公司明确了就是要通过网址调用,求各位大神解救啊

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; } }

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

ejb客户端通过JNDI访问服务器报错 Connection refused: connect

ejb客户端通过JNDI访问服务器报错 javax.naming.ServiceUnavailableException: Connection refused: connect 客户端代码为: ``` InitialContext ctx = new InitialContext(); FirstEjb ejb = (FirstEjb)ctx.lookup("FirstEjbBean/remote"); String s = ejb.saySomething("HelloWorld"); System.out.println(s); ``` 具体错误为:![图片说明](https://img-ask.csdn.net/upload/201602/27/1456579823_883123.gif)

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) ```

(已解决)紧急求助!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 ```

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)

solrcloud报错connection refused ,求大神指导我!!

![图片说明](https://img-ask.csdn.net/upload/201503/17/1426585882_215591.png) 这是什么原因呢,急求,我qq:461726521

Spring LDAP在链接AD域的时候报Connection refused: connect]]

我在用Spring Ldap链接AD域的时候报PartialResultException [Root exception is (我尝试着随便写个密码,链接的时候会提示密码错误) (用java自带的可以链接成功) 我从看文档说可以抑制,结果抑制了还是不行,有没有朋友知道这是为什么?求告知 这是我xml的配置文件 ![图片说明](https://img-ask.csdn.net/upload/201709/12/1505207141_514391.jpg) ![图片说明](https://img-ask.csdn.net/upload/201709/12/1505207187_983442.jpg) ![图片说明](https://img-ask.csdn.net/upload/201709/12/1505207196_902440.jpg) 这是报的异常 org.springframework.ldap.PartialResultException: nested exception is javax.naming.PartialResultException [Root exception is javax.naming.CommunicationException: wzax.com:389 [Root exception is java.net.ConnectException: Connection refused: connect]] at org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:216) at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:385) at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:309) at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:642) at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:578) at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:1617) at com.wzax.springldap.MyPersonRepoImpl.getPassword(MyPersonRepoImpl.java:316) at com.wzax.springldap.PersonRepoTest.testPassword(PersonRepoTest.java:20) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.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.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94) 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.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: javax.naming.PartialResultException [Root exception is javax.naming.CommunicationException: wzax.com:389 [Root exception is java.net.ConnectException: Connection refused: connect]] at com.sun.jndi.ldap.AbstractLdapNamingEnumeration.hasMoreImpl(AbstractLdapNamingEnumeration.java:237) at com.sun.jndi.ldap.AbstractLdapNamingEnumeration.hasMore(AbstractLdapNamingEnumeration.java:189) at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:365) ... 35 more Caused by: javax.naming.CommunicationException: wzax.com:389 [Root exception is java.net.ConnectException: Connection refused: connect] at com.sun.jndi.ldap.LdapReferralContext.<init>(LdapReferralContext.java:96) at com.sun.jndi.ldap.LdapReferralException.getReferralContext(LdapReferralException.java:150) at com.sun.jndi.ldap.AbstractLdapNamingEnumeration.hasMoreReferrals(AbstractLdapNamingEnumeration.java:325) at com.sun.jndi.ldap.AbstractLdapNamingEnumeration.hasMoreImpl(AbstractLdapNamingEnumeration.java:227) ... 37 more 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 java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:211) at com.sun.jndi.ldap.Connection.createSocket(Connection.java:363) at com.sun.jndi.ldap.Connection.<init>(Connection.java:203) at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:137) at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1614) at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2746) at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:319) at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:192) at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:151) at com.sun.jndi.url.ldap.ldapURLContextFactory.getObjectInstance(ldapURLContextFactory.java:52) at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:601) at javax.naming.spi.NamingManager.processURL(NamingManager.java:381) at javax.naming.spi.NamingManager.processURLAddrs(NamingManager.java:361) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:333) at com.sun.jndi.ldap.LdapReferralContext.<init>(LdapReferralContext.java:119) ... 40 more

连接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

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呢?

微服务 rest 调用 问题。。求解决

使用RestTemplate调用服务,报错 1. java.net.UnknownHostException 2. java.net.ConnectException: Connection refused: connect 我的调用方式 @Autowired private RestTemplate rest; rest.getForObject("http://eurkaF1/getData",List.class); 3QQQQQ

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 什么原因啊

office web apps部署后预览测试报错【net::ERR_CONNECTION_RESET 200】

# 部署了office web apps后 # # 预览 …/op/view.aspx成功 # # ![图片说明](https://img-ask.csdn.net/upload/201902/26/1551173356_455043.png) # # # 预览 …/hosting/discovery成功 # # # ![图片说明](https://img-ask.csdn.net/upload/201902/26/1551173484_869546.png) # # # 但是一旦在 view.aspx页面中输入文件地址,CreateLink创建链接之后,点击'Test the link'在新标签页打开创建的文件预览链接,一直显示 We‘re fetching your file…… # # # 浏览器控制台报错net::ERR_CONNECTION_RESET 200 连接被重置 # # # ![图片说明](https://img-ask.csdn.net/upload/201902/26/1551173665_636239.png) # # # 这到底是为什么吗? # # 在网上搜了很多相关解决方法,但是有提到这种问题的,没有找到一个解决的说明,麻烦帮忙看一下是什么原因造成的吧

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>

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

为什么本科以上学历的人只占中国人口的5%,但感觉遍地都是大学生?

中国大学生占总人口不到5% 2017年,中国整体的本科率仅有5.9%;如果算上研究生,这一比例可以进一步上升到6.5% 为什么在国家统计局推出的这份年鉴中,学历的最高一阶就是到研究生,而没有进一步再统计博士生的数量的。 原因其实并不难理解,相比全国和各省整体人口体量,博士生的占比非常之低,属于绝对意义上的小概率样本。 这一点,我们从上表中的各省研究生占比情况也可以看出端倪。除北京、天津、上海三...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

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

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

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

记录下入职中软一个月(外包华为)

我在年前从上一家公司离职,没想到过年期间疫情爆发,我也被困在家里,在家呆着的日子让人很焦躁,于是我疯狂的投简历,看面试题,希望可以进大公司去看看。 我也有幸面试了我觉得还挺大的公司的(虽然不是bat之类的大厂,但是作为一名二本计算机专业刚毕业的大学生bat那些大厂我连投简历的勇气都没有),最后选择了中软,我知道这是一家外包公司,待遇各方面甚至不如我的上一家公司,但是对我而言这可是外包华为,能...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

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

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

6年开发经验女程序员,面试京东Java岗要求薪资28K

写在开头: 上周面试了一位女程序员,上午10::30来我们部门面试,2B哥接待了她.来看看她的简历: 个人简历 个人技能: ● 熟悉spring mvc 、spring、mybatis 等框架 ● 熟悉 redis 、rocketmq、dubbo、zookeeper、netty 、nginx、tomcat、mysql。 ● 阅读过juc 中的线程池、锁的源...

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

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

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

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

立即提问
相关内容推荐