facebook

J2EE library container jars in MyEclipse projects

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #256729 Reply

    breako2
    Member

    Hi,
    I appreciate this may be a stupid question but I am new to MyEclipse and EJB.
    I have an MyEclipse web project.
    In the java buildpath libraries tab, there is a collection of jars underneath a folder named:
    J2EE 1.4 library container. Included are a range of J2EE 1.4 jars and some JBoss jars.
    For example:
    activation.jar, javax.servlet.jar, javax.servlet.jsp.jar, jboss-j2ee.jar, jboss-jaxrpc.jar etc.
    This jars are all in myeclipse plugin directories.

    Do they include an app server or something?
    It seems that myEclipse will include them automatically when I create a new Web or EJB MyEclipse project. Why does MyEclipse include them automatically? Why can’t I just reference standard J2EE jars? What is the roll of these myeclipse jars, what is their value add over J2EE jars, do they form an app server – a thin out JBoss or something?

    #256858 Reply

    Riyad Kalla
    Member

    Great questions. The issue is that at compile time, you need autocomplete and build support for all the J2EE 1.4 specification classes like Servlets, Filters, EJBs, etc. If you don’t have this classpath container in your build path, MyEclipse won’t be able to offer you any of these services and all your classes that extend or implement J2EE classes will give compilation errors.

    So to make things easier, we add these libraries to your build path for you and since JBoss is open source AND provides a full J2EE compliant implementation of the classes, we ship the JBoss libraries.

    Now if you choose to remove those libraries and add your own from your own app server, that is fine. But since a project is not required to be tied to an app server in MyEclipse, we can’t assume you even have an app server installed, so that’s why we ship and add these classes to your build path for you, so you can work anyway.

    #256930 Reply

    breako2
    Member

    Thanks for getting back Riyad. I’m still a bit confused.
    So in other words, Sun don’t provide a complete J2EE implementation and an implementation from 3rd party is required?
    What is the difference between standard J2EE libraries and App server libraries?

    I would be very grateful if you could give me a specific example, where you would run into trouble if you did not have these JBoss libraries? i.e. suppose I am developing a web appliation, with some
    simple servlets, why do I need JBoss or App server libraries?
    I appreciate this may sound stupid, but it would help me understand how the whole thing fits together.

    #256934 Reply

    Riyad Kalla
    Member

    So in other words, Sun don’t provide a complete J2EE implementation and an implementation from 3rd party is required?

    Well they did used to distribute the J2EE libraries for download, but they weren’t totally open source and had certain re-distrobution limitations on them, that may have changed now with GlassFish and Sun open-sourcing all their work now, but it wasn’t available back when we made that decision.

    I would be very grateful if you could give me a specific example, where you would run into trouble if you did not have these JBoss libraries? i.e. suppose I am developing a web appliation, with some
    simple servlets, why do I need JBoss or App server libraries?

    Real quick, remove the J2EE 1.4 Libraries from your build path, now try and develop a servlet:
    public class MyServlet extends Servlet{}

    save it, you should have a compilation error because “Servlet” cannot be resolved. That’s the problem, you have none of the reference J2EE classes to extend or implement without those libraries and every app server is required to ship them, so when you deploy your web application to your app server, it magically works cause the app server already provides those libraries.

    #257052 Reply

    breako2
    Member

    Thanks for getting back again, I understand that part clearly now.
    Do these jars play anyother role beside compilation, and code completion in the the IDE? Do they act like a container of any sort when a program is running and carry out behaviour that is associated with a container?
    I appreciate my questions are fundamental – your patience is much appreciated
    Thanks

    #257111 Reply

    Riyad Kalla
    Member

    Do these jars play anyother role beside compilation, and code completion in the the IDE? Do they act like a container of any sort when a program is running and carry out behaviour that is associated with a container?

    Not the classes that we ship, those are just provided for compilation, validation and autocomplete. Once your project is deployed to your app server, it loads up it’s own versions of those classes and then yes, the app server acts as a container for your web project and other web projects.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: J2EE library container jars in MyEclipse projects

You must be logged in to post in the forum log in