Hello everybody,

I am currently writing a custom connector to retrieve information from a
database. Because the mediators to do so does not fit my needs, I am using
a custom Java class which is currently implemented to retrieve a DataSource
via the JNDI name I configured in the ESB interface. That works nicely :)

But then, for maintenance purpose, I would like to use JPA (preferably, the
OpenJPA implementation :)) but it is like the persistence.xml is not even
read. :(
My libraries are placed in the lib/ directory in the generated zip of my
connector and I don't have any problem using the classes of OpenJPA.
Actually, just this error message appears:

1 INFO [PassThroughMessageProcessor-313] openjpa.Runtime - Starting OpenJPA
2.4.0 org.apache.openjpa.persistence.ArgumentException: The persistence
provi der is attempting to use properties in the persistence.xml file to
resolve the data source. A Java Database Connectivity (JDBC) driver or data
source class name must be specified in the openjpa.ConnectionDriverName or
javax.persistence.jdbc.driver property. The following properties are
available in the configuration:
"org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl@442ce698".

In the persistence.xml, you have the following content :

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
    http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd";>
    <persistence-unit name="my-pu" transaction-type="RESOURCE_LOCAL">

<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
        <jta-data-source>jdbc/MyDataSource</jta-data-source>
    </persistence-unit>
</persistence>

Is there some hidden magic to make it work?

Thank you :)

Regards,

Thomas
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to