Create a Java Client with mps error 404

When I look at the official document - "MATLAB® Production Server ™ client using the Java® client API", when I implement this code, eclipse told me that there is a mistake, but I have nothing to do with this error;
This is a link to the document:https://cn.mathworks.com/help/mps/qs/create-a-java-application-that-calls-the-deployed-function.html
The error code is "com.mathworks.mps.client.MWHttpException: Failed HTTP request; Response Status: 404, Response Message: ComponentNotFound Component not found. (request id=0:1:0)"
and my operating system is openSUSE 42.2, jdk version is 1.7,MATLAB Production Server version is R2016b

답변 (3개)

Kojiro Saito
Kojiro Saito 2017년 5월 29일

0 개 추천

ComponentNotFound means the specified URL (<http://localhost:9910/addmatrix>) does not match the MPS component address.
Could you confirm your deployed addmatrix CTF is starting on MPS with port number 9910?
aaaa
aaaa 2018년 2월 15일

0 개 추천

I have the same problem even in MPS

댓글 수: 3

Kojiro Saito
Kojiro Saito 2018년 2월 15일
Please confirm you CTF file name it the same as the archive name in URL.
For example, if your CTF name is addmatrix.ctf,
The URL to access from MPS client (client.createProxy) should be
aaaa
aaaa 2018년 2월 19일
I did tha same but still not working.
Could you confirm whether you can access MPS by curl command?
If you're using Windows machine, you need to download curl exe from here and please do the following in Command Prompt.
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST http://localhost:9910/addmatrix/addmatrix -d "{\"nargout\":1, \"rhs\":[[[1,2,3],[3,2,1]],[[4,5,6],[6,5,4]]], \"outputFormat\":{\"mode\": \"small\"}}"
If you're using Linux machine, please do the following in Terminal.
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST http://localhost:9910/addmatrix/addmatrix -d '{"nargout":1, "rhs":[[[1,2,3],[3,2,1]],[[4,5,6],[6,5,4]]], "outputFormat":{"mode": "small"}}'
If the above curl command returns {"lhs":[[[5,7,9],[9,7,5]]]}, MPS connection is OK and the root cause would be Java side.

댓글을 달려면 로그인하십시오.

deng hanbo
deng hanbo 2019년 8월 4일

0 개 추천

hi,Dear Chao Li
I meet same problem with you,Java Client with mps error 404.Are you find solution? Would you mind share your solution with me?Thank you very much.

질문:

2017년 3월 23일

답변:

2019년 8월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by