当前位置: 代码迷 >> Java相关 >> netbean新手解决方案
  详细解决方案

netbean新手解决方案

热度:795   发布时间:2013-02-25 21:47:56.0
netbean新手
我在netbean里面写数据库桌面程序的时候,运行项目,结果出现这样的错误,我不知道是什么原因,请大神指教:
(由于帖子长度有限,我只能贴出一部分的错误)
XML code
run:2011-12-13 11:06:46 org.jdesktop.application.Application$1 run严重: Application class cutomerrecords.CustomerRecordsApp failed to launchjavax.persistence.PersistenceException: No Persistence provider for EntityManager named localhost:1433;databaseName=scPU: Provider named oracle.toplink.essentials.PersistenceProvider threw unexpected exception at create EntityManagerFactory: oracle.toplink.essentials.exceptions.PersistenceUnitLoadingExceptionLocal Exception Stack: Exception [TOPLINK-30005] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingExceptionException Description: An exception was thrown while searching for persistence archives with ClassLoader: sun.misc.Launcher$AppClassLoader@19821fInternal Exception: javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupExceptionException Description: predeploy for PersistenceUnit [localhost:1433;databaseName=scPU] failed.Internal Exception: Exception [TOPLINK-7250] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.ValidationExceptionException Description: [class cutomerrecords.Customers] uses a non-entity [class cutomerrecords.Countries] as target entity in the relationship attribute [private cutomerrecords.Countries cutomerrecords.Customers.countryId].    at oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:143)    at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:169)    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:110)    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)    at cutomerrecords.CustomerRecordsView.initComponents(CustomerRecordsView.java:342)    at cutomerrecords.CustomerRecordsView.<init>(CustomerRecordsView.java:39)    at cutomerrecords.CustomerRecordsApp.startup(CustomerRecordsApp.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)Caused by: javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupExceptionException Description: predeploy for PersistenceUnit [localhost:1433;databaseName=scPU] failed.Internal Exception: Exception [TOPLINK-7250] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.ValidationExceptionException Description: [class cutomerrecords.Customers] uses a non-entity [class cutomerrecords.Countries] as target entity in the relationship attribute [private cutomerrecords.Countries cutomerrecords.Customers.countryId].    at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:643)    at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.callPredeploy(JavaSECMPInitializer.java:171)    at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initPersistenceUnits(JavaSECMPInitializer.java:239)    at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:255)    at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:155)    ... 14 moreCaused by: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupExceptionException Description: predeploy for PersistenceUnit [localhost:1433;databaseName=scPU] failed.Internal Exception: Exception [TOPLINK-7250] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.ValidationExceptionException Description: [class cutomerrecords.Customers] uses a non-entity [class cutomerrecords.Countries] as target entity in the relationship attribute [private cutomerrecords.Countries cutomerrecords.Customers.countryId].    at oracle.toplink.essentials.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:228)    ... 19 moreCaused by: Exception [TOPLINK-7250] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.ValidationExceptionException Description: [class cutomerrecords.Customers] uses a non-entity [class cutomerrecords.Countries] as target entity in the relationship attribute [private cutomerrecords.Countries cutomerrecords.Customers.countryId].    at oracle.toplink.essentials.exceptions.ValidationException.nonEntityTargetInRelationship(ValidationException.java:1140)    at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataValidator.throwNonEntityTargetInRelationship(MetadataValidator.java:321)    at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.RelationshipAccessor.getReferenceDescriptor(RelationshipAccessor.java:164)    at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ObjectAccessor.processOneToOneForeignKeyRelationship(ObjectAccessor.java:128)    at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ObjectAccessor.processOwningMappingKeys(ObjectAccessor.java:205)    at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ManyToOneAccessor.process(ManyToOneAccessor.java:121)    at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.RelationshipAccessor.processRelationship(RelationshipAccessor.java:290)    at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProject.processRelationshipDescriptors(MetadataProject.java:579)    at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProject.process(MetadataProject.java:512)    at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processAnnotations(MetadataProcessor.java:246)    at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:370)    at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:607)    ... 18 more The following providers:oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProviderReturned null to createEntityManagerFactory.    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:154)    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)    at cutomerrecords.CustomerRecordsView.initComponents(CustomerRecordsView.java:342)    at cutomerrecords.CustomerRecordsView.<init>(CustomerRecordsView.java:39)    at cutomerrecords.CustomerRecordsApp.startup(CustomerRecordsApp.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 cutomerrecords.CustomerRecordsApp 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 localhost:1433;databaseName=scPU: Provider named oracle.toplink.essentials.PersistenceProvider threw unexpected exception at create EntityManagerFactory: oracle.toplink.essentials.exceptions.PersistenceUnitLoadingExceptionLocal Exception Stack: Exception [TOPLINK-30005] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingExceptionException Description: An exception was thrown while searching for persistence archives with ClassLoader: sun.misc.Launcher$AppClassLoader@19821fInternal Exception: javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
  相关解决方案