cannot perform local call Matlab function JAR package, easy to appear problems
A check your environment variable Path:
%java_home%\bin;%java_home%\jre\bin;
F:\Program Files\matlab\matlab Compiler Runtime\v717\runtime\win32;
F:\Program Files\matlab\r2012a\runtime\win32; F:\ProgramFiles\MATLAB\R2012a\bin;
This is 2 programs that need to be configured with environment variables.
b Matlab and MCR are installed, only one installation is not enough, because it is necessary to write a function to generate the jar, only the jar will need the runtime environment.
================================================================
Web called Matlab problem Analysis and resolution:
Deploying Web calls matlab is prone to many problems, the author encountered a lot of problems, because some error messages are not saved, here can not describe all the errors, but will all the configuration information to join.
1, unsupported major.minorversion 51.0
JDK problem, in the Windows test environment, the author's Eclipse project Environment is 1.6, set up the computer system JDK is also 1.6. However, the runtime generates an error.
Solve:
to understand, the problem with this error refers to the low version of the The JVM virtual machine cannot load a high version of the compiled class file,51.0 version number refers to JDK1.7, the author project Environment and the machine JDK are 1.6 , Why this problem, after troubleshooting only tomcat problem, in Eclipse found the use of Eclipse configuration tomcat content, found that Tomcat referred to as 1.7 's jdk, the error disappears after the replacement. Therefore, please keep in mind that all links should be as consistent as possible.
2. Theapache Tomcat Native Library which allows optimal performance in productionenvironments is not found on the Java.lib Rary.path
Tomcat needs support issues, here is a support file tcnative-1.dll, please go to http://tomcat.heanet.ie/native/, Download a newer version of the file in binaries/win32 ( or Win64), and then place it in your %java_home%/bin folder. After placement, re-package the deployment Tomcatand start.
3, an incompatible version 1.1.14 of the APR based Apache Tomcat Native Library are installed, while Tomcat requires version 1.1.30
This is followed by the 2 question, after putting the file, and because of the version of the problem prompt error. This is because the downloaded tcnative-1.dll is inconsistent with the desired version and therefore needs to be corrected. We will download the version into a copy into the%java_home%/bin , and put a copy into the%catalina_home%/bin , if the old version, directly overwrite or with the older version of the main, replace before 2 Directory, we only keep it consistent.
4, org.apache.jasper.JasperException: javax.servlet.servletexception: java.lang.unsatisfiedlinkerror: failed to findthe library libmwmclmcrrt.so.7.17, required by matlab builder ja, Onjava.library.path.this library is typically installed alongwith matlab or the MCR, its absence may indicate an issue with Thatinstallation or the current path configuration. the mcr version that this component is tryingto use is: 7.17.
according to the following hint of the content, probably said I installed the matlab or MCR configuration problems. Then we should focus on the environment configuration, the author on both Windows and Linux encountered this problem, with 2 kinds of solutions.
Windows:
Find Environment Variables Path, make sure that the JDK, MCR,Matlab are configured in the order before and after, follow the JDK, MCR, Matlab in this order, for example:%java_home%\bin;%java_home%\jre\bin;
F:\Program Files\matlab\matlab Compilerruntime\v714\runtime\win32;
F:\Program Files\matlab\r2012a\runtime\win32; F:\ProgramFiles\MATLAB\R2012a\bin
Linux:
Please locate etc/profile, edit the file, and join the Path configuration.
as the MCR path is:mcr_home=/sur/local/matlab/matlab Compiler Runtime
Exportpath= $PATH: $MCR _home/v717/runtime/glnx86
also, please check the installation Ld_library_path and xapplresdir when MCR is set .
Export ld_library_path= $LD _library_path: $MCR _home/v717/runtime/glnx86: $MCR _home/v717/sys/os/ Glnx86: $MCR _home/v717/sys/java/jre/glnx86/jre/lib/i386/native_threads: $MCR _home/v717/sys/java/jre/ Glnx86/jre/lib/i386/server: $MCR _home/v717/sys/java/jre/glnx86/jre/lib/i386
exportxapplresdir= $MCR _home/v717/x11/app-defaults
The content of the configuration is different depending on the number of system bits per person, the red part may change, pay attention to view.
5, exception in thread "main" java.lang.unsatisfiedlinkerror:failed to find the library mclmcrrt7_17.dll, required by matlab builder ja, onjava.library.path. thislibrary is Typically installed along with matlab or the mcr, its absence mayindicate an issue with that installation or the current Path configuration. the mcr version that this component is tryingto use is: 7.17.
This problem is similar to 4, but note that because the library file Mclmcrrt7_17.dll is not found , the file is in both Matlab and MCR , in the file home directory Runtim/win32 (Win64) , the file with MCR is preferred. Copy it to C:/windows/system32 , and if it is a system, it should be copied to C:\Windows\SysWOW64
6, the main environmental issues can be resolved in the above, other issues, such as
Javax.servlet.ServletException:java.lang.NoClassDefoundError:Could not initialize Classcom.mathworks.toolbox .....
These objects cannot be found, note that objects not found by these hints are introduced into the JSP page, make it easy to call yourself. Of course, there is the ability to use the framework, to avoid such problems, directly through the framework to get the return value.
This article from "Around" blog, declined reprint!
Solutions to problems that may exist in installing and invoking MATLAB programs