facebook

Web project and EJB session beans?

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #313643 Reply

    dason
    Member

    I can create a web project that supports JSF, ICEfaces and other features. In addition, I can right click on the project, go to the MyEclipse menu and select “Add JPA Capabilities…” if I wish to create JPA/entity beans.

    I can create an EJB project that will let me create stateful and stateless EJB 3.0 session beans.

    However, I can’t seem to create a web project that will let me add EJB 3.0 session beans. Unless I am missing something, session beans and web projects seem to be mutually exclusive.

    My question: what if I wish to add EJB 3.0 session beans to a web project? How would I do it?

    Was this something deliberately left out, or am I missing something?

    If it was deliberately left out, why? If you are trying to separate different application components into different projects, I get that, but why allow JPA in a web project then?

    Thanks for the help,
    Dave

    installation details below —>

    *** Date:
    Tuesday, January 11, 2011 5:18:20 PM EST

    ** System properties:
    OS=WindowsVista
    OS version=6.1.0
    Java version=1.6.0_13

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 8.6.1
    Build id: 8.6.1-20101117

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: 8.6.1
    Build id: 8.6.1-20101117

    #313696 Reply

    dason
    Member

    Tech Support,

    I would really appreciate an answer to this question.

    Thank you,
    Dave

    #313730 Reply

    support-swapna
    Moderator

    dason,

    I will have a dev team member answer this question for you.

    #313777 Reply

    Brian Fernandes
    Moderator

    Dason,
    Sorry for the delayed response. Yes, the experience you described is by design.

    A simple way of looking at it is that EJB projects are quite different from standard web projects; most importantly in how they are deployed and how they are loaded. You will notice different structures and different configuration files are required – i.e. ejb-jar.xml in an EJB project which corresponds to the web.xml file in a Web project. I’m not aware of any Java EE servers which would handle both these sorts of files in a single deployable unit, though I can’t say I have tried.

    As far as JPA is concerned, while EJB 3.x does use JPA for persistence, JPA does stand alone as well. JPA projects do not need special deployment nor do they need a full Java EE 5 server to work – they could work even in Tomcat without any modifications.

    In short, the division is present not because we at MyEclipse want you to separate different layers of your application, but because this separation is warrted by the Java EE spec and deployment constraints.

    Hope this helps.

    #313794 Reply

    dason
    Member

    Your explanation makes sense.

    Thank you.

    Dave

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Web project and EJB session beans?

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