title: jaxb2Marshaller unmarshals XML into an empty byte arra
body: <p>here's the problem.
  I'm using Spring 3.0.4 to create a rest web service (and actually I am a novice).
  I want to persist an object via hibernate passed by the client as an XML representation. To accomplish this task I use jaxb2.</p>
  
  <p>The object the client send is a node having two sons objects, namely data and metadata.</p>
  
  <p>the problem is that when the client sends its XML the SIUserData is unmarshalled in an umpredictable byte[] array: sometimes a part of the imput is cut away and sometimes it is simply empty.</p>
  
  <p>for example this input</p>
  
  <pre><code>&lt;.SINode&gt;
      &lt;.SIUserMeta&gt;a lot of meta&lt;./SIUserMeta&gt;
      &lt;.SIUserData&gt;BBB&lt;./SIUserData&gt;
  &lt;./SINode&gt;
  </code></pre>
  
  <p>is unmarshalled in an object with an empty StorageInterfaceData content attribute.</p>
  
  <p>I believe the problem affects the handling of byte[] since I tryied to change the type of StorageInterfaceData content attribute in a String end everything works fine :S .</p>
  
  <p>It follows the code.</p>
  
  <p><strong>node</strong></p>
  
  <pre><code>@Entity
  @Table(name="sinode")
  @XmlRootElement(name="SINode")
  public class StorageInterfaceNode extends BulkObject  implements Serializable{
  
  
      private Integer id;
      private String name;
      private StorageInterfaceMetadata metadata;
      private StorageInterfaceData data;
  
      public StorageInterfaceNode() {
          super();
          // TODO Auto-generated constructor stub
      }
  
      public StorageInterfaceNode(Integer id, String name, StorageInterfaceMetadata metadata,
              StorageInterfaceData data) {
          super();
          this.id = id;
          this.name = name;
          this.metadata = metadata;
          this.data = data;
      }
  
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      @Column(name="id", unique=true, nullable=false)
      @XmlTransient
      public Integer getId() {
          return id;
      }
  
      public void setId(Integer id) {
          this.id = id;
      }
  
      @XmlTransient
      @Column(name="name", unique=true)
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
  
      @OneToOne(cascade= CascadeType.ALL)
      @XmlElement(name="SIUserMeta")
      public StorageInterfaceMetadata getMetadata() {
          return metadata;
      }
      public void setMetadata(StorageInterfaceMetadata metadata) {
          this.metadata = metadata;
      }
  
      @OneToOne(cascade= CascadeType.ALL)
      @XmlElement(name="SIUserData")
      public StorageInterfaceData getData() {
          return data;
      }
      public void setData(StorageInterfaceData data) {
          this.data = data;
      }
  
  }
  </code></pre>
  
  <p><strong>data</strong></p>
  
  <pre><code>@Entity
  @Table(name="data")
  public class StorageInterfaceData extends BulkObject implements Serializable{
  
  
      private Integer id;
      private String dataName;
      private byte[] content;
  
      public StorageInterfaceData() {
          super();
          // TODO Auto-generated constructor stub
      }
  
      public StorageInterfaceData(byte[] content) {
          super();
          this.content = content;
      }
  
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      @Column(name="id", unique=true)
      @XmlTransient
      public Integer getId() {
          return id;
      }
  
      public void setId(Integer id) {
          this.id = id;
      }
  
      @Column(name="name", unique=true, nullable=false)
      @XmlTransient
      public String getDataName() {
          return dataName;
      }
  
      public void setDataName(String dataName) {
          this.dataName = dataName;
      }
  
      @Column(name="content", nullable=false)
      @XmlValue
      public byte[] getContent() {
          return content;
      }
  
      public void setContent(byte[] content) {
          this.content = content;
      }
  }
  </code></pre>
  
  <p><strong>bulkobject</strong></p>
  
  <pre><code>@XmlTransient
  public class BulkObject {
  
      private Integer id;
  
      public Integer getId() {
          return id;
      }
  
      public void setId(Integer id) {
          this.id = id;
      }
  
  }
  </code></pre>
  
  <p>metadata class is omitted not to be too verbose.
  Can anyone clear the thing please?</p>