persistence@glassfish.java.net

RE: Re: Regarding mysql - class not found from toplink

From: <binu.idicula.ext_at_nsn.com>
Date: Wed, 9 Jan 2008 13:55:36 +0200

Hi,

MySQL/J - Version is - mysql-connector-java-5.1.5
Server - 5.0.27-community

My Platform is - Enterprise Edition 5 SDK update 3.
Persistence.xml is as follows

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
version="1.0">
        <persistence-unit name="ProductManagement">
        
<provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvide
r</provider>
        
<jta-data-source>jdbc/ProductDataSource</jta-data-source>
                <class>com.solspc.service.irp.Product</class>
        
<class>com.solspc.service.irp.ChemicalComposition</class>
            <properties>
                    <property name="toplink.jdbc.driver"
value="com.mysql.jdbc.Driver"/>
                <property name="toplink.jdbc.url"
value="jdbc:mysql://localhost:3306/prodmgmt"/>
                <property name="toplink.jdbc.user" value="root"/>
                <property name="toplink.jdbc.password" value="root"/>
                <property name="toplink.logging.level" value="INFO"/>
            </properties>
        </persistence-unit>
</persistence>

Thank you in advance

Regards
Binu K Idicula


-----Original Message-----
From: ext Wouter van Reeven [mailto:wouter_at_van.reeven.nl]
Sent: Wednesday, January 09, 2008 10:36
To: persistence_at_glassfish.dev.java.net
Subject: Re: Regarding mysql - class not found from toplink

Hi,

On Wed, Jan 09, 2008 at 11:07:05AM +0200, binu.idicula.ext_at_nsn.com
wrote:
> I am using mysql as my database and the persistence is working with
> toplink when I use it from EJB. However if I use persistence from a
> J2SE environment as mentioned in examples by giving -javaagent option,

> it says Driver could not be
> found: class not found. I have set the mysql database driver in the
> system class path variable and it is visible to all applications.
>
> Could you please provide some information about this issue?

Can you give us some more info please? What version of the mysql driver
are you using? What driver did you specify in persistence.xml?


Wouter van Reeven

-- 
People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"