我在使用Toplink要点作为持久性提供程序的Java桌面应用程序中遇到了奇怪的行为。

我有一个目录,其中包含应用程序所需的全部内容:一个ja​​r,一个lib文件夹和一个JavaDB数据库。整个目录是独立的(即使在不同的计算机之间,我也多次复制它没有问题)。

今天,我想再次复制一次,但是我的目标文件夹中包含德语的Umlautü(html:ü)。

启动我的应用程序失败,但有一个异常使得它很难找到原因(见下文)。

我当然知道旧的命名约定,但是我认为我们已经把它抛在了后面。所以我的问题是,是否有一种方法可以使其独立于目录命名运行。这很重要,因为我想将应用程序提供给客户端,并且对安装目录几乎没有影响。

系统:Windows 7,JavaDB 10.5.3

在此先感谢您的帮助!

SCHWERWIEGEND: Application class jlabps.JLabPSApp failed to launch
javax.persistence.PersistenceException: No Persistence provider for EntityManage
r named JLAPS_EMB:  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 jlabps.JLabPSView.initComponents(JLabPSView.java:401)
        at jlabps.JLabPSView.<init>(JLabPSView.java:47)
        at jlabps.JLabPSApp.startup(JLabPSApp.java:71)
        at org.jdesktop.application.Application$1.run(Application.java:171)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$000(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.Error: Application class jlabps
.JLabPSApp failed to launch
        at org.jdesktop.application.Application$1.run(Application.java:177)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$000(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: javax.persistence.PersistenceException: No Persistence provider for E
ntityManager named JLAPS_EMB:  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 jlabps.JLabPSView.initComponents(JLabPSView.java:401)
        at jlabps.JLabPSView.<init>(JLabPSView.java:47)
        at jlabps.JLabPSApp.startup(JLabPSApp.java:71)
        at org.jdesktop.application.Application$1.run(Application.java:171)
        ... 14 more

最佳答案

奇。您正在使用什么JVM?

确保您拥有最新的TopLink Essentials补丁,我记得空格存在问题,但Umlats没有。

您也可以尝试升级到EclipseLink,看看是否发生相同的问题,如果确实发生,请记录错误。

10-06 02:38