users@glassfish.java.net

Oracle Toplink Essentials IllegalArgumentException

From: <glassfish_at_javadesktop.org>
Date: Fri, 07 Dec 2007 01:41:36 PST

Hi all,

I am using the toplink-essentials.jar to provide persistence in my java SE appliction. I package all classfiles within one jar file (with manifest file to lib/ resources) and this can be executed automatically by simply double clicking the .jar file.

When I deploy the jar file to one of our servers and run it from here I get an exception. Note this does not happen when running from a local machine OR mapping a network drive to the server location where the jar file resides, and running from mapped drive. The error seems to relate to a problem when creating the entityManagerFactory from the persistence.xml file. Below is the exception stack trace which shows the error in more detail:

Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named labcreate: Provider named oracle.toplink.essentials.PersistenceProvider threw unexpected exception at create EntityManagerFactory:
oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
Local Exception Stack:
Exception [TOPLINK-30005] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: sun.misc.Launcher$AppClassLoader_at_df6ccd
Internal Exception: java.lang.IllegalArgumentException: URI has an authority component
        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 labcreate.dao.EntityManagerAccess.createFactory(EntityManagerAccess.java:51)
        at labcreate.LabCreate.main(LabCreate.java:125)
Caused by: java.lang.IllegalArgumentException: URI has an authority component
        at java.io.File.<init>(Unknown Source)
        at oracle.toplink.essentials.ejb.cmp3.persistence.ArchiveFactoryImpl.createArchive(ArchiveFactoryImpl.java:99)
        at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.findPersistenceArchives(PersistenceUnitProcessor.java:248)
        at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.findPersistenceArchives(PersistenceUnitProcessor.java:231)
        at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:252)
        at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:155)
        ... 3 more

Does the problem come from the fact that the URL to the persistence.xml file has a different format with it being run from a server??

Any suggestions are much appreciated.

Regards

Alan
[Message sent by forum member 'alan1983' (alan1983)]

http://forums.java.net/jive/thread.jspa?messageID=248980