Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/383.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/184.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 调试器将不会到达断点-而是引发异常_Java_Android_Eclipse_Debugging - Fatal编程技术网

Java 调试器将不会到达断点-而是引发异常

Java 调试器将不会到达断点-而是引发异常,java,android,eclipse,debugging,Java,Android,Eclipse,Debugging,我在这行设置了一个断点: doc = Jsoup.connect(params[0]).get(); 但由于某种原因,当我试图从这条线开始跨过时,它会跳到这条线 } catch (IOException e) { e.printStackTrace(); 并抛出一个异常(因此从未获得标题的值),我不知道为什么 有什么建议吗 package com.example.test; import java.io.IOException; import org.

我在这行设置了一个断点:

   doc = Jsoup.connect(params[0]).get();
但由于某种原因,当我试图从这条线开始跨过时,它会跳到这条线

} catch (IOException e) {
                e.printStackTrace();
并抛出一个异常(因此从未获得标题的值),我不知道为什么

有什么建议吗

package com.example.test;

import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.AsyncTask;
import android.os.Bundle;
import android.widget.TextView;

public class MainActivity extends Activity {

    TextView tv;
    String url = "http://sheriff.org/apps/arrest/results.cfm?lname=ABBOTT&fname=LAUREA";
    String tr;
    Document doc;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        tv = (TextView) findViewById(R.id.TextView01);
        new MyTask().execute(url);
    }

    private class MyTask extends AsyncTask<String, Void, String> {

        ProgressDialog prog;

        String title = "";

        @Override
        protected void onPreExecute() {
            prog = new ProgressDialog(MainActivity.this);
            prog.setMessage("Loading....");
            prog.show();
        }

        @Override
        protected String doInBackground(String... params) {
            try {
                doc = Jsoup.connect(params[0]).get();
                Element tableElement = doc.select(".datagrid").first();

                Elements tableRows = tableElement.select("tr");
                for (Element row : tableRows) {
                    Elements cells = row.select("td");
                    if (cells.size() > 0) {
                        title = cells.get(0).text() + "; "
                                + cells.get(1).text() + "; "
                                + cells.get(2).text() + "; "
                                + cells.get(3).text();
                    }
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            return title;
        }

        @Override
        protected void onPostExecute(String title) {
            super.onPostExecute(title);
            prog.dismiss();
            tv.setText(title);
        }
    }
}
package com.example.test;
导入java.io.IOException;
导入org.jsoup.jsoup;
导入org.jsoup.nodes.Document;
导入org.jsoup.nodes.Element;
导入org.jsoup.select.Elements;
导入android.app.Activity;
导入android.app.ProgressDialog;
导入android.os.AsyncTask;
导入android.os.Bundle;
导入android.widget.TextView;
公共类MainActivity扩展了活动{
文本视图电视;
字符串url=”http://sheriff.org/apps/arrest/results.cfm?lname=ABBOTT&fname=LAUREA";
字符串tr;
文件文件;
@凌驾
创建时的公共void(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv=(TextView)findViewById(R.id.TextView01);
新建MyTask().execute(url);
}
私有类MyTask扩展了AsyncTask{
进程对话程序;
字符串标题=”;
@凌驾
受保护的void onPreExecute(){
prog=新建进度对话框(MainActivity.this);
程序设置消息(“加载…”);
prog.show();
}
@凌驾
受保护的字符串doInBackground(字符串…参数){
试一试{
doc=Jsoup.connect(参数[0]).get();
Element tableElement=doc.select(“.datagrid”).first();
元素tableRows=tableElement.select(“tr”);
用于(元素行:表行){
元素单元格=行。选择(“td”);
如果(cells.size()>0){
title=cells.get(0).text()+“;”
+cells.get(1.text()+“;”
+cells.get(2.text()+“;”
+cells.get(3.text();
}
}
}捕获(IOE异常){
e、 printStackTrace();
}
返回标题;
}
@凌驾
受保护的void onPostExecute(字符串标题){
super.onPostExecute(标题);
程序解除();
tv.setText(标题);
}
}
}
日志:

10-07 15:42:21.591: I/Adreno200-EGLSUB(7981): <ConfigWindowMatch:2165>: Format RGBA_8888.
10-07 15:42:21.611: D/memalloc(7981): ion: Mapped buffer base:0x5cbaa000 size:122880 offset:0 fd:60
10-07 15:42:21.611: E/(7981): Can't open file for reading
10-07 15:42:21.611: E/(7981): Can't open file for reading
10-07 15:42:21.621: I/Adreno200-EGLSUB(7981): <ConfigWindowMatch:2165>: Format RGBA_8888.
10-07 15:42:21.641: D/memalloc(7981): ion: Mapped buffer base:0x5ccd6000 size:614400 offset:0 fd:64
10-07 15:42:21.681: D/memalloc(7981): ion: Mapped buffer base:0x5cf02000 size:122880 offset:0 fd:67
10-07 15:42:21.721: D/memalloc(7981): ion: Mapped buffer base:0x5d166000 size:614400 offset:0 fd:70
10-07 15:42:21.771: D/memalloc(7981): ion: Mapped buffer base:0x5d2fc000 size:122880 offset:0 fd:74
10-07 15:42:22.091: W/System.err(7981): java.net.UnknownHostException: Unable to resolve host "sheriff.org": No address associated with hostname
10-07 15:42:22.281: W/System.err(7981):     at java.net.InetAddress.lookupHostByName(InetAddress.java:463)
10-07 15:42:22.281: W/System.err(7981):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:279)
10-07 15:42:22.281: W/System.err(7981):     at java.net.InetAddress.getAllByName(InetAddress.java:253)
10-07 15:42:22.281: W/System.err(7981):     at libcore.net.http.HttpConnection.<init>(HttpConnection.java:71)
10-07 15:42:22.281: W/System.err(7981):     at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
10-07 15:42:22.281: W/System.err(7981):     at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:351)
10-07 15:42:22.281: W/System.err(7981):     at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:86)
10-07 15:42:22.291: W/System.err(7981):     at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
10-07 15:42:22.291: W/System.err(7981):     at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:308)
10-07 15:42:22.291: W/System.err(7981):     at libcore.net.http.HttpEngine.connect(HttpEngine.java:303)
10-07 15:42:22.291: W/System.err(7981):     at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:282)
10-07 15:42:22.291: W/System.err(7981):     at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:232)
10-07 15:42:22.291: W/System.err(7981):     at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)
10-07 15:42:22.291: W/System.err(7981):     at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:425)
10-07 15:42:22.291: W/System.err(7981):     at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:410)
10-07 15:42:22.291: W/System.err(7981):     at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:164)
10-07 15:42:22.291: W/System.err(7981):     at org.jsoup.helper.HttpConnection.get(HttpConnection.java:153)
10-07 15:42:22.291: W/System.err(7981):     at com.example.test.MainActivity$MyTask.doInBackground(MainActivity.java:46)
10-07 15:42:22.291: W/System.err(7981):     at com.example.test.MainActivity$MyTask.doInBackground(MainActivity.java:1)
10-07 15:42:22.291: W/System.err(7981):     at android.os.AsyncTask$2.call(AsyncTask.java:264)
10-07 15:42:22.291: W/System.err(7981):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10-07 15:42:22.301: W/System.err(7981):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
10-07 15:42:22.301: W/System.err(7981):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
10-07 15:42:22.301: W/System.err(7981):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
10-07 15:42:22.301: W/System.err(7981):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10-07 15:42:22.301: W/System.err(7981):     at java.lang.Thread.run(Thread.java:856)
10-07 15:42:22.301: W/System.err(7981): Caused by: libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address associated with hostname)
10-07 15:42:22.301: W/System.err(7981):     at libcore.io.Posix.getaddrinfo(Native Method)
10-07 15:42:22.301: W/System.err(7981):     at libcore.io.ForwardingOs.getaddrinfo(ForwardingOs.java:55)
10-07 15:42:22.301: W/System.err(7981):     at java.net.InetAddress.lookupHostByName(InetAddress.java:448)
10-07 15:42:22.301: W/System.err(7981):     ... 25 more
10-07 15:42:22.311: D/memalloc(7981): ion: Unmapping buffer  base:0x5cbaa000 size:122880
10-07 15:42:22.311: D/memalloc(7981): ion: Unmapping buffer  base:0x5cf02000 size:122880
10-07 15:42:22.311: D/memalloc(7981): ion: Unmapping buffer  base:0x5d2fc000 size:122880
10-07 15:42:22.311: D/memalloc(7981): ion: Mapped buffer base:0x5ca92000 size:614400 offset:0 fd:54
10-0715:42:21.591:I/Adreno200 EGLSUB(7981)::格式RGBA_8888。
10-07 15:42:21.611:D/memalloc(7981):离子:映射缓冲区基址:0x5cbaa000大小:122880偏移量:0 fd:60
10-07 15:42:21.611:E/(7981):无法打开文件进行读取
10-07 15:42:21.611:E/(7981):无法打开文件进行读取
10-07 15:42:21.621:I/Adreno200 EGLSUB(7981)::格式RGBA_8888。
10-07 15:42:21.641:D/memalloc(7981):离子:映射缓冲区基址:0x5ccd6000大小:614400偏移量:0 fd:64
10-07 15:42:21.681:D/memalloc(7981):离子:映射缓冲区基址:0x5cf02000大小:122880偏移量:0 fd:67
10-07 15:42:21.721:D/memalloc(7981):离子:映射缓冲区基址:0x5d166000大小:614400偏移量:0 fd:70
10-07 15:42:21.771:D/memalloc(7981):离子:映射缓冲区基址:0x5d2fc000大小:122880偏移量:0 fd:74
10-07 15:42:22.091:W/System.err(7981):java.net.UnknownHostException:无法解析主机“sheriff.org”:没有与主机名关联的地址
10-07 15:42:22.281:W/System.err(7981):位于java.net.InetAddress.lookupHostByName(InetAddress.java:463)
10-07 15:42:22.281:W/System.err(7981):位于java.net.InetAddress.getAllByNameImpl(InetAddress.java:279)
10-07 15:42:22.281:W/System.err(7981):位于java.net.InetAddress.getAllByName(InetAddress.java:253)
10-07 15:42:22.281:W/System.err(7981):在libcore.net.http.HttpConnection上。(HttpConnection.java:71)
10-07 15:42:22.281:W/System.err(7981):在libcore.net.http.HttpConnection上。(HttpConnection.java:50)
10-07 15:42:22.281:W/System.err(7981):位于libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:351)
10-07 15:42:22.281:W/System.err(7981):位于libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:86)
10-07 15:42:22.291:W/System.err(7981):位于libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
10-07 15:42:22.291:W/System.err(7981):位于libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:308)
10-07 15:42:22.291:W/System.err(7981):位于libcore.net.http.HttpEngine.connect(HttpEngine.java:303)
10-07 15:42:22.291:W/System.err(7981):位于libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:282)
10-07 15:42:22.291:W/System.err(7981):位于libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:232)
10-07 15:42:22.291:W/System.err(7981):位于libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)
10-07 15:42:22.291:W/System.err(7981):位于org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:425)
10-07 15:42:22.291:W/System.err(7981):位于org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:410)
10-07 15:42:22.291:W/System.err(7981):位于org.jsoup.helper.HttpConnection.execute(HttpConnection.java:164)
10-07 15:42:22.291:W/System.err(7981):位于org.jsoup.helper.HttpConnection.get(HttpConnection.java:153)
10-07 15:42:22.291:W/System.err(7981):位于com.example.test.MainActivity$MyTask.doInBackground(MainActivity.java:46)
10-07 15:42:22.291:W/System.err(7981):位于com.example.test.MainActivity$MyTask.doInBackground(MainActivity.java:1)
10-07 15:42:22.291:W/System.err(7981):在android.os.AsyncTask$2.call(AsyncTask.java:264)
10-07 15:42:22.291:W/System.err(7981):在java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10-07 15:42:22.301:W/System.err(7981):在java.util.concurrent.FutureTask.run(FutureTask.java:137)处
10-07 15:42:22.301:W/System.err(7981):在android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
10-07 15:42:22.301:W/System.err(7981):位于java.util.concurrent.ThreadPoolExecutor.runWor