dev@glassfish.java.net

injection-target?

From: Peter Williams <Pete.Williams_at_Sun.COM>
Date: Fri, 21 Sep 2007 12:08:03 -0700

Is the <injection-target> element supposed to be a valid element in a
user's JavaEE5 standard descriptor file?

The spec is somewhat vague, but near as I can tell this should be legal
and in fact is the correct way for the deployer role to override an
annotated injection dependency without recompiling.

The javaee5_xsd includes a definition of this type but the various type
definitions for the reference types for which this ought to be valid do
not include it as a child. The end result is that if you use this in a
project (say inside NetBeans), the XML parser will declare your
descriptor file as invalid with an error. For example, a service-ref
with an injection-target node, the error is "cvs-complex-type.2.4.a:
Invalid context was found starting with element 'injection-target'. One
of '{"http://java.sun.com/xml/ns/javaee":port-component-ref,
"http://java.sun.com/xml/ns/javaee":handler,
"http://java.sun.com/xml/ns/javaee":handler-chains}' is expected."

An application using this will pass the verifier though.

So, are the descriptor schemas for JavaEE5 broken? Is the JDK's XML
schema based validating parser broken? Or is there some other spec
weirdness going on here (such as this entry is only for use by the server)?

Thanks for any info.
-Peter