Re: Exception message from java: MathLink connection was lost.
- To: mathgroup at smc.vnet.net
- Subject: [mg107367] Re: Exception message from java: MathLink connection was lost.
- From: David Bailey <dave at removedbailey.co.uk>
- Date: Thu, 11 Feb 2010 05:16:27 -0500 (EST)
- References: <hkp1ol$7ge$1@smc.vnet.net> <hkr40b$ahk$1@smc.vnet.net> <hktr89$krk$1@smc.vnet.net>
Andrey wrote: > Dear David Bailey, > > On Feb 9, 10:48 am, David Bailey <d... at removedbailey.co.uk> wrote: >> ... >> I use J/Link a lot, and I have not encountered this problem. The most >> likely explanation, I think, is that your Java program breaks in some >> catastrophic way or loops indefinitely. > > Yes, it can be so, but the same java code works ok on some others > systems (I knew two of them, one was winXP and other was Linux). > > It looks like there is a problem with transition of floating-point > numbers from Mathematica to java... > > I will try to transfer only strings... > >> If it is feasible, I would try >> compiling your Java code with a main method and try to test it as a >> free-standing Java program. I would also re-install the DLL files from >> the Mathematica installation disk, just in case your recompilation >> introduced any further issues. > > I've been working in such a way. > >> David Bailey http://www.dbaileyconsultancy.co.uk > > Thank You for the answer. > > Regards, > > -Andrey > A good way to explore this problem might be to call ShowJavaConsole[] to produce a console, and then add calls to System.out.println(whatever) in your Java code. Mathematica Real's correspond to Java's double's - other than that, there should be no problem transferring floating point quantities, but if you generate NaN's, there could be problems, I don't know. David Bailey http://www.dbaileyconsultancy.co.uk David Bailey http://www.dbaileyconsultancy.co.uk