Matlab compiled jar cannot run with task scheduler but can run manually
Show older comments
Hello everyone,
I have some matlab-code, which included as jar-File (created with matlab compiler sdk) in a java-application. If I start my java-application manually using a bat-file everything works. But if I start the same bat-file using the windows task scheduler the matlab-code cannot be executed. (The other parts of the java-application work in both cases)
Stacktrace:
... Matlab M-code Stack Trace ...
com.mathworks.toolbox.javabuilder.MWException: An error occurred while initializing the component.
Could not access the MATLAB Runtime component cache. Details: Some error has occurred in the file: b:\matlab\standalone\mclmcr\mcr_cache\mclcomponentcache.cpp, at line: 250.
The error message is:
Failed to completely extract component!
at com.mathworks.toolbox.javabuilder.internal.MWMCR.mclInitializeComponentInstance(Native Method)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.access$700(MWMCR.java:31)
at com.mathworks.toolbox.javabuilder.internal.MWMCR$6.mclInitializeComponentInstance(MWMCR.java:888)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.mathworks.toolbox.javabuilder.internal.MWMCR$5.invoke(MWMCR.java:770)
at com.sun.proxy.$Proxy79.mclInitializeComponentInstance(Unknown Source)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.newInstance(MWMCR.java:632)
I also don't understand why it's accessing drive B. The file and the matlab runtime installation is located on drive C.
Things I already checked:
- Path variable of the matlab runtine installation
- Check the cache files (https://de.mathworks.com/matlabcentral/answers/33638-could-not-access-the-mcr-component-cache-error)
- Setting an env-variable MCR_ROOT_CACHE to a temp-folder (didn't found the link again)
- I tried to compile with -C but it fails:Packaging...Creating the bundle...Failed to create the install bundle[...]\for_testing\de.ctf (The system cannot find the file specified)
Setup:
- Matlab 2016b
- Java 8
- win server 2012 (64bit)
Would be great, if someone give me a hint. Thanks, Thomas
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!