Run from Matlab using eclipse link in Java code
I try to provide an interface that I can call from MATLAB to access the contents of the database I already have an existing Java interface to connect to the database using eclipse link, and I want to reuse it I wrote a class to provide this. It works when I call it directly from Java, but when I try to call it from MATLAB, I get the following exception:
javax.persistence.PersistenceException: No Perisistence provider for EntityManager named DatabaseConnection
Usually, this exception occurs when I don't use persistence. On the classpath correctly XML, but I tried to put the basic folder containing meta inf folder on dynamic and static matlab javaclasspaths, but failed Again, from the Java runtime, this exact code (including persistence. XML) works properly Who knows what I missed?
One of the main differences I can track when running java code is that MATLAB uses the OSGi class loader (Felix) instead of the default class loader used by Java, but I haven't figured out the difference. Find persistence xml.
Solution
I can see my answer to this in using java generic classes in MATLAB It's ugly, but so far, the only job I can do