File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes EJB 3.0 entity bean with mysql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 3.0 entity bean with mysql" Watch "EJB 3.0 entity bean with mysql" New topic

EJB 3.0 entity bean with mysql

Faraz Ali
Ranch Hand

Joined: May 15, 2008
Posts: 108
Hi All,

I created a persistance class, and a session bean to presist the data.
Below is my persistance.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="" xmlns:xsi="" xsi:schemaLocation="">
<persistence-unit name="test1">

When i am deploying this application, it gives me error that persistance.xml is incorrect. How to fix it?

Secondly, i created tables in mysql database, now i want to configure my mysql db with ejb. how to do this?

I want all my entity bean data to be stored in mysql db. And where to place mysql driver jar file? Can you guys help me on this?

Thanks a lot.
Jair Rillo Junior
Ranch Hand

Joined: Aug 27, 2008
Posts: 114
Hey There,

First of all, give us more information, like: which exception did you get? Which Application Server you're deploying your application? Where did you put that file? (In WEB-INF/classe/META-INF/persistence.xml ??)

About the MySQL, it seems you're using a DataSource. It is working properly? If you're using the DataSource with MySQL Driver, it must be in the Applicatoin Server lib folder. If you won't to use DataSource, you must change the persistence.xml file

Regards, Jair Rillo Junior, SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 5.0, IBM SOA Associate (Test 664).
I agree. Here's the link:
subject: EJB 3.0 entity bean with mysql
It's not a secret anymore!