users@jaxb.java.net

Re: new bee jaxb

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Sat, 6 Mar 2010 08:30:54 +0100

The answer is in the stack dump: GrantsDTO requires to have a
no argument constructor.
-W

On Sat, Mar 6, 2010 at 4:09 AM, fachhoch <fachhoch_at_gmail.com> wrote:

>
> I am trying to run this simple class to marshall
>
> here is the code
>
>
> public class WSClient {
>
> public static void main(String[] args) throws Exception {
>
> JAXBContext
> jaxbContext=JAXBContext.newInstance(GrantsDTO.class);
> Marshaller marshaller= jaxbContext.createMarshaller();
> GrantsDTO grantsDTO= new GrantsDTO();
> grantsDTO.setGranteeName("grantee_name");
> grantsDTO.setGrantNumber("grantNumber");
> marshaller.marshal(grantsDTO, new File("c:\\test.xml"));
>
> }
>
>
>
> }
>
> here my grantsDTO
>
> package gov.hhs.acf.util.ws.grants.model;
>
> import javax.xml.bind.annotation.XmlRootElement;
>
>
> @XmlRootElement
> public class GrantsDTO {
>
> private String grantNumber;
>
> private String granteeName;
>
> public String getGrantNumber() {
> return grantNumber;
> }
>
> public void setGrantNumber(String grantNumber) {
> this.grantNumber = grantNumber;
> }
>
> public String getGranteeName() {
> return granteeName;
> }
>
> public void setGranteeName(String granteeName) {
> this.granteeName = granteeName;
> }
>
>
>
> }
> I end up with this exception please tell what is this error and how to
> resolve this ?
>
>
> --
> View this message in context:
> http://old.nabble.com/new-bee-jaxb-tp27801706p27801706.html
> Sent from the java.net - jaxb users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>