aspose file tools*
The moose likes JBoss/WildFly and the fly likes EJB3 DEployment descriptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "EJB3 DEployment descriptor" Watch "EJB3 DEployment descriptor" New topic
Author

EJB3 DEployment descriptor

mohsin.wk khan
Greenhorn

Joined: Aug 17, 2009
Posts: 2
How to deploy EJB 3 Statlessbean on the Jboss Server.........
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

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


SCJP, SCJD, SCWCD, OCPJBCD
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5830
    
    7

Another possibility is to package your EJB in a JAR file and copy the JAR file to the server/xxx/deploy directory.


JBoss In Action
Omar Al Kababji
Ranch Hand

Joined: Jan 13, 2009
Posts: 357
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.


Omar Al Kababji - Electrical & Computer Engineer
[SCJP - 90% - Story] [SCWCD - 94% - Story] [SCBCD - 80% - Story] | My Blog
V Sahdev
Greenhorn

Joined: Jun 18, 2008
Posts: 14
I doubt Stateless bean need persistence.xml
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

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

Joined: Jan 13, 2009
Posts: 357
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB3 DEployment descriptor