Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Calling java from matlab

Reply
Thread Tools

Calling java from matlab

 
 
Ojki
Guest
Posts: n/a
 
      02-05-2009
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(Per sistence.java:
167)
at javax.persistence.Persistence.createEntityManagerF actory
(Persistence.java:103)
at es.urjc.cardiac.dataentities.Connection.getManager TopLinkFactory
(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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help - In Calling Matlab from java diya.246@gmail.com Java 3 07-09-2011 12:27 AM
vectorized computation in C++ such as those in Matlab (Matlab toC++)? Luna Moon C++ 16 08-08-2008 04:27 PM
Eclipse RCP and MATLAB (calling MATLAB from JAVA) siki Java 0 01-16-2007 04:19 AM
calling matlab Mohammed Smadi Python 3 10-25-2005 06:49 AM
Re: calling matlab Robert Kern Python 0 10-12-2005 03:44 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57