1 of 1 people found this helpful
JEE 5 (and previous versions of J2EE) projects does not allow mixing ejb and servlets in the same project, that is changing in JEE 6 though.
That means that base WTP eclipse does not have support for mixing these two things, BUT neither had JBossIDE 1.5 or 1.6 - you were simply not using the WTP parts at that time.
But note, nothing prevents you from adding java code that are EJB's - that is what was available in JBossIDE before and is still completely ok in JBoss Tools.
J2EE 1.4 Project (if that is the JBoss Tools thing you refer to, was as far as I recall purely a Java project with classpath containers ?).
I don't believe that offered more than a Dynamic Web Project did.
Anyway create an EAR project and you will have a project that supports both ear, ejb etc. the source will just be stored in different directories.
thank you for the quick answer.
I am struggling a little with creating the project-structure and the packaging.
For the JBossIDE there was a very good tutorial "An introduction and walkthrough of JBossIDE 1.4". These examples describe step by step how to build an J2EE-application containing Servlets & EJBs. After this walkthrough the reader knows enough to create and build own projects. I miss such a tutorial for the current JBoss Tools 3.
Yes, there is a "Getting Started with JBoss Developer Studio April 2008" tutorial, but it's not as comprehensive as the JBossIDE-tutorial, and I miss the EJB-part.
And yes, there is the Anghel Leonard-book "JBoss Tools 3" that I have bought. The examples are good, but I still miss the EJB-part.
I believe it's not difficult to create and package EAR-files including Servlets & EJBs with Eclipse and the JBoss Tools, but you must know the doing. Is there really no tutorial or introduction which can guide me?
I think there are two possibilities:
1. All in one
Create a Dynamic Web Project and extend it with some session-beans, so that I have Servlets & EJBs in one project. After that, use the "project archives" to create a WAR, an EJB-JAR and an EAR.
2. Three separate projects
a) File / New / Other / Web / Dynamic Web Project
Only for the WAR.
b) File / New / Other / EJB / EJB Project
Only for the EJB-JAR.
c) File / New / Other / Java EE / Enterprise Application Project
Only for the EAR containing the WAR from a) and the EJB-JAR from b).
What is the better approach? Or is there another way?