users@glassfish.java.net

Re: Where is this file deployment descriptor ?

From: <hong.hz.zhang_at_oracle.com>
Date: Wed, 28 Dec 2011 10:47:38 -0500

> First of all thank you for your response.
> I inform you that I work with Java EE version 5.
> I did not find the file "ejb-jar.xml" in the installation directory of
> Glassfish. It is I who created the file "ejb-jar.xml".
> This file exists only in the working folder of my application and
> exactly in
> the EJB module.
> But I found in the directory: C: \ glassfish3 \ glassfish \ lib \ schemas
> the following files: "ejb-jar_2_1.xsd", "ejb-jar_3_0.xsd" and
> "ejb-jar_3_1.xsd"
> 1) - These three files which file this deployment descriptor knowing
> that my
> Java EE version 5 ?
The ejb-jar_3_0.xsd is the one that's part of the Java EE 5
(ejb-jar_3_1.xsd is part of the Java EE 6).
> - How I can know with which version of EJB I'm working on EJB 3.1 or
> EJB 3 ?
Are you using any EJB features that are only defined in EJB 3.1 Spec
(which is part of the Java EE 6), if yes, you need to use ejb-jar_3_1.xsd.
> 2) - Are these files the extension "*. xsd" for example
> "ejb-jar_3_0.xsd" can
> be changed.
> - Is that possible instead of creating a file "ejb-jar.xml" then it
> changes
> the contents of file "ejb-jar_3_0.xsd" ?
You don't use schema file directly in the application, you write an
ejb-jar.xml (which should be conformed to the referenced schema syntax).
If you are not familiar with the schema syntax, it's best to have a tool
generate it for you.
> If so, then I will put the following code in part of "ejb-jar_3_0.xsd"
> ? :
> <? Xml version = "1.0" encoding = "UTF-8"?>
> <Ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee"
> version = "3.0"
> xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
> xsi: schemaLocation = "http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd ">
> <interceptors>
> <interceptor>
> <interceptor-class> com.jmd.test.domaine.ejb.MesurePerfIntercepteur </
> interceptor-class>
> </ Interceptor>
> </ Interceptors>
>
> <assembly-descriptor>
> <interceptor-binding>
> <ejb-name> * </ ejb-name>
> <interceptor-class> com.jmd.test.domaine.ejb.MesurePerfIntercepteur </
> interceptor-class>
> </ Interceptor-binding>
> </ Assembly-descriptor>
> </ Ejb-jar>
> 3) I wanted to add an external file "jamon-2.73.jar" (API) but I do
> not know
> in what location of the installation directory of Glassfish 3 I'll add
> more
> as I have folders named "lib" that exist in the following directories: ?
> C: \ glassfish3 \ glassfish
> C: \ glassfish3 \ install
> C: \ glassfish3 \ javadb
> C: \ glassfish3 \ mq
> C: \ glassfish3 \ pkg
> C: \ glassfish3 \ updatetool
> C: \ glassfish3 \ domains \ domain1
> C: \ glassfish3 \ domains \ pet
> C: \ glassfish3 \ glassfish \ domains \ pet \ applications \ jamon \
> WEB-INF
> \ lib
> I inform you that "pet" is the domain on which I work. By default
> there is
> the domain "domain1".
One simple option would be to place it in domains/domain1/lib (there are
differences between various lib directories which are documented in the
GlassFish doc).
> 4) If I have a Java EE application server deployed on Glassfish V3 so
> how I
> can access this application I do not know the source code for this
> application? From which file I can find the names of classes, these
> methods ?
Where did you obtain the application, did it come with any instruction
of how to run it?

If you want to learn more about Java EE and GlassFish, I strongly
recommend you to read the Java EE tutorial
(http://docs.oracle.com/javaee/6/tutorial/doc/) and GlassFish
Application Developer Guide
(http://docs.oracle.com/cd/E18930_01/html/821-2418/index.html).

- Hong