Hey all,

This is sort of a random question but we want to set up a java based web server for Matlab and are having some issues. It looks like there are a lot of Matlab users here and I was wondering is anyone had any experience with Matlab Builder JA on Linux.

For a detailed explanation of our problem see below.

Thanks for any help!

Jeramie


Our Problem:

We'd like to run Matlab applications on a webserver. We've installed
Matlab (R2010a) & Matlab Java Builder (Version 2.1) on a server (Linux
ubuntu). Apache2 (2.2.12) and tomcat6 are installed.

We tried to compiled several Matlab apps with Java Builder (that
worked) and run them as webapps on the webserver (that didn't work).

There are different errors with different apps.

1) For WebFigureExample from the Mathworks Central it is:

java.lang.ClassNotFoundException:
com.mathworks.toolbox.javabuilder.MWComponentInsta nce
at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1399)
at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1245)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:332)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :632)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findC lassInternal(WebappClassLoader.java:1862)
at org.apache.catalina.loader.WebappClassLoader.findC lass(WebappClassLoader.java:902)
at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1366)
at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1245)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:332)
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.jav a:2308)
at java.lang.Class.getDeclaredFields(Class.java:1760)
at org.apache.catalina.util.DefaultAnnotationProcesso r$2.run(DefaultAnnotationProcessor.java:164)
at org.apache.catalina.util.DefaultAnnotationProcesso r$2.run(DefaultAnnotationProcessor.java:162)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.util.DefaultAnnotationProcesso r.processAnnotations(DefaultAnnotationProcessor.ja va:161)
at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1120)
at org.apache.catalina.core.StandardWrapper.allocate( StandardWrapper.java:809)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:636)

and it's right, there is no MWComponentInstance.class in
com.mathworks.toolbox.javabuilder, it is in
com.mathworks.toolbox.javabuilder.internal. How to fix it?

2) For another example application (WebFigureQuickStart) it is:

SEVERE: Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspTagException: An Unknown issue occurred while
trying to generate the DefaultFigure.
at com.mathworks.toolbox.javabuilder.webfigures.jsp.J spWebFigureTagHandler.writeHtml(JspWebFigureTagHan dler.java:141)
at com.mathworks.toolbox.javabuilder.webfigures.jsp.J spWebFigureTagHandler.doStartTag(JspWebFigureTagHa ndler.java:146)
at org.apache.jsp.WebFigureExample_jsp._jspx_meth_wf_ 005fweb_002dfigure_005f0(WebFigureExample_jsp.java :138)
at org.apache.jsp.WebFigureExample_jsp._jspService(We bFigureExample_jsp.java:73)
at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.security.SecurityUtil$1.run(Se curityUtil.java:269)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject .java:537)
at org.apache.catalina.security.SecurityUtil.execute( SecurityUtil.java:301)
at org.apache.catalina.security.SecurityUtil.doAsPriv ilege(SecurityUtil.java:162)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:283)
at org.apache.catalina.core.ApplicationFilterChain.ac cess$000(ApplicationFilterChain.java:56)
at org.apache.catalina.core.ApplicationFilterChain$1. run(ApplicationFilterChain.java:189)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:185)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:636)

This could hardly be permissions, because I added

grant {
permission java.security.AllPermission;
};

to /etc/tomcat6/policy.d/50local.policy (tomcat was restarted afterwards)


Any help or examples working with Matlab R2010a are appreciated!