ODE15 problem in java web deployment

2 次查看(过去 30 天)
I am producing a java web with a library compiled from Matlab Builder JA containing ODE15s. I have no problem running it in MATLAB. But when I try to run the project on server, there is an error as follows:
com.mathworks.toolbox.javabuilder.MWException: PK_MODEL_V1 returns a vector of length 4, but the length of initial conditions vector is 7. The vector returned by PK_MODEL_V1 and the initial conditions vector must have the same number of elements.
Can someone please help on how to solve this? Here is the files containing my project should you need to refer the problems of my project in detail. Really appreciate your help. Thanks.

采纳的回答

Titus Edelhofer
Titus Edelhofer 2014-7-6
Hi Zetty,
a trick that often helps debugging such issues is to save the input data of your deployed function into a .mat file, run the deployed component, load the .mat and debug in MATLAB. Something like
function mylibrary(someInput, anotherInput)
if isdeployed
save c:\temp\inputdata.mat
end
When you run you component, debug:
debug stop if error
load c:\temp\inputdata.mat
mylibrary(someInput, anotherInput);
You might see that the input data are not exactly as you expected them to be.
Titus
  3 个评论
Titus Edelhofer
Titus Edelhofer 2014-7-7
Hi Zetty,
when you compile your code with the Builder JA, you specify the function that becomes the method in your java class. Copy the lines 2-4 from above (the "if") at the beginning of your existing .m file. The second code you execute in MATLAB after running the java code (replacing the call to "mylibrary" and the input variables by your existing code (with it's own variables).
Hope this helps,
Titus

请先登录,再进行评论。

更多回答(1 个)

Image Analyst
Image Analyst 2014-7-6
Could it be a permission thing, like you tried to write something out the server and it didn't let you. Do you write anything out to a file? If so, where?
  1 个评论
Zetty  Zakaria
Zetty Zakaria 2014-7-6
编辑:Zetty Zakaria 2014-7-6
Hi Image Analyst. I don't write anything out the server. I just make a simple html web page, with 2 variables. Time (integer) and Dose (string array for the ode function). These inputs will then be used to form a graph using matlab library, which will be displayed under jsp file. I attach all the related files Here should you need more details. Thanks in advance!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Java Client Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by