1 Reply Latest reply on May 22, 2006 7:51 AM by ntsiii

    HTTP Request Error

    ssreddy
      Hi,

      I am working with the Flex 2 Beta 3 builder, and I am trying to execute a database application using Flex and jsp for retrieving data from database and displaying it in datagrid. The moment I click "GetData" button it is showing the following error:

      RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost:8080/connectdb.jsp" URL: http://localhost:8080/connectdb.jsp"
      at mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::faultHandler()
      at mx.rpc::Responder/fault()
      at mx.rpc::AsyncRequest/fault()
      at : irectHTTPMessageResponder/errorHandler()
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()

      The code which i used for this application is:

      users.mxml
      /*
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:HTTPService id="cn" url=" http://localhost:8080/connectdb.jsp"/>
      <mx:Button label="Get Data" click="cn.send();"/>

      <mx ataGrid id="dg2" dataProvider="{cn.lastResult.datalist}" width="700" height="350" y="26">
      <mx:columns>
      <mx:Array>
      <mx ataGridColumn dataField="rdtime" headerText="Read Time"/>
      <mx ataGridColumn dataField="tagno" headerText="Tag Number"/>
      <mx ataGridColumn dataField="readno" headerText="Number of Reads"/>
      </mx:Array>
      </mx:columns>
      </mx ataGrid>
      </mx:Application>
      */

      connectdb.jsp

      /*
      <%@ page import="java.util.*"%>
      <%
      String connectionURL = "jdbc:mysql://localhost:3306/sample?user=root;password=dpro";
      Connection connection = null;
      Statement statement = null;
      Class.forName("com.mysql.jdbc.Driver").newInstance();
      c = DriverManager.getConnection(connectionURL, "root", "dpro");
      Statement s=c.createStatement();
      ResultSet rs=s.executeQuery("select *from users");
      while(rs.next()) {
      %>
      <datalist>
      <rdtime><%=rs.getString("userid")%></rdtime>
      <tagno><%=rs.getString("username")%></tagno>
      <readno><%=rs.getString("emailaddress")%></readno>
      </datalist>
      <%
      }



      s.close();
      c.close();
      %>
      */

      Thanks & Regards,
      Sreedhar