- This topic has 5 replies, 3 voices, and was last updated 20 years, 2 months ago by Horacio.
-
AuthorPosts
-
HoracioMemberhi:
we are wondering which would be the best choice for ejb development, since we understand 2 options are avaible with myeclipse:
1. build all ejbs into one EJB project
2. build each ejb into its own EJB projectthanks
🙂
Riyad KallaMemberI will asked a more experienced EJB person about this.
support-michaelKeymasterHere is a thought process I went through when I first read your inquiry:
1) What is the relationship between the EJBs? Are they tightly coupled and need to be part of a common deployment or are they independent to the point that they can be deployed separately?
The concern is to avoid artificially separating naturally coupled services/entities. +1 for single project if your services are tightly coupled services.
2) Will the EJBs be developed and delivered along the same timeline.
The concern is if you will be developing and deploying services at different rates then a single project introduces potentially more complex configuration managment practices and discipline. +0.5 for partitioning EJBs to multiple projects. But then again version/branching can provide similar support. We use CVS branches for this purpose.
3) How important is it to your team to work with ME’s deployment model for realtime deployment and debugging?
The concern is that for multiple EJB projects ME requires that they be packaged and deployed as an EAR. So you would need to create your EJB projects and an EAR project. Also, the ME dependent project/jar feature for web projects has not yet been extended for EJB project support. Therefore you may have to do some configuration of the EAR manually. -1 for multiple EJB projects in general.
I would need to learn more about your project architecture (e.g., web app+ejbs+mdb+connector+db+….) and your team size and dynamics to provide much more input. What I can share with you is that the last few projects our consulting team has assisted with they used EJB’s sparingly and typically developed them as a single EJB project.
HoracioMemberLet’s say I have a Web Project, an EJB Project (with multiple EJBs inside it), and a Java Project (wich contains plain Java classes), al included in an EAR Project.
How do I deploy the Java Project along the rest of the deployment?
So far we deployed all of the components except the plain-Java ones. Those classes are correctly referenced, but not included in the deployment.
Thanks.
support-michaelKeymasterIf the Java project is only required to support the WebProject then make it a dependent project of the Web Project. Doing this will allow it to be deployed as a dependent project of the webapp and you’re good to go.
If it is a common Java project used by the EJB and Web projects then it must either (1) be merged into the EJB project or (2) deployed as a separate Jar in the EAR.
Let start with (2). This is the traditional J2EE deployment model. It requires the EJB project’s MANIFEST.MF file include a ClassPath: entry to reference a Jar file containing the contents of the Java project. (Starts to get a little complicated.) ME does not yet provide this level of automation so what some developers do is create a jardescription or Ant script that jar’s the Java project and copies the resulting jar to the EAR project. Then the EJB project’s build-path is modified to reference the jar in the EAR project. Ultimately ME will support this level of automation but for now this is the manual part of the process. The ME EAR deployer will package the Web and EJB projects into respective WAR and EJB Jar files that are packaged in an EAR archive and distributed to your appserver.
Now for (1) what I do is set the output location of my utility Java project(s) to the output location of the EJB project. This effectively merges the Java project into my EJB project, makes the classfiles visible to the web project, and allows the Java project’s classfiles it to be deployed as part of the EJB project. This workaround works great except for you have to remember that doing a build-all on your EJB project will blow away the Java project’s output in the process. So I just run “clean” on my EJB project followed by a “clean” on my Java project to keep the EJB project’s output content consistent with the source code.
I hope this helps.
HoracioMemberHi again.
Can you give me a detailed example of this (or link to it, if it’s already documented) and an example manifest/jardescription/ant script?
So far we couldn’t get it to work like (2), and (1) we don’t really like, because the idea is to separate the POJOs from the EJB/Web project (both of them depend on it).
Thanks -
AuthorPosts