[ https://issues.apache.org/jira/browse/OPENJPA-2779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Florin Jurcovici updated OPENJPA-2779: -------------------------------------- Environment: $uname -a Linux <redacted> 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux $ java -version openjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-2~deb9u1-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode) was: $uname -a Linux vasile 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux $ java -version openjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-2~deb9u1-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode) > ReverseMappingTool doesn't load persistence.xml > ----------------------------------------------- > > Key: OPENJPA-2779 > URL: https://issues.apache.org/jira/browse/OPENJPA-2779 > Project: OpenJPA > Issue Type: Bug > Components: jdbc > Affects Versions: 3.0.0 > Environment: $uname -a > Linux <redacted> 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 > GNU/Linux > $ java -version > openjdk version "1.8.0_181" > OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-2~deb9u1-b13) > OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode) > Reporter: Florin Jurcovici > Priority: Major > > Steps to reproduce: > # download the openjpa zip for version 3.0.0, decompress it into a directory > # download the mariadb jdbc driver into the same directory > # in the same directory, create a subdirectory META-INF, then create a > hibernate.xml file, based on the model from [this > page|https://openjpa.apache.org/builds/3.0.0/apache-openjpa/docs/jpa_overview_persistence.html] > # create another directory, named src, inside the directory where the jars are > # replace the database url, driver name, username and password with values > specific to local setup > # run this command: > {code}java -cp ./:mariadb-java-client-2.4.0.jar:openjpa-all-3.0.0.jar > org.apache.openjpa.jdbc.meta.ReverseMappingTool -pkg entities -d ./src{code} > Expected: for each table in the database appearing in the url, an entity > class is generated inside the entities package. > Actual: a stack trace is printed to stdout: > {code}9 INFO [main] openjpa.Tool - The reverse mapping tool will run on > the database. The tool is gathering schema information; this process may > take some time. Enable the org.apache.openjpa.jdbc.Schema logging category > to see messages about schema data. > Exception in thread "main" <openjpa-3.0.0-r422266:1833209 fatal user error> > org.apache.openjpa.util.UserException: The persistence provider 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@f248234b". > at > org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:71) > at > org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:850) > at > org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:733) > at > org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDataSource(JDBCConfigurationImpl.java:879) > at > org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDataSource2(JDBCConfigurationImpl.java:921) > at > org.apache.openjpa.jdbc.schema.SchemaGenerator.<init>(SchemaGenerator.java:86) > at > org.apache.openjpa.jdbc.meta.ReverseMappingTool.run(ReverseMappingTool.java:2027) > at > org.apache.openjpa.jdbc.meta.ReverseMappingTool.run(ReverseMappingTool.java:2005) > at > org.apache.openjpa.jdbc.meta.ReverseMappingTool.run(ReverseMappingTool.java:1882) > at > org.apache.openjpa.jdbc.meta.ReverseMappingTool$1.run(ReverseMappingTool.java:1863) > at > org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:762) > at > org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:747) > at > org.apache.openjpa.jdbc.meta.ReverseMappingTool.main(ReverseMappingTool.java:1858){code} > I downloaded the source code, and tried to run the same task in the IDE. I > can't find any place in the code where the file META-INF/persistence.xml is > loaded, so this is pretty much expected behavior, from how much I understood > after spending half an hour or so with the source code. -- This message was sent by Atlassian JIRA (v7.6.3#76005)