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

5 次查看(过去 30 天)
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.

回答(1 个)

Atharva
Atharva 2023-9-12
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 个评论
Vinit
Vinit 2023-9-19
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)

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB Web App Server 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by