users@glassfish.java.net

Re: Where is this file deployment descriptor ?

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

> Hello,
> Thanks.
> 1)- So the file "ejb-jar_3_1.xsd" present the deployment descriptor.
> Is it ?
> I did not find the file "ejb-jar.xml" in the installation directory of
> Glassfish. Knowing that works with Java EE version 5.
> But I found in this directory theses files :"ejb-jar_2_1.xsd",
> "ejb-jar_3_0.xsd" and "ejb-jar_3_1.xsd".
Yes, the schemas are shipped with the GlassFish installation. The
application developers need to create the ejb-jar.xml based on the
schemas when needed.
>
> 2)- It is possible to modify the file "ejb-jar_2_1.xsd" ?
>
> - Where we put exactly in "ejb-jar_3_1.xsd" the next contents of the file
> "ejb-jar.xml" ? :
> <?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>
> Thanks.

No, you can not change the schemas, they are part of the specifications.
You should include the schema in the beginning of the ejb-jar.xml (like
you did now) so the parser could validate the ejb-jar.xml against the
declared schema, your ejb-jar.xml needs to conform to the referenced
schema.

- Hong