This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
1. Create an EJB3 project
2. Write an ANT file that will compile your EJB classes and deploy them to JBoss
for the persistence.xml file you should provide something like this:
finally you need a Data Source to connect to the Database, you could find most Database data sources under the directories of JBoss for JBoss 5 its under you will find them under the directory <JBoss>/docs/examples/jca
choose the appropriate data source for you database and modify it.
Omar Al Kababji - Electrical & Computer Engineer
[SCJP - 90% - Story] [SCWCD - 94% - Story] [SCBCD - 80% - Story] | My Blog
You are right you can build an ear (and deploy it) without to have a persistence.xml, but this will be atypical.
An classical enterprise application has 4 layers and one is the persistence layer (and this one requires the persistence.xml). I can not imagine a real situation when you build a enterprise application only with stateless beans.
Omar Al Kababji
Joined: Jan 13, 2009
Yes you are both right you don't need persistence.xml if your EJB jar will contain only session beans, its needed only if you want to use JPA. but I supposed that since its EJB3 it would need JPA sooner or later.