抛SocketException: Socket is not connected

想些一个聊天软件 pc端服务器和客户端都写好了,但是再写安卓端时老是会出现
W/System.err: java.net.SocketException: Socket is not connected
W/System.err: at java.net.Socket.getOutputStream(Socket.java:921)
W/System.err: at server.MyMessage.send(MyMessage.java:66)
W/System.err: at com.example.linqijun.qaclient.MainPageActivity$Destory.run(MainPageActivity.java:132)
W/System.err: at java.lang.Thread.run(Thread.java:761)
我是将注册页面的socket传到mainui上用的,结果会出这个问题,网上也查不到,第一次提问,不符合规矩的地方还请大大们原谅。

代码如下

public class LoginActivity extends AppCompatActivity {

    private EditText accountEdit;

    private EditText passwordEdit;

    private Button loginB;

    private Button registerB;



    private Handler handler = new Handler(){

        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);


            Toast.makeText(LoginActivity.this,msg.obj.toString(),Toast.LENGTH_SHORT).show();
        }
    };
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getSupportActionBar().hide();
        setContentView(R.layout.activity_login);

        accountEdit = (EditText) findViewById(R.id.account);
        passwordEdit = (EditText) findViewById(R.id.password);

        registerB = (Button) findViewById(R.id.register);

        registerB.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //启动注册
                Intent intent = new Intent(LoginActivity.this,RegisterActivity.class);
                startActivity(intent);
            }
        });

        loginB = (Button) findViewById(R.id.login);

        loginB.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(accountEdit.getText().toString().equals("") || passwordEdit.getText().toString().equals("")){
                    Toast.makeText(LoginActivity.this,"can't be empty",Toast.LENGTH_SHORT).show();
                    return;
                }
                new Thread(new LoginThread()).start();
            }
        });
    }


    private class LoginThread implements Runnable{
        private MySocket so;
        @Override
        public void run() {
            try {

                so = new MySocket("10.0.2.2",6870);

                double id = Double.parseDouble(accountEdit.getText().toString());
                String password = passwordEdit.getText().toString();

                User temp = new User(id,"0");
                temp.setPassWord(password);
                MyMessage mgs = new MyMessage(temp);
                mgs.setType(1);
                mgs.send(so);

                DataInputStream dis = new DataInputStream(so.getInputStream());
                ObjectInputStream ois = new ObjectInputStream(dis);
                MyMessage res = (MyMessage)ois.readObject();

                if(res.getString().equals("success")){
                    //启动mainui activity
                    User toNext = res.getUser();
                    Intent intent = new Intent(LoginActivity.this,MainPageActivity.class);//"extre data",toNext,so);
                    Bundle bundle = new Bundle();
                    bundle.putSerializable("mgs",res);
                    bundle.putSerializable("so",so);
                    intent.putExtras(bundle);

                    startActivity(intent);
                    finish();
                }else{
                    Message a = new Message();
                    a.obj = res.getString();
                    handler.sendMessage(a);
                }
            } catch (IOException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }
            while(true){
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }


    }

}

然后是mainui的代码

public class MainPageActivity extends AppCompatActivity {

    private MyMessage mgs;

    private User u;

    private MySocket so;

    private ImageButton userHead ;

    private TextView userName ;

    private ListView friends;

    private ArrayList<User> friendList ;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getSupportActionBar().hide();
        setContentView(R.layout.activity_main_page);

        Intent intent = getIntent();
        mgs = (MyMessage) intent.getSerializableExtra("mgs");
        so = (MySocket)  intent.getSerializableExtra("so");
        u = mgs.getUser();
        friendList = u.getFriends();


        //名字
        String nameTemp = u.getName() + " ( "+ ((Double)u.getID()).toString() + " )";
        userName = (TextView) findViewById(R.id.main_userName);
        userName.setText(nameTemp);

        //头像
        userHead = (ImageButton)findViewById(R.id.main_head_photo);
        int photo = u.getPhotoType();

        switch (photo){
            case 0:
                userHead.setImageResource(R.drawable.f0);
                break;
            case 1:
                userHead.setImageResource(R.drawable.f1);
                break;
            case 2:
                userHead.setImageResource(R.drawable.f2);
                break;
            case 3:
                userHead.setImageResource(R.drawable.f3);
                break;
            case 4:
                userHead.setImageResource(R.drawable.f4);
                break;
            case 5:
                userHead.setImageResource(R.drawable.f5);
                break;
            case 6:
                userHead.setImageResource(R.drawable.f6);
                break;
            case 7:
                userHead.setImageResource(R.drawable.f7);
                break;
            case 8:
                userHead.setImageResource(R.drawable.f8);
                break;
            case 9:
                userHead.setImageResource(R.drawable.f9);
                break;
            case 10:
                userHead.setImageResource(R.drawable.f10);
                break;
            case 11:
                userHead.setImageResource(R.drawable.f11);
                break;
        }

