Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Folder Structure for J2EE applications

Posted on 2005-03-04
Medium Priority
Last Modified: 2013-12-10
I am new to websphere and I am not very sure about how the ear file is deployed on this server. From what I understand on J2EE, the ear file structure is supposed to be like this:
   -- WAR

My War structure is like this:
       -- other folders like scripts, styles, tiles(i am working on a struts application)
                 -- struts-config.xml
                          --application pacakage
                       --Contains the struts tld.
I have been working on Iplanet app server and in this server it is possible to include the ejb files in the ear file and the stub and skeletal classes are generated on deployment.
However, I am not sure about how the ejb folder structure should be in the ejb jar file in websphere.

what are the various classs files that are supposed to be in this jar(bean, remote,etc) and how does the websphere application server generate the stubs and skeletal classes for the ejb. Does it generate on deployment or we have to generate is before deployment, package the generated class files in a jar file for the ejb.

Basically I would like to know the what the entire folder structure of a EAR file should be and its sub components and their folder structure. How are the ejb's compiled, the entire deployment process. I am totally lost as of now and if any one could help me, I would be grateful to that person.
Thanks in advance.
Question by:SumitSinghRawat

Expert Comment

ID: 13460804
EAR project:


EJB project:

web project:
  >any files and folders you want
    >any tlds
      >any jars
      >your packages


Accepted Solution

damonf earned 1000 total points
ID: 13460855
I think what you want to do is use the Application Assembly Toolkit (AAT), now known as WAS Assembly Toolkit.  You will assemble and EAR project, an EJB project, and a web project.  The web and EJB projects will be children of the EAR project.  Then you install the EAR on your server using the admin console.  The "wizard" that installs your app has a checkbox "deploy EJBs".  Check that, and it will generate the stubs and ties for you.  I think in the toolkit you can also generate stubs and ties before you build the EAR, in which case you won't need to redeploy when you actually install the EAR.

If you use WSAD, just run "generate deploy and RMIC code" and then build your EAR file.  Then you can just install it on the server.

Author Comment

ID: 13461080
Thanks for the folder structure, you are absolutely right on using the AAt but I have a trial version of WAS 5.1 and it does not have the AAT and I have tried getting hold of it but I have not been successful :(. Infact I spent the last 4 days hunting for it but it is not available and I got hold of one from the IBM site but the installer launches and then disappears, it does not proceed further.
Just of confirmation ,my understanding is, build the ear file(I am currently using the jar utility to generate the ear file), with the WAR and EJB jar inside the ear file and the folder structure of the EJB is clear to me (very similar to what it should be for weblogic ), and when I deploy the EAR file, the admin console of the server will generate the stubs and ties for me.
Correct me if I am wrong.
However if I get hold of the AAT then I dont have to do that also, the AAT will generate the stubs and ties for me. To be honest, I dont have any tools with me right now, I am doing this by manually writing and compiling things. The only tool that I have is eclipse, I know it is tough but I have to live and work with this till I get hold of the tools.
Is there any other thing that I need to consider while deploying the EAR file.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 13461606
the process you describe sounds right to me.  Good luck.

Expert Comment

ID: 13546509
If you have J2EE sdk 1.3 (WAS 5.1 supports J2EE 1.3), it includes a Application Assembly tool called "deploytool.bat" in bin folder. Its a gui tool, it helps you to create application bundle ranging from JAR, WAR and EAR. I believe it won't create any stub code. I think its the task of application server. Let you create the EAR file and leave the rest to the J2EE app server.

Expert Comment

ID: 21817142
I personally recomment using ANT to create a build script which build your EAR. this way you can have different build scripts which create versions of your JARS, WARs and EAR as required for different scenarios. If you require examples, I will have to create one. Let me know and provide. This is the correct Enterprise way of doing things as it can also be augmented into auto deployment processes common in Enterprise level deployments. Learn to do this properly now, will pay dividends later.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
Upgrading Tomcat – There are a couple of methods to upgrade Tomcat is to use The Apache Installer is to download and unzip and run the services.bat remove|install Tomcat6 Because of the App that we are working with, we can only use Tomcat 6.…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Loops Section Overview
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question