Error in connecting AMPL to MATLAB

22 views
Skip to first unread message

mahraz amini

unread,
Jul 23, 2017, 6:01:57 PM7/23/17
to AMPL Modeling Language


Hi AMPL group

I already connected the AMPL to MATLAB 2016 and MATLAB 2014 and now I am trying to do the same on MATLAB 2012 but I am facing some errors.

When I write setupOnce, the output is same as before. but after that when I write AMPL , I get this error :

Java exception occurred:
java.lang.NoSuchMethodError: com.sun.jna.IntegerType.<init>(IJZ)V

at com.sun.jna.platform.win32.WinDef$DWORD.<init>(WinDef.java:102)

at com.sun.jna.platform.win32.WinDef$DWORD.<init>(WinDef.java:92)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at
    com.sun.jna.NativeMappedConverter.defaultValue(NativeMappedConverter.java:47)

at com.sun.jna.NativeMappedConverter.<init>(NativeMappedConverter.java:41)

at
    com.sun.jna.NativeMappedConverter.getInstance(NativeMappedConverter.java:29)

at com.sun.jna.Structure.calculateSize(Structure.java:803)

at com.sun.jna.Structure.allocateMemory(Structure.java:287)

at com.sun.jna.Structure.<init>(Structure.java:177)

at com.sun.jna.Structure.<init>(Structure.java:167)

at com.sun.jna.Structure.<init>(Structure.java:163)

at com.sun.jna.Structure.<init>(Structure.java:154)

at
    com.sun.jna.platform.win32.WinBase$SECURITY_ATTRIBUTES.<init>(WinBase.java:593)
    
at com.ampl.AMPLSigSend.initializeSWPipe(AMPLSigSend.java:41)

at com.ampl.WindowsAMPLProcess.<init>(AMPLProcess.java:744)

at com.ampl.AMPLProcess.create(AMPLProcess.java:396)

at com.ampl.Engine.<init>(Engine.java:49)

at com.ampl.AMPL.<init>(AMPL.java:190)

at com.ampl.AMPL.<init>(AMPL.java:158)


Error in AMPL (line 41)
                    a = com.ampl.AMPL();


When I write setupOnce, the output is same as before. but after that when I write AMPL , I get this error :

Can you please help me understand what is the problem and how I can fix it?

My MATLAB is 32 bit, my windows is 64 bit , and I got same error while trying both 32 bits and 64 bits AMPL.

Thanks,

Mahraz

Filipe Brandão

unread,
Jul 24, 2017, 8:41:08 AM7/24/17
to AMPL Modeling Language
Hi Mahraz,

The MATLAB API was implemented on top of the Java API which requires Java 1.7. Are you using an older Java version?

Best regards,
Filipe
Reply all
Reply to author
Forward
0 new messages