netbean 生成 Java 桌面数据库应用程序

当我按照这个教程http://zh-cn.netbeans.org/kb/docs/java/gui-db.html时出现下面的错误:

run:

2010-6-10 20:11:54 org.jdesktop.application.Application$1 run

严重: Application class carsapp.CarsApp failed to launch

javax.persistence.PersistenceException: No Persistence provider for EntityManager named car_databasePU:  The following providers:

oracle.toplink.essentials.PersistenceProvider

oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider

Returned null to createEntityManagerFactory.

        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:154)

        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)

        at carsapp.CarsView.initComponents(CarsView.java:289)

        at carsapp.CarsView.<init>(CarsView.java:36)

        at carsapp.CarsApp.startup(CarsApp.java:19)

        at org.jdesktop.application.Application$1.run(Application.java:171)

        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)

        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)

        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Exception in thread "AWT-EventQueue-0" java.lang.Error: Application class carsapp.CarsApp failed to launch

        at org.jdesktop.application.Application$1.run(Application.java:177)

        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)

        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)

        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named car_databasePU:  The following providers:

oracle.toplink.essentials.PersistenceProvider

oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider

Returned null to createEntityManagerFactory.

        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:154)

        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)

        at carsapp.CarsView.initComponents(CarsView.java:289)

        at carsapp.CarsView.<init>(CarsView.java:36)

        at carsapp.CarsApp.startup(CarsApp.java:19)

        at org.jdesktop.application.Application$1.run(Application.java:171)

        ... 8 more

成功生成(总时间:2 秒)

google : javax.persistence.PersistenceException: No Persistence provider for EntityManager named car_databasePU
Does the directory with the application contain any non-ASCII character? 
If so, then it is a known issue 119567 that is caused by a GlassFish 
issue 3827. The workaround is to rename the directory to contain ASCII 
letters only. See  http://www.netbeans.org/issues/show_bug.cgi?id=119567  
and  https://glassfish.dev.java.net/issues/show_bug.cgi?id=3827 for more 
details. 
上面的意思是说在路径中存在中文,换了一个位置,果然成功。

你可能感兴趣的:(java)