Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » OSGI WAB problem with persistence.xml( An exception was thrown while processing persistence.xml from URL: bundle://307.1:1/)
OSGI WAB problem with persistence.xml [message #652694] Sat, 05 February 2011 08:40 Go to next message
Samuel Dionne is currently offline Samuel Dionne
Messages: 4
Registered: February 2011
Junior Member
Hello, I'm having some problem with EclipseLink. I'm using GlassFish v3.1 and I'm trying to use EclipseLink for my persistence layer. I followed all tutorials available on the Eclipse wiki without luck. My persistence.xml file cannot be parsed and I receive this error while trying to create the EntityManagerFactory:

Quote:
org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption Exception Description: An exception was thrown while processing persistence.xml from URL: bundle://307.1:1/


The full stack trace can be found here: dinoz.mobi/stack.txt

Here is my persistence.xml located in /WEB-INF/classes/META-INF/:

<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
    <persistence-unit name="generic">
        <class>com.generic.domain.Service</class>

        <properties>
            <!-- Embedded MySQL Login -->
            <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
            <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306"/>

            <!-- TODO: replace with connection pool -->
            <property name="javax.persistence.jdbc.userid" value="root"/>
            <property name="javax.persistence.jdbc.password" value=""/>

            <property name="eclipselink.target-database" value="MySQL"/>
            <property name="eclipselink.jdbc.read-connections.min" value="1"/>
            <property name="eclipselink.jdbc.write-connections.min" value="1"/>
            <property name="eclipselink.jdbc.batch-writing" value="JDBC"/>

            <!-- Logging Settings -->
            <property name="eclipselink.logging.level" value="FINE" />
            <property name="eclipselink.logging.thread" value="false" />
            <property name="eclipselink.logging.session" value="false" />
            <property name="eclipselink.logging.exceptions" value="true" />
            <property name="eclipselink.logging.timestamp" value="false"/>            
        </properties>
    </persistence-unit>
</persistence>


I'm using the EclipseLink bundle that are available in GlassFish v3.1
Here is the structure of my WAB:
Quote:

- META-INF/MANIFEST.MF
- WEB-INF/web.xml
- WEB-INF/classes/com/...
- WEB-INF/classes/META-INF/persistence.xml



Bundle-ClassPath: WEB-INF/classes

I can find the persistence.xml under WEB-INF/classes/META-INF/
I added this line to my MANIFEST.MF:

Quote:
JPA-PersistenceUnits: generic



Thanks for your help.

--
Samuel D.
Re: OSGI WAB problem with persistence.xml [message #652722 is a reply to message #652694] Sat, 05 February 2011 16:31 Go to previous messageGo to next message
Shaun Smith is currently offline Shaun Smith
Messages: 192
Registered: July 2009
Senior Member
Sahoo responded to your cross-post over on stackoverflow: http://stackoverflow.com/questions/4852100/eclipselink-into- osgi-bundle-persistence-xml-not-found

He's the expert on OSGi in GlassFish so I'd take any advice he has to offer. Smile

--Shaun
Re: OSGI WAB problem with persistence.xml [message #652723 is a reply to message #652694] Sat, 05 February 2011 16:37 Go to previous message
Samuel Dionne is currently offline Samuel Dionne
Messages: 4
Registered: February 2011
Junior Member
Hi, sorry for that, I didn't know that you guys were answering on StackOverflow too. Thanks for the advise.


--
Samuel D.
Previous Topic:@NamedStoredProcedureQuery & Out Parameter:
Next Topic:Exception [EclipseLink-6044] Primary keys must not contain null.
Goto Forum:
  


Current Time: Wed Apr 23 20:03:28 EDT 2014

Powered by FUDForum. Page generated in 0.01530 seconds