JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Object Relational Mapping » JPA  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to postflat modego to previous topicgo to next topic
本主題所含的標籤
作者 Re:OpenJPA 在 createEntityManagerFactory 錯誤 [Re:pico2k]
Mandrake





發文: 7
積分: 0
於 2010-10-11 15:53 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
的確是我的資料庫連不到
但是現在我可以連到了
出現了下面的訊息
======================
66 testJPA INFO [main] openjpa.Runtime - Starting OpenJPA 2.0.1
149 testJPA INFO [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.MySQLDictionary".
Exception in thread "main" <openjpa-2.0.1-r422266:989424 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: There were errors initializing your configuration: <openjpa-2.0.1-r422266:989424 fatal user error> org.apache.openjpa.util.UserException: A connection could not be obtained for driver class "com.mysql.jdbc.Driver" and URL "jdbc:mysql://localhost:3306/test/". You may have specified an invalid URL.
  at org.apache.openjpa.jdbc.schema.DataSourceFactory.newConnectException(DataSourceFactory.java:261)
  at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:247)
  at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:728)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:294)
  at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1602)
  at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:647)
  at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:206)
  at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
  at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
  at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
  at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
  at testJPA.main(testJPA.java:27)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'test/'
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
  at com.mysql.jdbc.Util.getInstance(Util.java:384)
  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:919)
  at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4004)
  at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1284)
  at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2312)
  at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2122)
  at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:774)
  at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
  at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:375)
  at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:289)
  at org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:96)
  at org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:91)
  at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:139)
  at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:112)
  at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:239)
  ... 14 more

  at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:221)
  at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
  at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
  at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
  at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
  at testJPA.main(testJPA.java:27)
Caused by: java.lang.RuntimeException: There were errors initializing your configuration: <openjpa-2.0.1-r422266:989424 fatal user error> org.apache.openjpa.util.UserException: A connection could not be obtained for driver class "com.mysql.jdbc.Driver" and URL "jdbc:mysql://localhost:3306/test/". You may have specified an invalid URL.
  at org.apache.openjpa.jdbc.schema.DataSourceFactory.newConnectException(DataSourceFactory.java:261)
  at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:247)
  at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:728)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:294)
  at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1602)
  at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:647)
  at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:206)
  at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
  at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
  at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
  at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
  at testJPA.main(testJPA.java:27)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'test/'
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
  at com.mysql.jdbc.Util.getInstance(Util.java:384)
  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:919)
  at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4004)
  at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1284)
  at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2312)
  at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2122)
  at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:774)
  at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
  at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:375)
  at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:289)
  at org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:96)
  at org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:91)
  at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:139)
  at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:112)
  at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:239)
  ... 14 more

  at org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:308)
  at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1602)
  at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:647)
  at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:206)
  ... 5 more


reply to postreply to post
話題樹型展開
人氣 標題 作者 字數 發文時間
1727 OpenJPA 在 createEntityManagerFactory 錯誤 Mandrake 2159 2010-10-08 16:53
1515 Re:OpenJPA 在 createEntityManagerFactory 錯誤 koji 46 2010-10-09 10:01
1483 Re:OpenJPA 在 createEntityManagerFactory 錯誤 Mandrake 9454 2010-10-11 14:59
1430 Re:OpenJPA 在 createEntityManagerFactory 錯誤 pico2k 60 2010-10-11 15:41
1458 Re:OpenJPA 在 createEntityManagerFactory 錯誤 Mandrake 9259 2010-10-11 15:53
1433 Re:OpenJPA 在 createEntityManagerFactory 錯誤 pico2k 20 2010-10-11 16:47
1545 Re:OpenJPA 在 createEntityManagerFactory 錯誤 Mandrake 1568 2010-10-11 17:39
1423 Re:OpenJPA 在 createEntityManagerFactory 錯誤 koji 92 2010-10-11 18:40
1459 Re:OpenJPA 在 createEntityManagerFactory 錯誤 Mandrake 1243 2010-10-12 13:58
1393 Re:OpenJPA 在 createEntityManagerFactory 錯誤 koji 35 2010-10-12 17:44
1421 Re:OpenJPA 在 createEntityManagerFactory 錯誤 Mandrake 404 2010-10-18 11:05
1357 Re:OpenJPA 在 createEntityManagerFactory 錯誤 koji 33 2010-10-18 14:04
1389 Re:OpenJPA 在 createEntityManagerFactory 錯誤 BaileyCheng 59 2010-10-18 17:43
1422 Re:OpenJPA 在 createEntityManagerFactory 錯誤 Mandrake 339 2010-10-19 11:30
1332 Re:OpenJPA 在 createEntityManagerFactory 錯誤 koji 55 2010-10-19 14:01
1547 Re:OpenJPA 在 createEntityManagerFactory 錯誤 BaileyCheng 64 2010-10-19 19:12
» JWorld@TW »  Object Relational Mapping » JPA

reply to postflat modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8