f



Builder JA java classes cannot be loaded in Matlab

Hi

This maybe sounds a little bit weird, but I'd like to use 
java components which themselves call Matlab Builder JA 
classes from within MATLAB.

So...

1. Write .m code and compile it with the Builder JA
2. Write java code, which uses the JA classes
3. use the whole framework from MATLAB

This approach would represent a very flexible framework for 
our data analysis, with data analysis, visualization and 
speed optimizations on both sides (JAVA/MATLAB). 

Up to know the framework works well if I stay on the java 
side and use the Builder JA components from within java. In 
MATLAB I can instantiate the java classes and call their 
methods, as long as the java code does not try to create an 
instance of one of the Builder JA derived classes. This 
leads to the following exception:

??? Java exception occurred:
.... Matlab M-code Stack Trace ...

com.mathworks.toolbox.javabuilder.MWException: Component 
created using MATLAB Builder JA cannot be loaded in MATLAB

	at 
com.mathworks.toolbox.javabuilder.internal.MWMCR.newInstance
(MWMCR.java:612)

	at DispTest.DispTestMCRFactory.newInstance
(DispTestMCRFactory.java:137)

	at DispTest.DispTestMCRFactory.newInstance
(DispTestMCRFactory.java:141)

	at DispTest.DispTestclass.<init>
(DispTestclass.java:43)

Is this a limitation of the javabuilder? Or did I made 
mistakes in the implementation?

Thanks in advance 

Stefan
 
0
sro1 (15)
6/7/2008 8:37:01 PM
comp.soft-sys.matlab 211264 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

4 Replies
821 Views

Similar Articles

[PageSpeed] 17

Hi Stefan

I ran into the same problem. So far i have not been able to solve it. Please let me know if you came up with a solution.

Thx

Thomas

"Stefan Roth" <sro@ini.phys.ethz.ch> wrote in message <g2erhd$p8i$1@fred.mathworks.com>...
> Hi
> 
> This maybe sounds a little bit weird, but I'd like to use 
> java components which themselves call Matlab Builder JA 
> classes from within MATLAB.
> 
> So...
> 
> 1. Write .m code and compile it with the Builder JA
> 2. Write java code, which uses the JA classes
> 3. use the whole framework from MATLAB
> 
> This approach would represent a very flexible framework for 
> our data analysis, with data analysis, visualization and 
> speed optimizations on both sides (JAVA/MATLAB). 
> 
> Up to know the framework works well if I stay on the java 
> side and use the Builder JA components from within java. In 
> MATLAB I can instantiate the java classes and call their 
> methods, as long as the java code does not try to create an 
> instance of one of the Builder JA derived classes. This 
> leads to the following exception:
> 
> ??? Java exception occurred:
> ... Matlab M-code Stack Trace ...
> 
> com.mathworks.toolbox.javabuilder.MWException: Component 
> created using MATLAB Builder JA cannot be loaded in MATLAB
> 
> 	at 
> com.mathworks.toolbox.javabuilder.internal.MWMCR.newInstance
> (MWMCR.java:612)
> 
> 	at DispTest.DispTestMCRFactory.newInstance
> (DispTestMCRFactory.java:137)
> 
> 	at DispTest.DispTestMCRFactory.newInstance
> (DispTestMCRFactory.java:141)
> 
> 	at DispTest.DispTestclass.<init>
> (DispTestclass.java:43)
> 
> Is this a limitation of the javabuilder? Or did I made 
> mistakes in the implementation?
> 
> Thanks in advance 
> 
> Stefan
>  

0
9/10/2008 11:58:02 AM
I believe this is a limitation, none of the builder products (JA,NE,)  
components can be used back within MATLAB.
Cant seem to find anything handy to point to, just a heads-up to save some  
frustrations.

I am quite curious to know the need for something like this.


On Wed, 10 Sep 2008 07:58:02 -0400, Thomas Dhollander  
<thomas.dhollander@gmail.com> wrote:

