Kevin Duffey wrote:

Hi,
Here is a little doc I put together that shows the ear layout with some
components from the J2EE demos. As you can see, J2EE puts a app server specific
file into the ears.

When I autodeployed an app into Orion, it inserted the file as you asked but I
had no luck getting any of the J2EE or the Orion EJB examples to work. All the
examples deployed but the orion one didn't let me past a security error which I
posted previously and I didn't even try to get the J2EE stuff to work since I
couldn't get the Orion EJB examples to work.

I general, I have seen no posts that have helped me get the EJB stuff working.
My thought is that if anybody does have it working, they aren't telling.
Probably because it's involved and if you don't know the specs by
heart-especially the xml deployment descriptors, it's hard to do. IMHO

Hope the doc helps you anyway,
Eric

> Hi all,
>
> Ok..I got everything working, but I am lost on one thing. I set up my
> folders as such:
>
> c:\applications\myapp
> c:\applications\myapp\META-INF
> c:\applications\myapp\META-INF\application.xml
> c:\applications\myapp\www
> c:\applications\myapp\www\WEB-INF
> c:\applications\myapp\www\WEB-INF\classes
> c:\applications\myapp\www\WEB-INF\lib
> c:\applications\myapp\www\WEB-INF\web.xml
>
> Now, I set up an application in server.xml, and directed the "default" dir
> in default-web-site.xml to point to my applications\myapp\www dir. When I
> run Orion, it auto-deploys, and the pages come up. I found out that
> apparently I am to put a orion-web.xml in the WEB-INF folder as well, and
> that I have to set the <classpath path="classes" /> tag in there in order
> for the application to see my root classes dir where I put my base package
> in (expaned..not jarred). What I am confused about is when I start Orion,
> below the META-INF folder it creates a www dir as well, and puts
> orion-web.xml in there. It doesn't put it in META-INF\www\WEB-INF, it puts
> it in META-INF\www. Why is this? Is this how J2EE is supposed to work? I
> thought that when I deploy a .ear or .war, I dont need any server specific
> files in that dir, yet it seems I do with Orion. Does Orion automatically
> add this orion-web.xml into a .war or .ear file if being deployed as well?
>
> Now, my next thought is that maybe I have something wrong in one of the
> config files. In META-INF/application.xml, I have the display name set to my
> application name (in this example, myapp), and I have
> <web-uri>../www</web-uri>. When I had it set to just www, I could not get my
> pages to show up.
>
> If there is any info anyone can give..that would be great. Also, do I need
> to display any .xml config files for you to help you solve this..let me know
> and I'll post it.
>
> Thanks.
Title: J2EE EAR File Structure

Overview

The Enterprise Application Archive (EAR) file is the only file needed to deploy a J2EE application. It contains all the Enterprise Java Beans (EJB) JAR files and the Web Application Archive (WAR) files. It also contains all the Extensible Markup Language (XML) deployment descriptors and other XML files needed for deployment. The J2EE application server can insert it's own files as needed that are not part of the J2EE specification.

File structure

The following shows the files in an EAR for the ProductApp released with the reference edition of J2EE. It has Container Managed Persistance (CMP) but no web component or client application. These will be shown later in this document.

  • ProductApp.ear
  • ejb-jar1813.jar
  • META-INF
  • MANIFEST.MF
  • application.xml
  • sun-j2ee-ri.xml
  • The contents of the MANIFEST.MF files contain no special information. The following is the content of application.xml file.

    <?xml version="1.0" encoding="UTF-8"?>
    
    <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN' 
    'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>
    
    <application>
      <display-name>ProductApp</display-name>
      <description>Application description</description>
      <module>
        <ejb>ejb-jar1813.jar</ejb>
      </module>
    </application>    
    

    Each server may have server specific configuration file. Follow the following link to look at the sun-j2ee-ri.xml file. Now we will look at the structure of ejb-jar1813.jar.

  • ejb-jar1813.jar
  • ProductHome.class
  • Product.class
  • ProductEJB.class
  • META-INF
  • ejb-jar.xml
  • MANIFEST.MF