users@glassfish.java.net

Re: problem with annotation after adding ejb-jar.xml

From: Hong Zhang <Hong.Zhang_at_Sun.COM>
Date: Wed, 30 Apr 2008 12:00:47 -0400

Hi,
   There is an attribute "metadata-complete" in ejb-jar.xml (and other
JavaEE5 deployment descriptors) which is used to indicate whether all
the metadata information is in deployment descriptor. When this
attribute is set to true, we will assume everything is from deployment
descriptor and will not process any annotations. The default value for
this attribute is false.

   Can you check if this attribute in your ejb-jar.xml is set to true?
Something like this:

<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
metadata-complete="true" version="3.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">


  - Hong



glassfish_at_javadesktop.org wrote:

>I am developing my first application on glassfish.
>
>Its ear, there are some session beans. One of them is webservice.
>
>I've been using only annotations.
>I wanted to have possibility to define some properties that can be change without recompiling application. I've first thought that can be put in some properties file, but I realized that <env-entry> in ejb-jar.xml is a good place to put such kind of properties.
>
>But after adding simple ejb-jar.xml with one session bean mentioned and <env-entry> for it annotations were no longer interpreted.
>All annotations are now ignored. @EJB for example, there is no injection. References are null.
>
>When I delete ejb-jar.xml everything is fine.
>
>I've read in many places (books, forum) that deployment descriptors can override annotations, but not turn off other setting.
>
>Am I doing something wrong?
>Is there any configuration in glassfish to turn on both annotations and deployment descriptors?
>[Message sent by forum member 'przemekp' (przemekp)]
>
>http://forums.java.net/jive/thread.jspa?messageID=272242
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>