        //好友列表

        FriendAdapter adapter = new FriendAdapter(MainPageActivity.this,R.layout.friend_list,friendList);
        friends = (ListView)findViewById(R.id.main_friendList);
        friends.setAdapter(adapter);
        friends.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                User inTalk = friendList.get(position);

            }
        });

    }

    @Override
    protected void onDestroy() {

        new Thread ( new Destory()).start();
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        super.onDestroy();
    }

    private class Destory implements Runnable{

        @Override
        public void run() {

            MyMessage exitmsg = new MyMessage(u);
            exitmsg.setType(2);
            exitmsg.send(so);

        }
    }

} 

1个回答

so = new MySocket("10.0.2.2",6870);
有没有防火墙,这个ip端口能不能连上,网络本身是否通,在一个网段么?

qq_37408845
qq_37408845 第一个activity是登陆的,在登陆时可以连得上,应该是通的吧,这个异常是在mianpage上抛的
接近 3 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
java.net.SocketException: Socket is not connected
solr集群测试 package com.taotao.search; import java.io.IOException; import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.impl.CloudSolrServer; import org.apache.solr.common.SolrInputDocument; import org.junit.Test; public class SolrCloudTest { @Test public void testAddDocument() throws Exception { // 创建一个和solr集群的连接 // 参数就是zookeeper的地址列表,使用逗号分隔 String zkHost = "192.168.248.135:2181,192.168.248.135:2182,192.168.248.135:2183"; CloudSolrServer solrServer = new CloudSolrServer(zkHost); // 设置默认的collection solrServer.setDefaultCollection("collection2"); // 创建一个文档对象 SolrInputDocument document = new SolrInputDocument(); // 向文档中添加域 document.addField("id", "test001"); document.addField("item_title", "测试商品"); // 把文档添加到索引库 solrServer.add(document); // 提交 solrServer.commit(); } @Test public void deleteDocument() throws SolrServerException, IOException { // 创建一个和solr集群的连接 // 参数就是zookeeper的地址列表,使用逗号分隔 String zkHost = "192.168.248.135:2181,192.168.248.135:2182,192.168.248.135:2183"; CloudSolrServer solrServer = new CloudSolrServer(zkHost); // 设置默认的collection solrServer.setDefaultCollection("collection2"); solrServer.deleteByQuery("*:*"); solrServer.commit(); } } 出现异常 java.net.SocketException: Socket is not connected at sun.nio.ch.Net.translateToSocketException(Net.java:123) at sun.nio.ch.Net.translateException(Net.java:157) at sun.nio.ch.Net.translateException(Net.java:163) at sun.nio.ch.SocketAdaptor.shutdownInput(SocketAdaptor.java:401) at org.apache.zookeeper.ClientCnxnSocketNIO.cleanup(ClientCnxnSocketNIO.java:200) at org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:1185) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1110) Caused by: java.nio.channels.NotYetConnectedException at sun.nio.ch.SocketChannelImpl.shutdownInput(SocketChannelImpl.java:782) at sun.nio.ch.SocketAdaptor.shutdownInput(SocketAdaptor.java:399) ... 3 more
java.net.SocketException: socket closed
返回的httpresponse 内容如下 HTTP/1.1 200 OK [Server: zhihu_nginx, Date: Sun, 29 Sep 2013 02:08:35 GMT, Content-Type: application/json, Transfer-Encoding: chunked, Connection: keep-alive, Vary: Accept-Encoding, Expires: Fri, 02 Jan 2000 00:00:00 GMT, Pragma: no-cache, Cache-Control: private, no-store, max-age=0,no-cache, must-revalidate, post-check=0, pre-check=0] 报错如下: Exception in thread "main" java.net.SocketException: socket closed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:136) at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:152) at org.apache.http.impl.io.SessionInputBufferImpl.read(SessionInputBufferImpl.java:203) at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:174) at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:137) at java.util.zip.InflaterInputStream.fill(Unknown Source) at java.util.zip.InflaterInputStream.read(Unknown Source) at java.util.zip.GZIPInputStream.read(Unknown Source) at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) at sun.nio.cs.StreamDecoder.implRead(Unknown Source) at sun.nio.cs.StreamDecoder.read(Unknown Source) at java.io.InputStreamReader.read(Unknown Source) at java.io.Reader.read(Unknown Source) at org.apache.http.util.EntityUtils.toString(EntityUtils.java:244) at org.apache.http.util.EntityUtils.toString(EntityUtils.java:288) at zhihu.ZhihuDownload.getAnswersList(ZhihuDownload.java:138) at zhihu.ZhihuDownload.main(ZhihuDownload.java:54)
osx eclipse 启动tomcat时报错:严重: Socket accept failed java.net.SocketException: Socket closed
如题,使用mac版eclipse启动 已经关闭ipv6,eclipse连接Oracle可以连通。 控制台信息如下: Init datasource error [design] can not get connection,please check the DBSet 三月 20, 2019 3:53:23 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-bio-127.0.0.1-8099"] 三月 20, 2019 3:53:24 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service bright 三月 20, 2019 3:53:24 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: UAP Server 三月 20, 2019 3:53:25 下午 org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment 信息: No global web.xml found ESA Server starting NTBService6.3 started.~~~~~~ ESA Server started: 51965 三月 20, 2019 3:54:37 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-127.0.0.1-8099"] 三月 20, 2019 3:54:38 下午 org.apache.tomcat.util.net.JIoEndpoint$Acceptor run 严重: Socket accept failed java.net.SocketException: Socket closed at java.net.PlainSocketImpl.socketAccept(Native Method) at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398) at java.net.ServerSocket.implAccept(ServerSocket.java:530) at java.net.ServerSocket.accept(ServerSocket.java:498) at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:60) at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:216) at java.lang.Thread.run(Thread.java:745) 三月 20, 2019 3:54:38 下午 org.apache.tomcat.granite.BrightTomcat start 信息: Server startup in 76169 ms 三月 20, 2019 3:54:38 下午 org.apache.coyote.AbstractProtocol pause 信息: Pausing ProtocolHandler ["http-bio-127.0.0.1-8099"] 三月 20, 2019 3:54:38 下午 org.apache.tomcat.util.net.JIoEndpoint$Acceptor run 严重: Socket accept failed java.net.SocketException: Socket closed at java.net.PlainSocketImpl.socketAccept(Native Method) at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398) at java.net.ServerSocket.implAccept(ServerSocket.java:530) at java.net.ServerSocket.accept(ServerSocket.java:498) at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:60) at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:216) at java.lang.Thread.run(Thread.java:745) 三月 20, 2019 3:54:38 下午 org.apache.catalina.core.StandardService stopInternal 信息: Stopping service bright ESA Server stopping ESA Server stopped 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [check-offline-msg-valid] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-6] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-7] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-8] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-10] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-9] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-11] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-12] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-13] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-15] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-16] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-17] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-18] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Timer-1] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-20] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-21] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-22] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-23] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-24] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-25] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-26] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-27] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-28] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-29] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-30] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-31] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-32] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-33] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-34] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-35] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-36] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-37] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-38] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-39] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-40] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [transport-check-msg-repeat-thread] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [antesearch-1-thread] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [antesearch-2-thread] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [antesearch-3-thread] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [antesearch-4-thread] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [antesearch-5-thread] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-42] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-44] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-45] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-46] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-47] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-48] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-49] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-50] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/] appears to have started a thread named [Thread-51] but has failed to stop it. This is very likely to create a memory leak. 三月 20, 2019 3:54:39 下午 org.apache.coyote.AbstractProtocol stop 信息: Stopping ProtocolHandler ["http-bio-127.0.0.1-8099"] 三月 20, 2019 3:54:39 下午 org.apache.coyote.AbstractProtocol destroy 信息: Destroying ProtocolHandler ["http-bio-127.0.0.1-8099"]
使用HttpClient时遇到的 java.net.SocketException: Socket closed异常
public static Object[] callService(String wsUrl, String method, Object... arg) { logger.info("---enter callService---"); DynamicClientFactory dcf = DynamicClientFactory.newInstance(); Client client = dcf.createClient(wsUrl); HTTPConduit conduit = (HTTPConduit) client.getConduit(); HTTPClientPolicy policy = new HTTPClientPolicy(); long timeout = 10 * 60 * 1000;// policy.setConnectionTimeout(timeout); policy.setReceiveTimeout(timeout); conduit.setClient(policy); Object[] res = null; try { res = client.invoke(method, arg); } catch (Exception e) { e.printStackTrace(); logger.error("send msg failed" + e.getMessage()); } return res ; } [2018-12-20 17:37:16,021]-INFO (SoapClient.java:36)|---enter callService--- [2018-12-20 17:37:18,042]-INFO (JAXBUtils.java:719)|Created classes: com.yggdrasill.work.flow.common.web.ObjectFactory, com.yggdrasill.work.flow.common.web.ReqMainAccount, com.yggdrasill.work.flow.common.web.ReqMainAccountResponse [2018-12-20 17:37:19,893]-WARN (LogUtils.java:371)|Interceptor for {http://web.common.flow.work.yggdrasill.com}PartenerInfoImpService#{http://web.common.flow.work.yggdrasill.com}reqMainAccount has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:519) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:449) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:352) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:304) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:310) at com.boco.mis.cxf.CXFServices.SoapClient.callService(SoapClient.java:41) at com.boco.mis.account.action.AccountAction.goSmp(AccountAction.java:135) 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 com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452) at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254) at com.boco.mss.plat.interceptor.ErrorInterceptor.intercept(ErrorInterceptor.java:25) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.boco.common.base.interceptor.LoginInterceptor.doFilter(LoginInterceptor.java:112) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662) Caused by: java.net.SocketException: SocketException invoking http://10.131.120.99:8088/workflow/ws/PartnerService: Socket Closed at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1422) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1407) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:640) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ... 84 more Caused by: java.net.SocketException: Socket Closed at java.net.PlainSocketImpl.getOption(PlainSocketImpl.java:286) at java.net.Socket.getSoTimeout(Socket.java:1032) at sun.net.www.http.HttpClient.available(HttpClient.java:356) at sun.net.www.http.HttpClient.New(HttpClient.java:273) at sun.net.www.http.HttpClient.New(HttpClient.java:310) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:987) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:923) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:841) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1031) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1359) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1301) at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:42) at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1379) ... 87 more org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:519) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:449) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:352) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:304) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:310) at com.boco.mis.cxf.CXFServices.SoapClient.callService(SoapClient.java:41) at com.boco.mis.account.action.AccountAction.goSmp(AccountAction.java:135) 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 com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452) at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254) at com.boco.mss.plat.interceptor.ErrorInterceptor.intercept(ErrorInterceptor.java:25) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.boco.common.base.interceptor.LoginInterceptor.doFilter(LoginInterceptor.java:112) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662) Caused by: java.net.SocketException: SocketException invoking http://10.131.120.99:8088/workflow/ws/PartnerService: Socket Closed at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1422) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1407) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:640) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ... 84 more Caused by: java.net.SocketException: Socket Closed at java.net.PlainSocketImpl.getOption(PlainSocketImpl.java:286) at java.net.Socket.getSoTimeout(Socket.java:1032) at sun.net.www.http.HttpClient.available(HttpClient.java:356) at sun.net.www.http.HttpClient.New(HttpClient.java:273) at sun.net.www.http.HttpClient.New(HttpClient.java:310) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:987) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:923) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:841) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1031) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1359) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1301) at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:42) at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1379) ... 87 more [2018-12-20 17:37:19,900]-ERROR (SoapClient.java:44)|send msg failedCould not send Message.
Android:Socket output is shutdown
``` SocketChannel socketChannel; ByteBuffer sendBuffer; //省略连接部分代码....但确保socketChannel已经和服务器socket连接上了 sendBuffer = ByteBuffer.wrap("hello".getBytes("UTF8")); socketChannel.write(sendBuffer); ``` 最后一行抛出异常java.net.SocketException: Socket output is shutdown
SocketException: Network is unreachable tomcat无故挂掉
linux服务器上的tomcat,最近两天日志提示这个问题。无故挂掉,请求解决。。。 INFO: Pausing Coyote HTTP/1.1 on http-8181 Jun 5, 2015 10:21:55 PM org.apache.catalina.connector.Connector pause SEVERE: Protocol handler pause failed java.net.SocketException: Network is unreachable at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:529) at java.net.Socket.connect(Socket.java:478) at java.net.Socket.<init>(Socket.java:375) at java.net.Socket.<init>(Socket.java:218) at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:486) at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:283) at org.apache.jk.server.JkMain.pause(JkMain.java:681) at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:153) at org.apache.catalina.connector.Connector.pause(Connector.java:1073) at org.apache.catalina.core.StandardService.stop(StandardService.java:563) at org.apache.catalina.core.StandardServer.stop(StandardServer.java:744) at org.apache.catalina.startup.Catalina.stop(Catalina.java:628) at org.apache.catalina.startup.Catalina$CatalinaShutdownHook.run(Catalina.java:671) Jun 5, 2015 10:21:56 PM org.apache.catalina.core.StandardService stop
java.net.SocketException: Malformed reply from SOCKS server
String proxyHost = "10.101.1.6"; int proxyPort = 80; SSLSocketFactory factory = context.getSocketFactory(); SocketAddress proxyAddr = new InetSocketAddress(proxyHost, proxyPort); Socket underlying = new Socket(new Proxy(Proxy.Type.SOCKS, proxyAddr)); underlying.connect(new InetSocketAddress(host,port)); SSLSocket socket = (SSLSocket) factory.createSocket(underlying,proxyHost,proxyPort,true); socket.setSoTimeout(10000); 运行程序报:java.net.SocketException: Malformed reply from SOCKS server
麻烦大神帮忙看下 java.net.SocketException: Connection reset 不是经常出现间歇性出现
错误代码 java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:210) at java.net.SocketInputStream.read(SocketInputStream.java:141) at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) at java.io.BufferedInputStream.read(BufferedInputStream.java:265) at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78) at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106) at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116) at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973) at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) at com.example.madame.service.JokeService.jokeGet(JokeService.java:86) at com.example.madame.controller.OneSentencePerDayController.test35(OneSentencePerDayController.java:105) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908) at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) 我的代码 public String joke() { try { // String urlTypeName = java.net.URLEncoder.encode(city1, "utf-8"); URL url = new URL("xxx"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setConnectTimeout(5000); conn.setRequestMethod("GET"); if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { //结果码=200 InputStream is = conn.getInputStream(); //内存流 , ByteArrayOutputStream boas = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int len = -1; while (is.available() != 0&&(len = is.read(buffer)) != -1) { boas.write(buffer, 0, len); } System.out.println("GET请求获取的数据:" + boas.toString()); JSONObject jsonObject = JSONObject.fromObject(boas.toString()); String reason = String.valueOf(jsonObject.get("reason")); if ("success".equals(reason)) { Object result = jsonObject.get("result"); JSONArray jsonArray = JSONArray.fromObject(result.toString()); int count = 0; String joke = ""; if (jsonArray.size() > 0) { for (int i = 0; i < jsonArray.size(); i++) { String content = String.valueOf(JSONObject.fromObject(jsonArray.get(i)).get("content")); count += 1; joke += " <tr align=\"center\" style=\"text-indent:2em;\">\n" + " <td >" + count + "." + content + "</td>\n" + " </tr>"; if (count == 3) { break; } } boas.close(); is.close(); return joke; } } } } catch (IOException e) { e.printStackTrace(); } return null; }
导出数据太多时报错: java.net.SocketException: 打破的管道
OK! 生成Excel耗费时间(毫秒)=1508 java.net.SocketException: 打破的管道 09:42:06,585 INFO DefaultMessagePublisher:87 - Creating channel 09:42:06,588 INFO DefaultMessagePublisher:90 - Created channel2 09:42:06,589 INFO rabbitmq:33 - rabbit.pageTrack|3954e144-3816-4d52-8358-1105bdf1e138|true
java.net.SocketException: Connection reset时出时不出
最近写一个很简单的TCP通信的程序,问题的详细情况是这样的:服务器端在电脑上,客户端在android手机上,android手机连上学校里的无线可以正常连接。现在我用运行着服务器端的电脑上的360免费wifi开无线,android手机连上电脑开的这个无线再进行连接的时候就会抛出java.net.SocketException: Connection reset的错误!为什么呢?难道是TCP通信对网络有限制???
java发送消息出现java.net.SocketException异常
java.net.SocketException: Software caused connection abort: socket write error这怎么解决????
Communication over HTTP. Unable to create a socket.
求助:Error Failed to call the endpoint: Error in call over HTTP: HTTP 0 null Error SOAP: Call failed: java.net.SocketException: Connection reset Error SOAP: Error occurred: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.net.SocketException: Connection reset
Caused by: java.net.SocketException: Broken pipe
![图片说明](https://img-ask.csdn.net/upload/201709/26/1506406633_173793.png) ``` Caused by: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) ~[na:1.7.0_80] at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) ~[na:1.7.0_80] at java.net.SocketOutputStream.write(SocketOutputStream.java:159) ~[na:1.7.0_80] at oracle.net.ns.DataPacket.send(DataPacket.java:199) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.net.ns.NetOutputStream.flush(NetOutputStream.java:211) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:227) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.net.ns.NetInputStream.read(NetInputStream.java:175) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.net.ns.NetInputStream.read(NetInputStream.java:100) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.net.ns.NetInputStream.read(NetInputStream.java:85) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:122) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:78) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1179) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1155) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:279) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:366) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:752) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:359) ~[ojdbc6-ojdbc6-11.1.0.7.0-jar.jar:11.2.0.1.0] ```
Linux系统引起java.net.SocketException: Broken pipe的原因?
有两台linux服务器A、B 系统版本都是 Red Hat Enterprise Linux Server release 6.0 (Santiago) JDK版本都是 1.6.0_29 在A端发布一个RMI服务,配置如下 <bean id="rmiServerHost" factory-method="setProperty" class="java.lang.System" lazy-init="false"> <constructor-arg value="java.rmi.server.hostname"/> <constructor-arg value="${rmiServerHost}"/> </bean> <bean factory-method="setProperty" class="java.lang.System" lazy-init="false"> <constructor-arg value="java.rmi.dgc.leaseValue"/> <constructor-arg value="300000"/> </bean> <bean factory-method="setProperty" class="java.lang.System" lazy-init="false"> <constructor-arg value="java.rmi.dgc.gcInterval"/> <constructor-arg value="900000"/> </bean> <!--接收数据服务(下层模块提交的数据)--> <bean id="eventProcessor" class="com.dataservice.EventProcessorImpl"/> <bean id="rmiEventProcess" class="org.springframework.remoting.rmi.RmiServiceExporter"> <property name="serviceName" value="dataservice/eventProcessor" /> <property name="service" ref="eventProcessor" /> <property name="serviceInterface" value="com.dataservice.EventProcessor" /> <property name="registryPort" value="${registryPort}"/> <property name="servicePort" value="${registryPort}"/> </bean> B端为客户端,配置如下 <!--目标模块数据处理配置--> <bean id="rmiEventProcessorClient" class="org.springframework.remoting.rmi.RmiProxyFactoryBean"> <property name="serviceUrl" value="${targetAddr}" /> <property name="serviceInterface" value="com.dataservice.EventProcessor" /> <property name="refreshStubOnConnectFailure" value="true"></property> </bean> 情况是这样的,B端在调用A端发布的服务时,间歇性的出现如下异常。 异常信息:error marshalling arguments; nested exception is: java.net.SocketException: Broken pipe java.rmi.MarshalException: error marshalling arguments; nested exception is: java.net.SocketException: Broken pipe at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:138) at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178) at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132) at $Proxy0.invoke(Unknown Source) at org.springframework.remoting.rmi.RmiClientInterceptor.doInvoke(RmiClientInterceptor.java:398) at org.springframework.remoting.rmi.RmiClientInterceptor.doInvoke(RmiClientInterceptor.java:344) at org.springframework.remoting.rmi.RmiClientInterceptor.invoke(RmiClientInterceptor.java:259) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy1.handleEvent(Unknown Source) at com.dataservice.EventSenderImpl.handleEvent(EventSenderImpl.java:220) at com.dataservice.EventSenderImpl.sendEventTask(EventSenderImpl.java:191) at com.dataservice.EventSenderImpl.access$0(EventSenderImpl.java:173) at com.dataservice.EventSenderImpl$ResSendTask.run(EventSenderImpl.java:166) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) at java.io.BufferedOutputStream.write(BufferedOutputStream.java:109) at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1847) at java.io.ObjectOutputStream$BlockDataOutputStream.writeByte(ObjectOutputStream.java:1885) at java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1546) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:333) at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:274) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133) ... 22 more 补充:相同的程序,放在linux版本相同,JDK版本相同的服务器C去调用A不会出现以上问题,B、和C的防火墙策略是相同的,防火墙关了也会有这个问题,就算把服务端部署在B,B内部调用也会间歇性出现该问题。 奔溃了,搞不定啊,求解。。。。
连接池查询hive表,查询几次后报错查询不了,重启jboss 又可以正常查询
java.sql.SQLException: org.apache.thrift.transport.TTransportException: java.net.SocketException: Connection timed out Caused by: org.apache.thrift.transport.TTransportException: java.net.SocketException: Connection timed out Caused by: java.net.SocketException: Connection timed out java.sql.SQLException: Error while cleaning up the server resources Caused by: org.apache.thrift.transport.TTransportException: java.net.SocketException: Broken pipe
java.net.SocketException: Broken pipe 。求高手解决。
org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244) at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:78) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110) at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:98) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:423) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:178) at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: ClientAbortException: java.net.SocketException: Broken pipe at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:348) at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:314) at org.apache.catalina.connector.Response.flushBuffer(Response.java:557) at org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.java:279) at org.apache.cxf.transport.http.AbstractHTTPDestination$WrappedOutputStream.close(AbstractHTTPDestination.java:660) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at org.apache.cxf.transport.http.AbstractHTTPDestination$BackChannelConduit.close(AbstractHTTPDestination.java:602) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ... 32 more Caused by: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:724) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:449) at org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:299) at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:950) at org.apache.coyote.Response.action(Response.java:186) at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:343)
报错java.net.SocketException: Software caused connection abort: recv failed 怎么办??
<div class="quote_title">写道</div> <div class="quote_div">在利用google搜索抓取结果页面的时候总抛出异常:</div> <div class="quote_div"> <span style="color: #ff0000;">java.net.SocketException: Software caused connection abort: recv failed</span><br> at java.net.SocketInputStream.socketRead0(Native Method)<br> at java.net.SocketInputStream.read(SocketInputStream.java:147)<br> at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)<br> at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)<br> at java.io.BufferedInputStream.read(BufferedInputStream.java:317)<br> at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:697)<br> at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:640)<br> at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:662)<br> at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)<br> at AttrExtractor.search(AttrExtractor.java:96)<br> at AttrExtractor.main(AttrExtractor.java:56)</div> <div class="quote_div">错误的地方说是在BufferedReader reader=new BufferedReader(new InputStreamReader(connection.getInputStream())); </div> <div class="quote_div">我是个菜鸟,不知道为什么报错,有没有大牛可以详细告诉我怎么办?!!!<img src="/images/smiles/icon_cry.gif" alt=""> </div> <div class="quote_div"><br></div> <div class="quote_div">url = new URL("http://www.google.com.hk/search?hl=en&amp;q="+ss+"&amp;ie=utf-8&amp;oe=utf-8&amp;start=0"); <br>HttpURLConnection connection=(HttpURLConnection) url.openConnection(); <br>connection.setConnectTimeout(12000); <br>connection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)"); <br>connection.setRequestProperty("Accept", " images/gif, image/x-xbitmap, image/jpeg ,*/*"); <br>connection.setRequestProperty("Accept-Encoding", "deflate"); <br>connection.setRequestProperty("Accept-Charset", "null"); <br>connection.setRequestProperty("Connection", "Keep-Alive"); <br>connection.setDoInput(true); <br>connection.setInstanceFollowRedirects(false); ///防止Server redirected too many times <br>connection.setRequestMethod("GET"); <br>connection.connect(); <br><br><span style="color: #ff0000;">BufferedReader reader=new BufferedReader(new InputStreamReader(connection.getInputStream())); <br></span>String line=null; <br>String s = ""; <br>StringBuffer sb = new StringBuffer(""); <br>//读取页面内容 <br>while ((s = reader.readLine()) != null) { <br>sb.append(s+"\r\n"); <br>}</div> <p> </p>
java.net.SocketException: Connection reset 解決方式
public class Test { public static void main(String[] args) { // TODO Auto-generated method stub Test test = new Test(); test.myRun(); } private static void myRun(){ List<Map<String, Object>> etfList= getETFName_db(); //getETFDebtInfo(etfList,"ETFBasicsINfo",1);//添加ETF基础数据(Name ,类型,基金家族) 已經添加完成 String url=null; List<Map<String, Object>> etfErrorList=new ArrayList<Map<String ,Object>>(); int count=0;// for(int i=0;i<etfList.size();i++){ int num=0; String chart=etfList.get(i).get("Ticker").toString(); //https://query1.finance.yahoo.com/v7/finance/chart/"+chart+"?range=10y&interval=1d&indicators=quote" //+ "&includeTimestamps=true&includePrePost=false&corsDomain=finance.yahoo.com" try { url="https://query1.finance.yahoo.com/v7/finance/chart/"+chart+"?range=10y&interval=1d&indicators=quote" + "&includeTimestamps=true&includePrePost=false&corsDomain=finance.yahoo.com"; while(Run(url)==0){ num++; if(num<3){ continue; }else { Map<String, Object>ETFMap =new HashMap<>(); ETFMap.put("ETF", chart); etfErrorList.add(ETFMap); break; } } } catch (Exception e) { // TODO: handle exception if(num<3){ count++; } System.out.println(chart+"出錯"); } } getETFDebtInfo(etfErrorList,"ETFBasicsINfo",2); if(etfErrorList.size()>0){ System.out.println("添加完成!共"+count+"条!"); System.out.println("失败"+etfErrorList.size()+"条!"); System.out.println("失败信息:"+etfErrorList); }else{ System.out.println("全部添加完成!共"+count+"条!"); } } @SuppressWarnings("unchecked") private static int Run(String url){ Map<String,Object> htmlMap=new HashMap<>();//1 Map<String,Object> chartMap=new HashMap<>();//2 List<Map<String, Object>> mapList=new ArrayList<Map<String,Object>>();//3 Map<String,Object>map4=new HashMap<>();//4 cUrl c=new cUrl(); String html=null; try { html=c.httpGet(url);//得到一个html 页面元素 if(html == null || html.length() < 10){ return 0; } } catch (Exception e) { // TODO: handle exception } htmlMap= (Map<String, Object>) JSONObject.parse(html);//把该页面元素转成JSON对象 存如Map for (String charkey : htmlMap.keySet()){ chartMap=(Map<String, Object>) htmlMap.get(charkey); for (String chartkey : chartMap.keySet()) {//2 if(chartMap.get(chartkey)!=null){ mapList=(List<Map<String, Object>>) chartMap.get(chartkey); map4=(Map<String, Object>) mapList.get(0).get("meta"); getETFDebtInfo(mapList,map4.get("symbol").toString(),0); } } } return 1; } private static void getETFDebtInfo(List<Map<String, Object>> getETFDebtInfoList,String ETFName,int num) { String RobomongDBName=null; switch (num) { case 0: RobomongDBName="ETFDebtInfo"; break; case 1: RobomongDBName="ETFBasicsINfo"; break; case 2: RobomongDBName="ETFErrorLog"; break; default: break; } List<Map<String, Object>> mfo = getETFDebtInfoList; Map<String, Object> kMap = new HashMap<>(); kMap.put(ETFName, mfo); String kJson = JSON.toJSONString(kMap); MGDB mgdb = new MGDB(); mgdb.DBEnd(); mgdb.SetCollection(RobomongDBName); Map<String, Object> wMap = new HashMap<>(); Map<String, Object> eMap = new HashMap<>(); eMap.put(mgdb.exists, 1); wMap.put(RobomongDBName, eMap); String wjson = JSON.toJSONString(wMap); mgdb.JsonWhere(wjson); mgdb.Delete(); mgdb.Insert(kJson); mgdb.Close(); System.out.println("添加"+RobomongDBName+"数据 ok!"); }
web开发中apk文件下载失败!
apk文件下载在电脑端下载是正常的,为什么在手机端用二维码扫描下载还是在浏览器中打开下载,都会在服务器抛出异常:java.net.SocketException: Software caused connection abort: socket write error 请各位大神列出解决方案,多谢多谢
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Vue + Spring Boot 项目实战(十四):用户认证方案与完善的访问拦截
本篇文章主要讲解 token、session 等用户认证方案的区别并分析常见误区,以及如何通过前后端的配合实现完善的访问拦截,为下一步权限控制的实现打下基础。
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入  假设现有4个人
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
SQL-小白最佳入门sql查询一
一 说明 如果是初学者,建议去网上寻找安装Mysql的文章安装,以及使用navicat连接数据库,以后的示例基本是使用mysql数据库管理系统; 二 准备前提 需要建立一张学生表,列分别是id,名称,年龄,学生信息;本示例中文章篇幅原因SQL注释略; 建表语句: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // dosho
漫话:什么是平衡(AVL)树?这应该是把AVL树讲的最好的文章了
这篇文章通过对话的形式,由浅入深带你读懂 AVL 树,看完让你保证理解 AVL 树的各种操作,如果觉得不错,别吝啬你的赞哦。 1、若它的左子树不为空,则左子树上所有的节点值都小于它的根节点值。 2、若它的右子树不为空,则右子树上所有的节点值均大于它的根节点值。 3、它的左右子树也分别可以充当为二叉查找树。 例如: 例如,我现在想要查找数值为14的节点。由于二叉查找树的特性,我们可...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
开源并不是你认为的那些事
点击上方蓝字 关注我们开源之道导读所以 ————想要理清开源是什么?先要厘清开源不是什么,名正言顺是句中国的古代成语,概念本身的理解非常之重要。大部分生物多样性的起源,...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI 算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下
《C++ Primer》学习笔记(六):C++模块设计——函数
专栏C++学习笔记 《C++ Primer》学习笔记/习题答案 总目录 https://blog.csdn.net/TeFuirnever/article/details/100700212 —————————————————————————————————————————————————————— 《C++ Primer》习题参考答案:第6章 - C++模块设计——函数 文章目录专栏C+...
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车? 某胡同口的煎饼摊一年能卖出多少个煎饼? 深圳有多少个产品经理? 一辆公交车里能装下多少个乒乓球? 一
so easy! 10行代码写个"狗屁不通"文章生成器
前几天,GitHub 有个开源项目特别火,只要输入标题就可以生成一篇长长的文章。背后实现代码一定很复杂吧,里面一定有很多高深莫测的机器学习等复杂算法不过,当我看了源代码之后这程序不到50
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的 回答 - Bravo Yeung,获得该问题下回答中得最高赞(236赞和1枚专业勋章),对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalk
相关热词 c#委托 逆变与协变 c#新建一个项目 c#获取dll文件路径 c#子窗体调用主窗体事件 c# 拷贝目录 c# 调用cef 网页填表c#源代码 c#部署端口监听项目、 c#接口中的属性使用方法 c# 昨天
立即提问