persistence@glassfish.java.net

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

From: <binu.idicula.ext_at_nsn.com>
Date: Mon, 14 Jan 2008 17:34:16 +0200

Yes. A Normal JDBC program works. But persistence fails in stand alone.
However persistence works in EJB context.

It prints a message that <jta-data-source> will be ignored, even if I
have it

Regards
Binu K Idicula

-----Original Message-----
From: Marina.Vatkina_at_Sun.COM [mailto:Marina.Vatkina_at_Sun.COM]
Sent: Wednesday, January 09, 2008 18:45
To: persistence_at_glassfish.dev.java.net
Subject: Re: Regarding mysql - class not found from toplink

Hi Binu,

Does a plain jdbc test work correctly in the same environment?

Try removing/commenting out <jta-data-source> - you should be using
either it or the jdbc properties.

Regards,
-marina

binu.idicula.ext_at_nsn.com wrote:
> 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.EntityManagerFactoryProvi
> de
> 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
>