Re: [javaCompiler-users] Error on reading data
Status: Beta
Brought to you by:
soapy
|
From: Marco T. <mt...@gm...> - 2006-09-14 19:23:25
|
ext...@no... wrote:
> Hello Marco,
>
> I use the 0.8 version of JavaCompiler. I tried to minimize the example
> that leads to exception. Starting "ReadLines.exe fftshorttmp2.dat 16"
> worked but "ReadLines.exe fftshorttmp2.dat 17" not any more. But after I
> copied the files from my network drive to C: the program worked without
> exceptions!! However it didn't work on C: with another .dat and the
> number of lines about 2000 (as described in my first email).
Can you send me the source code and the .dat? Please minimize the source
code. I can't help you if I can't reproduce the problem...
Marco
> One aspect
> which could probably explain the first test is that the network
> connection from my pc is slowly. But why doesn't it work from C: with
> greater line number then? I use Java 1.4 and Windows XP SP2. If I start
> the ReadLines from Eclipse (under Linux) no problems occur. It seems for
> me that Windows may read the data too slow on my pc, but then I would
> expect not "NullPointerException" but "OutOfTime" or anything else..
> Maybe you can try to start ReadLines.exe once with the attached file and
> tell me if it works fine on your system?
>
> Greetings
> Igor
>
>> -----Original Message-----
>> From: jav...@li...
>> [mailto:jav...@li...] On
>> Behalf Of ext Marco Trudel
>> Sent: Friday, 25. August 2006 17:09
>> To: A mailing list for general questions and discussions.
>> Subject: Re: [javaCompiler-users] Error on reading data
>>
>> Hello Igor
>>
>> It works for me with JavaCompiler 0.8 on Windows with a
>> textfile that has 3780 times the line "12.34 56.78".
>> I uncomented the System.out.printlns and tried with 1000, 2000
>> and 3000.
>>
>> From your stacktrace, I assume you use an older version of
>> JavaCompiler. Please update and try again. If you've the
>> latest version and it (still) fails, please provide
>> informations about your JavaCompiler settings, the OS and the textfile.
>> It would be great if you could minimize the example that leads
>> to the exception...
>>
>>
>> regards
>> Marco
>>
>>
>> ext...@no... wrote:
>>> Hello,
>>>
>>> I have a strange error using a program compiled with Java
>> Compiler. My
>>> code is quite easy and it should only read some data from a
>> text file
>>> which has two numbers on every line. The java code is:
>>>
>>> -------------------
>>> import java.io.FileReader;
>>> import java.io.BufferedReader;
>>> import java.util.StringTokenizer;
>>>
>>> public class ReadLines {
>>>
>>> public static void main(String[] args) {
>>> double [] realInput = new double[new
>>> Integer(args[1]).intValue()];
>>> double [] imaginaryInput = new double[new
>>> Integer(args[1]).intValue()];
>>>
>>> // Read the file
>>> try {
>>> FileReader fr = new FileReader(args[0]);
>>> BufferedReader bf = new BufferedReader(fr);
>>>
>>> // Read the lines
>>> for(int i=0;i<new Integer(args[1]).intValue();i++) {
>>> // (1) System.out.println("i: " + i);
>>> String value = new String();
>>> value = bf.readLine();
>>> StringTokenizer st = new
>> StringTokenizer(value);
>>> st.nextToken();
>>> // (2) System.out.println("Reading
>> the value..");
>>> realInput[i] = new
>>> Double(st.nextToken()).doubleValue();
>>> // (3) System.out.println("Value set: " +
>>> realInput[i]);
>>> imaginaryInput[i] = new
>> Double(0).doubleValue();
>>> // (4) System.out.println("Zero set..");
>>> }
>>> bf.close();
>>> fr.close();
>>> } catch(Exception e) {
>>> e.printStackTrace();
>>> }
>>> }
>>> }
>>> -------------------
>>> The program can be started with e.g. "ReadLines.exe data.txt 2000"
>>> which means "read 2000 lines from data.txt"
>>> If I start program from Eclipse, or jar, it works.
>>> If I start exe made by JavaCompiler, I receive error message
>>> "java.lang.NullPointerException <<No stacktrace
>> available>>", but only
>>> if the number of lines is above about 2000. For smaller line numbers
>>> it works fine.
>>>
>>> BUT: if I uncomment the System.out.println - lines (which
>> are numbered
>>> in code as (1)-(4)), I receive no error messages and the
>> program works
>>> perfectly for line numbers above 2000!!
>>>
>>> Can you please help me and suggest the solution to this problem?
>>>
>>> Sincerely yours,
>>> Igor Vatolkin
>>>
>>> PS I'm on vacation from the next Monday so maybe I will read the
>>> answer(s) not until the mid of September!
>>>
>>>
>>>
>> ----------------------------------------------------------------------
>>> --
>>>
>>>
>> ----------------------------------------------------------------------
>>> --- Using Tomcat but need to do more? Need to support web services,
>>> security?
>>> Get stuff done quickly with pre-integrated technology to
>> make your job
>>> easier Download IBM WebSphere Application Server v.1.0.1 based on
>>> Apache Geronimo
>>>
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=1216
>>> 42
>>>
>>>
>>>
>> ----------------------------------------------------------------------
>>> --
>>>
>>> _______________________________________________
>>> javaCompiler-users mailing list
>>> jav...@li...
>>> https://lists.sourceforge.net/lists/listinfo/javacompiler-users
>> ---------------------------------------------------------------
>> ----------
>> Using Tomcat but need to do more? Need to support web
>> services, security?
>> Get stuff done quickly with pre-integrated technology to make
>> your job easier Download IBM WebSphere Application Server
>> v.1.0.1 based on Apache Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&d
>> at=121642
>> _______________________________________________
>> javaCompiler-users mailing list
>> jav...@li...
>> https://lists.sourceforge.net/lists/listinfo/javacompiler-users
>>
>>
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> javaCompiler-users mailing list
>> jav...@li...
>> https://lists.sourceforge.net/lists/listinfo/javacompiler-users
|