By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,796 Members | 1,344 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,796 IT Pros & Developers. It's quick & easy.

Java Result: -1073740791

100+
P: 126
Can somebody explain me what does Java Result: -1073740791 mean. I had a code which used to send data that was saved in my mysql database, through ethernet using UDP protocol, everything worked fine until i sent fewer data(25 rows), when i started sending data in huge amount(100 rows) it used to display Java Result: -1073740791 and would stop the running code. Im using jpcap, winpcap and netbeans.
Mar 25 '13 #1
Share this Question
Share on Google+
35 Replies


10K+
P: 13,264
Find out where exactly that message comes from. If it's from one of the third party APIs' method then check it's specs to see when such errors could be reported.
Mar 25 '13 #2

100+
P: 126
Expand|Select|Wrap|Line Numbers
  1. while(rs.next()) {
  2.                outData.append(rs.getLong(1)).append(":")
  3. .append(rs.getString(2)).append(":").append(rs.getInt(3))
  4. .append(":").append(rs.getString(4)).append(":")
  5. .append(rs.getString(5)).append(":")
  6. .append(rs.getString(6)).append("$");
  7.            }
  8.            outData.append("#");
  9.  
/*datatypes in java and mysql

java mysql
getString varchar
getLong Bigint
getInt int, tinyint */

the error occurs after this ResultSet block, , i dont know why
Mar 25 '13 #3

10K+
P: 13,264
You can pinpoint it further by putting those rs.getXX calls in separate statements. If it's the bigint column then use try using getBigDecimal.
Mar 25 '13 #4

100+
P: 126
i tried doing it by sending 25 rows of data per 1 iteration of for loop and it works fine. But when i try to transmit whole set of data its not working, it gives the same notification(Java Result:-1073807364).

Is their any limit for ResultSet?!
Mar 25 '13 #5

10K+
P: 13,264
What do you mean by transmit? Where did you set the limit?
Mar 25 '13 #6

100+
P: 126
i transmit the accessed data from database to an other system via ethernet.

i have set the limit here -
Expand|Select|Wrap|Line Numbers
  1. String query = "select * from table_name limit "+limit1+",25";
where, limit1 holds values like 1,26,51 and so on
Mar 26 '13 #7

10K+
P: 13,264
Maybe you are keeping the database connections open for too long while doing the transfer? Select the data into a List of results and close your result set and connection then loop through your list transferring the records.
Mar 26 '13 #8

100+
P: 126
I tried that too, without any success :(
Mar 26 '13 #9

10K+
P: 13,264
You now need to create a small but full complete class with code that demonstrates the problem and post it. If the error is database side only like you are suggesting by saying it's affected by the limit then the example code shouldn't need to include the part that transfers the files.
Mar 26 '13 #10

100+
P: 126
I have attached the whole working code part causing the problem, please find the attachment.
Attached Files
File Type: txt test.txt (7.1 KB, 335 views)
Mar 26 '13 #11

10K+
P: 13,264
No don't attach all the code. Create a small class with code that demonstrates the problem and post that code here using code tags.
Mar 26 '13 #12

100+
P: 126
Expand|Select|Wrap|Line Numbers
  1. public static String getData(String table) {
  2.         Connection con = null;
  3.         StringBuilder outData = new StringBuilder();
  4.         try {
  5.             Class.forName("com.mysql.jdbc.Driver");
  6.             String conURL = "jdbc:mysql://localhost/icart";
  7.             con = DriverManager.getConnection(conURL,
  8.  "user", "pswrd");
  9.             String query = "select * from " + table + "";
  10.             System.out.println(query);
  11.             PreparedStatement st = con.prepareStatement(query);
  12.             ResultSet rs = st.executeQuery();
  13.             outData.append("%");
  14.             System.out.println("appending data");
  15.             while (rs.next()) {
  16.                 outData.append(rs.getBigDecimal(1))
  17.          .append(":").append(rs.getString(2)).append(":")
  18.          .append(rs.getInt(3)).append(":")
  19.          .append(rs.getString(4)).append(":")
  20.          .append(rs.getString(5)).append(":")
  21.          .append(rs.getString(6)).append("$");
  22.             }
  23.             outData.append("~"); //the code terminates at this line
  24.             rs.close();
  25.  
  26.             con.close();
  27.             System.out.println(outData);
  28.         } catch (ClassNotFoundException ex) {
  29.             Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
  30.         } catch (SQLException | RuntimeException e) {
  31.             JOptionPane.showMessageDialog(null, e);
  32.         }
  33.         return outData.toString();
  34.     }
Here it is
Mar 26 '13 #13

10K+
P: 13,264
Don't just do
Expand|Select|Wrap|Line Numbers
  1. } catch (SQLException | RuntimeException e) {
  2.             JOptionPane.showMessageDialog(null, e);
  3.         }
  4.  
when debugging. Print out the whole stacktrace with e.printStackTrace();
Mar 26 '13 #14

100+
P: 126
i see some errors in log file after printing the StackTraces, i don't understand what they actually mean, kindly help me.

