• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB3 DEployment descriptor

 
mohsin.wk khan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to deploy EJB 3 Statlessbean on the Jboss Server.........
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

You create a ear jar and you explode it in your jboss/server/default/deploy/YourApplication.

If you use eclipse then you can let the eclipse to do the deploy for you. Netbeans can also deploy (but I don't know if it supports JBoss).
See the http://www.jboss.org/community/wiki/ExplodedDeployment

Regards,
Mihai
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another possibility is to package your EJB in a JAR file and copy the JAR file to the server/xxx/deploy directory.
 
Omar Al Kababji
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose that you are using Eclipse:

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.

 
V Sahdev
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt Stateless bean need persistence.xml
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Sahdev

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.

Regards,
Mihai
 
Omar Al Kababji
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic