Java Result: -1073740791

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PreethiGowri
    New Member
    • Oct 2012
    • 126

    #31
    Well, yes i have used printstacktrace s and printlines. The code exactly terminates when i try to send the data, after packetizing it. This is the code line
    Code:
     sender.sendPacket(sendPacket);
    where sendPacket is the byte array that holds the data packet.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #32
      Did you wrap just the sendPacket call in a try/catch then?
      What does the documentation of the sendPacket method say? Did you write it or is it part of some third party A.P.I

      Comment

      • PreethiGowri
        New Member
        • Oct 2012
        • 126

        #33
        yes, i did wrap the code line within a try catch block, Its a part of third party API of this " UDPPacket sendPacket = new UDPPacket(55000 , 61000);"

        here is the code snippet of what and how i'm doing,
        Code:
        try {
                        InetAddress src = null;
                        InetAddress dest = null;
                        if (pack instanceof IPPacket) {
                            IPPacket ipp = (IPPacket) pack;
                            src = ipp.dst_ip;
                            dest = ipp.src_ip;
                        }
                        EthernetPacket etherSrc = ((EthernetPacket) pack.datalink);
                        byte[] gwmac = null;
                        gwmac = etherSrc.src_mac;
                        System.out.println("dest mac : " + gwmac);
                        JpcapSender sender = JpcapSender.openDevice(devices[index]);
                        UDPPacket sendPacket = new UDPPacket(55000, 61000);
        
                        sendPacket.setIPv4Parameter(0, false,                             
                            false, false, 0, false,
                 false, false, 0, 1010101, 100,
                 IPPacket.IPPROTO_UDP,
                                src, dest);
                        String outData = DAO.getBay(bay);
                        sendPacket.data = outData.getBytes();
                        EthernetPacket ether = new     EthernetPacket();
                        ether.frametype = EthernetPacket.ETHERTYPE_IP;
                        ether.src_mac = devices[index].mac_address;
                        ether.dst_mac = gwmac;
                        sendPacket.datalink = ether;
                        System.out.println("back to sendbay");
                        
                        try{
                        sender.sendPacket(sendPacket);
                        }
                       catch ( RuntimeException ex) {
                        ex.printStackTrace(System.out);
                        Logger.getLogger(New.class.getName()).log(Level.SEVERE, null, ex);
                    }  
                    }
                    catch (IOException ex) {
                        Logger.getLogger(New.class.getName()).log(Level.SEVERE, null, ex);
                    }

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #34
          Don't do
          Code:
          catch ( RuntimeException ex) {
                          ex.printStackTrace(System.out);
                          Logger.getLogger(New.class.getName()).log(Level.SEVERE, null, ex);
                      }
          Then check the APIs for those external classes as well to make sure you're calling them with right values.

          Just do

          Code:
          catch ( Exception ex) {
                          ex.printStackTrace();
          
                      }

          Comment

          • PreethiGowri
            New Member
            • Oct 2012
            • 126

            #35
            2 windows pop up asking,

            window 1:
            Java(TM) platform SE binary has stopped working
            Windows is collecting more information about the problem. This might take several minutes...

            Window 2:
            Do you want to send more information about the problem?
            Additional details about what went wrong can help Microsoft create a solution.

            Comment

            • kuat
              New Member
              • Feb 2014
              • 1

              #36
              The solution for me was here:
              i am new to new this working environment for android app development. above i had mention the image with mark as red on the specific part so if any know how to the given number 742 to a larger one.


              From what I understand, the problem is occurring because your max heap size is being exceeded during some processing event - be it in the development kit or while emulating. The good thing is that you can alter the max heap size in the android.ini file (it's at the very end.) I changed mine to 1024M.

              Comment

              Working...