Here i attach my IDELog file
Attached Files
File Type: txt IDELog.txt (56.3 KB, 330 views)
Mar 26 '13 #15

10K+
P: 13,264
Post the error messages here, don't attach files.
Mar 26 '13 #16

100+
P: 126
WARNING [org.netbeans.modules.java.source.tasklist.Incorrec tErrorBadges]: Incorrect error badges detected, file=C:\Users\Office User\AppData\Local\NetBeans\Cache\7.2\index\s15\ja va\14\gensrc\jpcap\packet\Packet.java.
WARNING [org.netbeans.modules.java.source.tasklist.Incorrec tErrorBadges]: The file is not on its own source classpath, ignoring.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 93 ms.
WARNING [org.netbeans.modules.java.source.tasklist.Incorrec tErrorBadges]: Incorrect error badges detected, file=C:\Users\Office User\AppData\Local\NetBeans\Cache\7.2\index\s15\ja va\14\gensrc\jpcap\JpcapSender.java.
WARNING [org.netbeans.modules.java.source.tasklist.Incorrec tErrorBadges]: The file is not on its own source classpath, ignoring.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 81 ms.
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 61 ms.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 91 ms.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 81 ms.
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate enclosed element: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate enclosed element: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate enclosed element: <error>
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 69 ms.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 80 ms.
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.java.navigation.ElementScanni ngTask]: Duplicate top level class: <error>
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 77 ms.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 104 ms.
WARNING [org.netbeans.modules.java.source.tasklist.Incorrec tErrorBadges]: Incorrect error badges detected, file=C:\Users\Office User\AppData\Local\NetBeans\Cache\7.2\index\s15\ja va\14\gensrc\jpcap\JpcapSender.java.
WARNING [org.netbeans.modules.java.source.tasklist.Incorrec tErrorBadges]: The file is not on its own source classpath, ignoring.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 66 ms.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 89 ms.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 65 ms.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 100 ms.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 86 ms.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 104 ms.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccesso r$CancelableTaskWrapper ignored cancel for 68 ms.
Mar 26 '13 #17

10K+
P: 13,264
Most of those are info messages from your IDE that have nothing to do with your application. Put the e.printStackTrace() in the catch blocks and check your application's console to see what the full error message is from your application.
Mar 26 '13 #18

100+
P: 126
i get no error in my console. This is my output

"$295:CRM software:0:no offer:19890:560 $296:charting software:0:no offer:19978:120 $297:web browsers:0:no offer:20065:120 $298:smart card software:0:no offer:20153:120 $299:content management software:0:no offer:20241:120 $300:infrastructure virtua:0:no offer:20329:120 $551:digital cameras:1:upto 5% off:42264:152 $552:hand-held camcorders:1:upto 5% off:42351:152 $553:webcams:1:upto 5% off:42439:152 $554:binoculars:1:upto 5% off:42527:152 $555:straps:1:upto 5% off:42615:152 $556:action sports cameras:1:upto 5% off:42702:152 $557:telescopes:1:upto 5% off:42790:152 $558:telescope accessories:1:upto 5% off:42878:152 $559:film cameras:1:upto 5% off:42966:152 $560:rifle scopes:1:upto 5% off:43053:152 $561:spotting scopes:1:upto 5% off:43141:152 $562:microscopes:1:upto 5% off:43229:152 $563:microscope accessories:1:upto 5% off:43317:152 $564:rangefinders:1:upto 5% off:43404:152 $565:monoculars:0:no offer:43492:152 $566:eyepieces:0:no offer:43580:152 $567:eyepice accessories:0:no offer:43667:152 $568:document cameras:0:no offer:43755:152 $569:optics cases:0:no offer:43843:152 $570:opera glasses:1:buy 2 get 1 free:43931:152 $571:drive recorders:1:buy 2 get 1 free:44018:152 $572:instant print cameras:1:buy 2 get 1 free:44106:152 $573:folders:1:buy 2 get 1 free:44194:152 $574:folders:0:no offer:44282:152 $575:picture frames:0:no offer:44369:152 $~
Java Result: -1073740791
BUILD SUCCESSFUL (total time: 55 seconds) "
Mar 26 '13 #19

10K+
P: 13,264
Why is your program printing out all that data? Anyway you need to pinpoint the source of the problem (if any) perhaps by running it outside of Netbeans because right now you seem to be confused about what is Netbeans' own logging and what your application's logging is.
Mar 26 '13 #20

100+
P: 126
i got the below lines printed from the printstacktrace -

java.lang.NullPointerException
at dao.DAO.getBay(DAO.java:79)
at pkgnew.New.sendBayNo(New.java:252)
at pkgnew.New.receivePack(New.java:322)
at pkgnew.New.main(New.java:495)

where line 495 as:
Expand|Select|Wrap|Line Numbers
  1.  j.receivePack();
how do i avoid null point exception here?!
Mar 26 '13 #21

10K+
P: 13,264
So what code is at DAO.java:79? Something there is null.
Mar 26 '13 #22

