File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes [JAXB] StringBuffer element issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "[JAXB] StringBuffer element issue" Watch "[JAXB] StringBuffer element issue" New topic

[JAXB] StringBuffer element issue

Kris Lee

Joined: Feb 23, 2011
Posts: 1
When marshaling an object via JAXB with a StringBuffer attribute, that attribute becomes blank. I wrote a small program to demonstrate the problem:

The output is as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><jaxbTest><valueOne>12345</valueOne><valueTwo/></jaxbTest>

Does anyone know why "valueTwo" is not being marshaled correctly? BTW, i am using java 1.6.0_22.

Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3152

What is the Schema you are using for generating the XML?

Mohamed Sanaulla | My Blog
I agree. Here's the link:
subject: [JAXB] StringBuffer element issue
It's not a secret anymore!