Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Options opts = new Options();
- opts.setProperty("directory", "/home/myname/Documents/codegenerator");
- opts.setProperty("annotations", true);
- opts.setProperty("metadata", "class");
- opts.setProperty("schema", "dbSchema.tblCustomer");
- boolean ret = Configurations.runAgainstAllAnchors(opts,
- new Configurations.Runnable() {
- public boolean run(Options opts) throws Exception {
- JDBCConfigurationImpl jdbcCnnConfig = new JDBCConfigurationImpl();
- jdbcCnnConfig.setConnectionURL("jdbc:postgresql://localhost:5432/myowndb");
- jdbcCnnConfig.setConnectionDriverName("org.postgresql.Driver");
- jdbcCnnConfig.setConnectionUserName("myusername");
- jdbcCnnConfig.setConnectionPassword("mypassword);
- try {
- return ReverseMappingTool.run(jdbcCnnConfig, new String[] {}, opts);
- } finally {
- jdbcCnnConfig.close();
- }
- }
- });
- 66 INFO [http-bio-8080-exec-3] 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.
- 197 INFO [http-bio-8080-exec-3] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.PostgresDictionary".
- 311 INFO [http-bio-8080-exec-3] openjpa.Tool - ReverseMappingTool : generating classes.
- 312 INFO [http-bio-8080-exec-3] openjpa.Tool - Writing generated class source code.
- 2012-09-13 11:34:16,157 ERROR [myclass] - MetaDataFactory could not be configured (conf.newMetaDataFactoryInstance() returned null). This might mean that no configuration properties were found. Ensure that you have a META-INF/persistence.xml file, that it is available in your classpath, or that the properties file you are using for configuration is available. If you are using Ant, please see the <properties> or <propertiesFile> attributes of the task's nested <config> element. This can also occur if your OpenJPA distribution jars are corrupt, or if your security policy is overly strict.
- <openjpa-2.2.0-r422266:1244990 fatal user error> org.apache.openjpa.util.MetaDataException: MetaDataFactory could not be configured (conf.newMetaDataFactoryInstance() returned null). This might mean that no configuration properties were found. Ensure that you have a META-INF/persistence.xml file, that it is available in your classpath, or that the properties file you are using for configuration is available. If you are using Ant, please see the <properties> or <propertiesFile> attributes of the task's nested <config> element. This can also occur if your OpenJPA distribution jars are corrupt, or if your security policy is overly strict.
- at org.apache.openjpa.meta.MetaDataRepository.initializeMetaDataFactory(MetaDataRepository.java:1904)
- at org.apache.openjpa.meta.MetaDataRepository.endConfiguration(MetaDataRepository.java:1885)
- at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1507)
- at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
- at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
- at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
- at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
- at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
- at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:968)
- at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.newMappingRepositoryInstance(JDBCConfigurationImpl.java:715)
- at org.apache.openjpa.jdbc.meta.ReverseMappingTool.getRepository(ReverseMappingTool.java:588)
- at org.apache.openjpa.jdbc.meta.ReverseMappingTool.getMappings(ReverseMappingTool.java:633)
- at org.apache.openjpa.jdbc.meta.ReverseMappingTool.recordCode(ReverseMappingTool.java:848)
- at org.apache.openjpa.jdbc.meta.ReverseMappingTool.recordCode(ReverseMappingTool.java:831)
- at org.apache.openjpa.jdbc.meta.ReverseMappingTool.run(ReverseMappingTool.java:2018)
- at org.apache.openjpa.jdbc.meta.ReverseMappingTool.run(ReverseMappingTool.java:1958)
- at org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:741)
- at org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:726)
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement