Bonjour,
Je suis entrain d'utiliser matlab en passant par JNA. Cependant, j'ai un petit souci que je ne comprends pas trop si quelqu'un à la réponse, je suis preneur....
voila mon code
Lorsque j'appelle "demo.engOpen(null)", matlab se lance correctement, pas de souci par contre lorsque j'appelle "demo.engOpen()" puis "demo.engSetVisible()" ou lorsque j'appelle uniquement "demo.engsetVisible()" j'obtiens ce probleme....Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 public class TestJNA { public interface JNAMatlab extends Library { int engClose(); int engEvalString(String param); int engGetVisible(boolean bool); int engSetVisible(boolean bool); void engOpen(String cmd); } /** * @param args */ public static void main(String[] args) { String libName = ""; if (System.getProperty("os.name").contains("Windows")) { libName = "libeng"; } JNAMatlab demo = (JNAMatlab) Native.loadLibrary(libName, JNAMatlab.class); demo.engOpen(null); demo.engSetVisible(true); //permet de rendre le server matlab visible } }
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x031812aa, pid=3824, tid=2444 # # Java VM: Java HotSpot(TM) Client VM (11.2-b01 mixed mode, sharing windows-x86) # Problematic frame: # C [libeng.dll+0x12aa] # # An error report file with more information is saved as: # D:\Eclipse_3.4_OBEO\workspace\test.jna.matlab\hs_err_pid3824.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. #