> Hi Stefan
>
> I ran into the same problem. So far i have not been able to solve it.  
> Please let me know if you came up with a solution.
>
> Thx
>
> Thomas
>
> "Stefan Roth" <sro@ini.phys.ethz.ch> wrote in message  
> <g2erhd$p8i$1@fred.mathworks.com>...
>> Hi
>>
>> This maybe sounds a little bit weird, but I'd like to use
>> java components which themselves call Matlab Builder JA
>> classes from within MATLAB.
>>
>> So...
>>
>> 1. Write .m code and compile it with the Builder JA
>> 2. Write java code, which uses the JA classes
>> 3. use the whole framework from MATLAB
>>
>> This approach would represent a very flexible framework for
>> our data analysis, with data analysis, visualization and
>> speed optimizations on both sides (JAVA/MATLAB).
>>
>> Up to know the framework works well if I stay on the java
>> side and use the Builder JA components from within java. In
>> MATLAB I can instantiate the java classes and call their
>> methods, as long as the java code does not try to create an
>> instance of one of the Builder JA derived classes. This
>> leads to the following exception:
>>
>> ??? Java exception occurred:
>> ... Matlab M-code Stack Trace ...
>>
>> com.mathworks.toolbox.javabuilder.MWException: Component
>> created using MATLAB Builder JA cannot be loaded in MATLAB
>>
>> 	at
>> com.mathworks.toolbox.javabuilder.internal.MWMCR.newInstance
>> (MWMCR.java:612)
>>
>> 	at DispTest.DispTestMCRFactory.newInstance
>> (DispTestMCRFactory.java:137)
>>
>> 	at DispTest.DispTestMCRFactory.newInstance
>> (DispTestMCRFactory.java:141)
>>
>> 	at DispTest.DispTestclass.<init>
>> (DispTestclass.java:43)
>>
>> Is this a limitation of the javabuilder? Or did I made
>> mistakes in the implementation?
>>
>> Thanks in advance
>>
>> Stefan
>>
>

0
ashishu (239)
9/10/2008 6:33:17 PM
Hello Stefan, Thomas

This limitation is by-design.  We may lift it in the future, but the reason it is there in the present is so that Builder JA doesn't become a tool for disabling the license checking on toolboxes.  

Builder JA, along with all the other Builders and the Compiler, produces packages of M code that do not require product licenses to run.  In order to enable what you want to do, we'd first have to implement a system for checking to make sure the MATLAB session that loads the Builder JA component has sufficient permissions to run the M code, particularly any compiled toolbox functions.  Just to keep the honest folks honest.

-Tony

"Thomas Dhollander" <thomas.dhollander@gmail.com> wrote in message <ga8coa$atl$1@fred.mathworks.com>...
> Hi Stefan
> 
> I ran into the same problem. So far i have not been able to solve it. Please let me know if you came up with a solution.
> 
> Thx
> 
> Thomas
> 
> "Stefan Roth" <sro@ini.phys.ethz.ch> wrote in message <g2erhd$p8i$1@fred.mathworks.com>...
> > Hi
> > 
> > This maybe sounds a little bit weird, but I'd like to use 
> > java components which themselves call Matlab Builder JA 
> > classes from within MATLAB.
> > 
> > So...
> > 
> > 1. Write .m code and compile it with the Builder JA
> > 2. Write java code, which uses the JA classes
> > 3. use the whole framework from MATLAB
> > 
> > This approach would represent a very flexible framework for 
> > our data analysis, with data analysis, visualization and 
> > speed optimizations on both sides (JAVA/MATLAB). 
> > 
> > Up to know the framework works well if I stay on the java 
> > side and use the Builder JA components from within java. In 
> > MATLAB I can instantiate the java classes and call their 
> > methods, as long as the java code does not try to create an 
> > instance of one of the Builder JA derived classes. This 
> > leads to the following exception:
> > 
> > ??? Java exception occurred:
> > ... Matlab M-code Stack Trace ...
> > 
> > com.mathworks.toolbox.javabuilder.MWException: Component 
> > created using MATLAB Builder JA cannot be loaded in MATLAB
> > 
> > 	at 
> > com.mathworks.toolbox.javabuilder.internal.MWMCR.newInstance
> > (MWMCR.java:612)
> > 
> > 	at DispTest.DispTestMCRFactory.newInstance
> > (DispTestMCRFactory.java:137)
> > 
> > 	at DispTest.DispTestMCRFactory.newInstance
> > (DispTestMCRFactory.java:141)
> > 
> > 	at DispTest.DispTestclass.<init>
> > (DispTestclass.java:43)
> > 
> > Is this a limitation of the javabuilder? Or did I made 
> > mistakes in the implementation?
> > 
> > Thanks in advance 
> > 
> > Stefan
> >  
> 