100+
P: 126
Expand|Select|Wrap|Line Numbers
  1.  String query = "select * from table_name";
  2.             System.out.println(query);
  3.             PreparedStatement st = con.prepareStatement(query);
line 79 is preparedStatement
Mar 26 '13 #23

10K+
P: 13,264
So con is null at that point then.
Mar 26 '13 #24

100+
P: 126
I resolved the null Pointer exception. now again i get "Java Result: -1073740791" and the code terminates:(
After googling alot i learnt that, The number "-1073740791" is an exit code, which indicate a bug in the executed software that causes stack overflow leading to abnormal termination of the software.

If this is the actual case, how do i avoid stack buffer overflow??
Mar 27 '13 #25

10K+
P: 13,264
Again, add logging around the code and e.printStackTrace statements to pin point the exact line that is causing it and full error message.
Mar 27 '13 #26

100+
P: 126
i have used this below block, still does not show up any warning or error at any line

Expand|Select|Wrap|Line Numbers
  1. catch (UnknownHostException ex) {
  2.             Logger.getLogger(New.class.getName()).log(Level.SEVERE, null, ex);
  3.         } catch (IOException|RuntimeException e) {
  4.             e.printStackTrace();
  5.         }
Mar 27 '13 #27

10K+
P: 13,264
1.) How do you know that is the line that is reporting the error?
2.) Add e.printStackTrace() before Logger.getLogger(New.class.getName()).log(Level.SE VERE, null, ex); during this debugging (you can remove it after you identify the source of your problem)
Mar 27 '13 #28

100+
P: 126
Not Working:(:( I have completely lost with this, i'm going nuts tracking the reason behind this abnormal termination of the code:(
Mar 27 '13 #29

10K+
P: 13,264
You still haven't said whether you have pinpointed the source of the error using printlines and printstacktraces yet. You need to know the exact line that is throwing the error first.
Mar 27 '13 #30

100+
P: 126
Well, yes i have used printstacktraces and printlines. The code exactly terminates when i try to send the data, after packetizing it. This is the code line
Expand|Select|Wrap|Line Numbers
  1.  sender.sendPacket(sendPacket);
where sendPacket is the byte array that holds the data packet.
Mar 27 '13 #31

10K+
P: 13,264
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
Mar 27 '13 #32

100+
P: 126
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,
Expand|Select|Wrap|Line Numbers
  1. try {
  2.                 InetAddress src = null;
  3.                 InetAddress dest = null;
  4.                 if (pack instanceof IPPacket) {
  5.                     IPPacket ipp = (IPPacket) pack;
  6.                     src = ipp.dst_ip;
  7.                     dest = ipp.src_ip;
  8.                 }
  9.                 EthernetPacket etherSrc = ((EthernetPacket) pack.datalink);
  10.                 byte[] gwmac = null;
  11.                 gwmac = etherSrc.src_mac;
  12.                 System.out.println("dest mac : " + gwmac);
  13.                 JpcapSender sender = JpcapSender.openDevice(devices[index]);
  14.                 UDPPacket sendPacket = new UDPPacket(55000, 61000);
  15.  
  16.                 sendPacket.setIPv4Parameter(0, false,                             
  17.                     false, false, 0, false,
  18.          false, false, 0, 1010101, 100,
  19.          IPPacket.IPPROTO_UDP,
  20.                         src, dest);
  21.                 String outData = DAO.getBay(bay);
  22.                 sendPacket.data = outData.getBytes();
  23.                 EthernetPacket ether = new     EthernetPacket();
  24.                 ether.frametype = EthernetPacket.ETHERTYPE_IP;
  25.                 ether.src_mac = devices[index].mac_address;
  26.                 ether.dst_mac = gwmac;
  27.                 sendPacket.datalink = ether;
  28.                 System.out.println("back to sendbay");
  29.  
  30.                 try{
  31.                 sender.sendPacket(sendPacket);
  32.                 }
  33.                catch ( RuntimeException ex) {
  34.                 ex.printStackTrace(System.out);
  35.                 Logger.getLogger(New.class.getName()).log(Level.SEVERE, null, ex);
  36.             }  
  37.             }
  38.             catch (IOException ex) {
  39.                 Logger.getLogger(New.class.getName()).log(Level.SEVERE, null, ex);
  40.             }   
Mar 28 '13 #33

10K+
P: 13,264
Don't do
Expand|Select|Wrap|Line Numbers
  1. catch ( RuntimeException ex) {
  2.                 ex.printStackTrace(System.out);
  3.                 Logger.getLogger(New.class.getName()).log(Level.SEVERE, null, ex);
  4.             }  
Then check the APIs for those external classes as well to make sure you're calling them with right values.

Just do

Expand|Select|Wrap|Line Numbers
  1. catch ( Exception ex) {
  2.                 ex.printStackTrace();
  3.  
  4.             }
Mar 28 '13 #34

100+
P: 126
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.
Mar 28 '13 #35

P: 1
The solution for me was here:
http://stackoverflow.com/questions/1...dt-environment

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.
Feb 11 '14 #36

Post your reply

Sign in to post your reply or Sign up for a free account.