I want to create a MATLAB WebApp which runs a .m code after pressing a button on client machine.

3 views (last 30 days)
After packaging the project file and adding the .m code file to the "files required for your app to run", I copy the .ctf file to the apps folder. Now when I click on the button on the deployed webapp, I get the following error.
2023-09-01 18:02:07 Invalid MEX-file 'C:\ProgramData\MathWorks\webapps\R2020b\USR\.appCache\mcrCache9.9\app1_d2\toolbox\Psychtoolbox\PsychBasic\MatlabWindowsFilesR2007a\Screen.mexw64': The specified module could not be found.
2023-09-01 18:02:07 Error in test (line 9)
2023-09-01 18:02:07 Error in run (line 91)
2023-09-01 18:02:07 Error in app1/TestButtonPushed (line 18)
2023-09-01 18:02:07 Error in appdesigner.internal.service.AppManagementService/tryCallback (line 368)
2023-09-01 18:02:07 Error in matlab.apps.AppBase>@(source,event)tryCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event) (line 37)
2023-09-01 18:02:07 Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 386)
2023-09-01 18:02:07 Error while evaluating Button PrivateButtonPushedFcn.

Answers (1)

Atharva
Atharva on 12 Sep 2023
Hey Vinit,
I understand that you are getting the error after you click on the button on the deployed webapp.
Please try the following trouble shooting steps-
  1. First, attempt to make sure the "mupadmex.mexw64" file is present on the system. The file path will be provided in the error message in MATLAB. Make sure your account has permissions to read and execute this file. If the file is present and you have read and execute permissions, the problem may be related to a false detection from an antivirus program. Please check your antivirus software to see if there have been any files quarantined from your MATLAB installation. If there are files from your MATLAB installation directory that have been quarantined, please restore them.
  2. If the application is working fine on the computer where the MEX-file was compiled but not on another machine, try to recompile the MEX-file on the new machine.
  3. This error can also be caused when the Visual C++ redistributable is missing and hence there is dependency issue. To identify the missing library dependencies, please download "dependency walker" from the link below http://www.mathworks.com/help/matlab/matlab_external/invalid-mex-file-error.html
Install one of the supported versions of the compiler(Microsoft Visual C++ only) on the machine which will install the redistributable automatically. Please find the list of supported compilers below.
I hope this helps!
  1 Comment
Vinit
Vinit on 19 Sep 2023
I fixed the above error by adding gstreamer paths to the environment variables. Now I'm getting the below error:
I tried doing everything mentiond on different forum posts. Dependency Walker is also not helping. The file is obviously present on the specified path.All the program versions are as required.
2023-09-19 19:26:37 Invalid MEX-file 'C:\ProgramData\MathWorks\webapps\R2020b\USR\.appCache\mcrCache9.9\testne0\Toolboxes\Psychtoolbox\PsychBasic\MatlabWindowsFilesR2007a\moglcore.mexw64': The specified module could not be found.
2023-09-19 19:26:37 Error in glGetError (line 15)
2023-09-19 19:26:37 Error in PsychImaging (line 2609)
2023-09-19 19:26:37 Error in demo_ptb (line 22)
2023-09-19 19:26:37 Error in testnew/test (line 14)
2023-09-19 19:26:37 Error in appdesigner.internal.service.AppManagementService/tryCallback (line 368)
2023-09-19 19:26:37 Error in matlab.apps.AppBase>@(source,event)tryCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event) (line 37)

Sign in to comment.

Categories

Find more on MATLAB Web App Server in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!