Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3220632
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:47:02+00:00 2026-05-17T15:47:02+00:00

I have just begun reading up on EJBs. Even as I venture into it

  • 0

I have just begun reading up on EJBs.

Even as I venture into it I have a few questions based on what I have heard about them.

  1. Do applications using EJBs always have to be deployed as an EAR?
  2. Can applications containing EJBs be deployed just like other other java web projects using ECLIPSE and without using ANT?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:47:02+00:00Added an answer on May 17, 2026 at 3:47 pm

    1.Do applications using ejb’s always have to be deployed as EAR ?

    No.

    The EJB module is assembled into a JAR, lets call it myapp-ejb.jar as a naming convention.

    This contains the EJB code as well as the deployment descriptor file called ejb-jar.xml in EJB 2.x. In EJB 3.0, the code itself contains the annotations required for the server to understand for deployment, so the deployment descriptors are optional. The deployment descriptor/annotations cover basic stuff needed for EJB deployment like the JNDI, DataSource look up etc.

    A collection of multiple EJB modules and other Web modules (war) together make up an EAR. As @Isaac pointed out, an EAR doesn’t have to include any WAR file in it. The only condition for an EAR file is to contain at least one J2EE module of any kind.

    The EAR needs a META-INF/application.xml which lists all the EJB jars and wars present in the EAR. So you go for an EAR when you have multiple EJB modules which is usually the case, hence the usual deployment is of an EAR.

    An example of this file is shown below taken from http://download.oracle.com/docs/cd/B32110_01/web.1013/b28221/undejdev003.htm. This is a good article for you to read.

    <application>
      <display-name>master-application</display-name>
      <module>
        <ejb>ejb1.jar</ejb>
      </module>
      <module>
        <ejb>ejb2.jar</ejb>
      </module>
      <module>
        <java>appclient.jar</java>
      </module>
      <module>
        <web>
            <web-uri>clientweb.war</web-uri>
            <context-root>webapp</context-root>
        </web>
      </module>
      <module>
        <ejb>ejb3.jar</ejb>
      </module>
    

    2.Can applications containing EJB’s be deployed just like other other java
    web projects using ECLIPSE and without
    using ANT

    Yes, once an EAR/JAR is assembled it can be deployed into a server (via Eclipse if you wish).

    Ant is a build tool which has nothing to do with the actual deploying of the EJB code. It is used to compile and assemble the JAR – which can be done from Eclipse as well.

    Here is a tutorial which does just that.

    Further Reading

    Packaging Applications

    Packaging EJB3 Applications

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm reading about the State pattern. I have only just begun, so of course
I've just finished reading 'Java for Dummies' and have begun to create a simple
I have been reading a lot about Reinforcement Learning lately, and I have found
So I have begun learning OpenGL, reading from the book OpenGL Super Bible 5
I have just begun working on a C# application (using log4net). I'm supposed to
I have just begun learning Python. Eventually I will learn Django, as my goal
I'm using Titanium Studio (1.0.0.201104272233) and Titanium Developer (1.2.2) and have just begun my
Hey! I've just begun fiddling with pinvoke and have encountered a problem. I'm getting
I have just begun playing with MooTools, and I don't understand why the following
I have just begun to learn JS. I am trying to change the value

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.