f



Calling java from matlab #7

Hi,

I'm trying to build a database in Java (using MySQL), and the aim is
to be able to call the connection from Matlab. I've built a .jar
project with netbeans, and apparently it works when running in
netbeans, but when I try to call from Matlab I've found some problems.
I've updated my jvm in matlab, and be sure I add the project to the
javaclasspath.
More or less my code is as follows:

javaaddpath('/home/ojki/Documentos/Oscar/Investigacion/DataBase/
cardiacDataModel/dist/cardiacDataModel.jar');

%Carga de las librerias que se utilizan, dispuestas en lib
cd /home/ojki/Documentos/Oscar/Investigacion/DataBase/cardiacDataModel/
dist/lib;
cdir = dir('*.jar');

for m = 1:length(cdir)
    javaaddpath(['/home/ojki/Documentos/Oscar/Investigacion/DataBase/
cardiacDataModel/dist/lib/',cdir(m).name]);
end


%importar los paquetes necesarios
import es.urjc.cardiac.dataentities.*;
import es.urjc.cardiac.dataentities.trace.*;
import javax.persistence.*;
import javax.persistence.spi.*;
%Crear una instancia de conexion
%keyboard

Connection.getManager

%%%%%%%%%%%%%%%%%%%%%%%

When I try to connect with getManager I've got this error:

??? Java exception occurred:
javax.persistence.PersistenceException: No resource files named
META-INF/services/javax.persistence.spi.PersistenceProvider were
found. Please make sure that the
persistence provider jar file is in your classpath.
	at javax.persistence.Persistence.findAllProviders(Persistence.java:
167)
	at javax.persistence.Persistence.createEntityManagerFactory
(Persistence.java:103)
	at es.urjc.cardiac.dataentities.Connection.getManagerTopLinkFactory
(Connection.java:40)
	at es.urjc.cardiac.dataentities.Connection.getManager(Connection.java:
21)


I've used geronimo-jpa_3.0_spec_1.0.jar which provides with
javax.persistence.

I've tried hard to solve this problem but I wasn't be able to solve.
Has anyone a Idea? I'll appreciate.

Best.
0
obarquero (6)
2/5/2009 9:06:04 AM
comp.soft-sys.matlab 211265 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

4 Replies
565 Views

Similar Articles

[PageSpeed] 52

Ojki <obarquero@gmail.com> wrote in message <4aef1617-ba37-464a-a498-c03cbdbc0dd2@v18g2000pro.googlegroups.com>...
> Hi,
> 
>...
> 
> I've used geronimo-jpa_3.0_spec_1.0.jar which provides with
> javax.persistence.
> 
> I've tried hard to solve this problem but I wasn't be able to solve.
> Has anyone a Idea? I'll appreciate.
> 
> Best.

Did yoiu include this jar file into your static or dynamic classpath?
0
ekyu88 (83)
3/20/2009 7:42:00 PM
On 20 mar, 21:42, "Ed Yu" <eky...@hotmail.com> wrote:
> Ojki <obarqu...@gmail.com> wrote in message <4aef1617-ba37-464a-a498-c03cbdbc0...@v18g2000pro.googlegroups.com>...
> > Hi,
>
> >...
>
> > I've used geronimo-jpa_3.0_spec_1.0.jar which provides with
> > javax.persistence.
>
> > I've tried hard to solve this problem but I wasn't be able to solve.
> > Has anyone a Idea? I'll appreciate.
>
> > Best.
>
> Did yoiu include this jar file into your static or dynamic classpath?

Hi.

Yes, I did, but still not working.

Maybe, it has something to do with problems with matlab dealing with
persistence objects or something like that.

Thanks.


0
obarquero (6)
4/5/2009 6:54:54 PM
Ojki <obarquero@gmail.com> wrote in message <4aef1617-ba37-464a-a498-c03cbdbc0dd2@v18g2000pro.googlegroups.com>...
> Hi,
> 
> I've tried hard to solve this problem but I wasn't be able to solve.
> Has anyone a Idea? I'll appreciate.
> 
> Best.

you are aware that matlab with java and opengl don't play that well together

https://www.kitware.com/InfovisWiki/index.php/Matlab_Titan_Toolbox
0
rothko.fan (147)
4/5/2009 8:47:01 PM
On 5 abr, 22:47, "Chaos" <rothko....@gmail.com> wrote:
> Ojki <obarqu...@gmail.com> wrote in message <4aef1617-ba37-464a-a498-c03cbdbc0...@v18g2000pro.googlegroups.com>...
> > Hi,
>
> > I've tried hard to solve this problem but I wasn't be able to solve.
> > Has anyone a Idea? I'll appreciate.
>
> > Best.
>
> you are aware that matlab with java and opengl don't play that well together
>
> https://www.kitware.com/InfovisWiki/index.php/Matlab_Titan_Toolbox

Thanks for the advice.

I think that I'm going to try the other way around. I mean call matlab
from java, even it means a lot of work for me.
0
obarquero (6)
4/10/2009 9:02:27 PM
Reply: