1

ログに記録された「JDWP エラー: 21」について別の質問があります: Unexpected JDWP Error 21

以下のコードを使用して、サーブレットから収集した XML を解析して J2ME MIDlet に変換しようとしています。これまでのところ成功していませんが、HttpConnection の JDWP エラーが原因で、InputStream が XML で満たされ、Document 内のすべてが一度解析されると、null になると思います。

JDWPエラーについて誰かが考えていますか?また、そのコードは機能するはずですか?

MIDlet では JSR-172 API を使用していますjavax.xml.parsers.*

if(d==form1 && c==okCommand)
    {
        // Display Webpage
         webPage = new TextBox(txtField.getString(),
                "",
                100000,
                TextField.ANY
                );
        Display.getDisplay(this).setCurrent(webPage);

        try 
        {
            HttpConnection conn = (HttpConnection)Connector.open("http://localhost:8080/Blogging_Home/Interface?Page=Bloggers&Action=VIEW&Type=XML");
            conn.setRequestMethod(HttpConnection.GET);
            int rc = conn.getResponseCode();
            getConnectionInformation(conn, webPage);
            webPage.setString(webPage.getString() + "Starting....");
            String methodString = getStringFromURL("");
            if (rc == HttpConnection.HTTP_OK) 
            {
                    InputStream is = null;
                    is = createInputStream(methodString);            
                    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();  
                    DocumentBuilder builder;  
                    Document document;
                    try  
                    {  
                        builder = factory.newDocumentBuilder(); 
                        document = builder.parse(is);  
                    } catch (Exception e) {  
                        e.printStackTrace();  
                    }
            }
            else 
            {
                    webPage.setString(webPage.getString() + "ERROR:" + rc);
            }

        }
        catch(Exception ex)
        {
            // Handle here
            webPage.setString("Error" + ex.toString());
        }
4

0 に答える 0