users@glassfish.java.net

Can't apply JAXB nillable=true to arrays of objects in WS APIs

From: <glassfish_at_javadesktop.org>
Date: Tue, 09 Oct 2007 08:54:40 PDT

@XmlElement(nillable=true)
    private String[] productCodes;

If I include a class with this member (which has the appropriate accessors) in my web service API then when I deploy to Glassfish I get this error:

     [exec] CLI171 Command deploy failed : Deploying application in domain failed; Unable to create JAXBContext due to the security restriction

but if I comment out the XmlElement it deploys perfectly.

On Oracle AS (OC4J 10.1.3.1/3) it deploys either way.

This seems to apply to arrays of any object (all of which are serializable) but not arrays of primitive types eg byte[]. Is this a bug or a feature which I can work around somehow, and if so, how ? It seems reasonable to expect arrays to be nullable and I have used arrays for collections in general because .NET and Flash interoperability is enabled (otherwise using arrayLists causes other problems).
[Message sent by forum member 'richliv' (richliv)]

http://forums.java.net/jive/thread.jspa?messageID=239124