0
9/10/2008 7:30:22 PM
Hi Tony

I already thought that it's probably a licensing issue. Now I know, and I can understand the position of Mathworks.

However it would add a lot of fexibility to Builder JA frameworks if the additional licensing functionality would be implented soon. My approach was to give the users of my framework the freedom to choose whether they want to access it from Matlab or from JAVA (depending on their skills).

Stefan



"Tony " <tony.astolfi@mathworks.com.remove.this> wrote in message <ga978e$4k2$1@fred.mathworks.com>...
> Hello Stefan, Thomas
> 
> This limitation is by-design.  We may lift it in the future, but the reason it is there in the present is so that Builder JA doesn't become a tool for disabling the license checking on toolboxes.  
> 
> Builder JA, along with all the other Builders and the Compiler, produces packages of M code that do not require product licenses to run.  In order to enable what you want to do, we'd first have to implement a system for checking to make sure the MATLAB session that loads the Builder JA component has sufficient permissions to run the M code, particularly any compiled toolbox functions.  Just to keep the honest folks honest.
> 
> -Tony
> 
> "Thomas Dhollander" <thomas.dhollander@gmail.com> wrote in message <ga8coa$atl$1@fred.mathworks.com>...
> > Hi Stefan
> > 
> > I ran into the same problem. So far i have not been able to solve it. Please let me know if you came up with a solution.
> > 
> > Thx
> > 
> > Thomas
> > 
> > "Stefan Roth" <sro@ini.phys.ethz.ch> wrote in message <g2erhd$p8i$1@fred.mathworks.com>...
> > > Hi
> > > 
> > > This maybe sounds a little bit weird, but I'd like to use 
> > > java components which themselves call Matlab Builder JA 
> > > classes from within MATLAB.
> > > 
> > > So...
> > > 
> > > 1. Write .m code and compile it with the Builder JA
> > > 2. Write java code, which uses the JA classes
> > > 3. use the whole framework from MATLAB
> > > 
> > > This approach would represent a very flexible framework for 
> > > our data analysis, with data analysis, visualization and 
> > > speed optimizations on both sides (JAVA/MATLAB). 
> > > 
> > > Up to know the framework works well if I stay on the java 
> > > side and use the Builder JA components from within java. In 
> > > MATLAB I can instantiate the java classes and call their 
> > > methods, as long as the java code does not try to create an 
> > > instance of one of the Builder JA derived classes. This 
> > > leads to the following exception:
> > > 
> > > ??? Java exception occurred:
> > > ... Matlab M-code Stack Trace ...
> > > 
> > > com.mathworks.toolbox.javabuilder.MWException: Component 
> > > created using MATLAB Builder JA cannot be loaded in MATLAB
> > > 
> > > 	at 
> > > com.mathworks.toolbox.javabuilder.internal.MWMCR.newInstance
> > > (MWMCR.java:612)
> > > 
> > > 	at DispTest.DispTestMCRFactory.newInstance
> > > (DispTestMCRFactory.java:137)
> > > 
> > > 	at DispTest.DispTestMCRFactory.newInstance
> > > (DispTestMCRFactory.java:141)
> > > 
> > > 	at DispTest.DispTestclass.<init>
> > > (DispTestclass.java:43)
> > > 
> > > Is this a limitation of the javabuilder? Or did I made 
> > > mistakes in the implementation?
> > > 
> > > Thanks in advance 
> > > 
> > > Stefan
> > >  
> > 
> 

0
sro1 (15)
9/11/2008 3:26:01 PM
Reply: