Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

EJB3 DEployment descriptor

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to deploy EJB 3 Statlessbean on the Jboss Server.........
 
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
 
author
Posts: 5856
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.
 
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.

 
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic