Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. Options opts = new Options();
  2.  
  3. opts.setProperty("directory", "/home/myname/Documents/codegenerator");
  4. opts.setProperty("annotations", true);
  5. opts.setProperty("metadata", "class");
  6. opts.setProperty("schema", "dbSchema.tblCustomer");
  7.  
  8. boolean ret = Configurations.runAgainstAllAnchors(opts,
  9. new Configurations.Runnable() {
  10. public boolean run(Options opts) throws Exception {
  11.  
  12. JDBCConfigurationImpl jdbcCnnConfig = new JDBCConfigurationImpl();
  13.  
  14. jdbcCnnConfig.setConnectionURL("jdbc:postgresql://localhost:5432/myowndb");
  15. jdbcCnnConfig.setConnectionDriverName("org.postgresql.Driver");
  16. jdbcCnnConfig.setConnectionUserName("myusername");
  17. jdbcCnnConfig.setConnectionPassword("mypassword);
  18.  
  19. try {
  20. return ReverseMappingTool.run(jdbcCnnConfig, new String[] {}, opts);
  21. } finally {
  22. jdbcCnnConfig.close();
  23. }
  24. }
  25. });
  26.  
  27. 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.
  28. 197 INFO [http-bio-8080-exec-3] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.PostgresDictionary".
  29. 311 INFO [http-bio-8080-exec-3] openjpa.Tool - ReverseMappingTool : generating classes.
  30. 312 INFO [http-bio-8080-exec-3] openjpa.Tool - Writing generated class source code.
  31. 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.
  32. <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.
  33. at org.apache.openjpa.meta.MetaDataRepository.initializeMetaDataFactory(MetaDataRepository.java:1904)
  34. at org.apache.openjpa.meta.MetaDataRepository.endConfiguration(MetaDataRepository.java:1885)
  35. at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1507)
  36. at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
  37. at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
  38. at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
  39. at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
  40. at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
  41. at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:968)
  42. at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.newMappingRepositoryInstance(JDBCConfigurationImpl.java:715)
  43. at org.apache.openjpa.jdbc.meta.ReverseMappingTool.getRepository(ReverseMappingTool.java:588)
  44. at org.apache.openjpa.jdbc.meta.ReverseMappingTool.getMappings(ReverseMappingTool.java:633)
  45. at org.apache.openjpa.jdbc.meta.ReverseMappingTool.recordCode(ReverseMappingTool.java:848)
  46. at org.apache.openjpa.jdbc.meta.ReverseMappingTool.recordCode(ReverseMappingTool.java:831)
  47. at org.apache.openjpa.jdbc.meta.ReverseMappingTool.run(ReverseMappingTool.java:2018)
  48. at org.apache.openjpa.jdbc.meta.ReverseMappingTool.run(ReverseMappingTool.java:1958)
  49. at org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:741)
  50. at org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:726)
  51. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement