O
Ojki
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.
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.