You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by fachhoch <fa...@gmail.com> on 2010/03/06 10:58:16 UTC

jaxb and my model

My webservices returns a simple pojo .For this pojo I want   jaxb to marshall
and unmarshall.

SO I am using jaxbDatabinder.

upon starting the server  application fails at creation of JaxbContext  

it complains 


com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of
IllegalAnnotationExceptions
net.sf.cglib.transform.impl.InterceptFieldCallback is an interface, and JAXB
can't handle interfaces.
	this problem is related to the following location:
		at net.sf.cglib.transform.impl.InterceptFieldCallback
		at public net.sf.cglib.transform.impl.InterceptFieldCallback
gov.hhs.acf.util.ws.grants.model.GrantsDTO.getInterceptFieldCallback()
		at gov.hhs.acf.util.ws.grants.model.GrantsDTO 


my model is GrantsDTO which is a simple pojo  here the code for this



package gov.hhs.acf.util.ws.grants.model;

import java.io.Serializable;



public class GrantsDTO   implements  Serializable{
	

	private String grantNumber;
	
	
	private String granteeName;
	
	public String getGrantNumber() {
		return grantNumber;
	}
	public GrantsDTO() {
		// TODO Auto-generated constructor stub
	}
	
	public GrantsDTO(String grantNumber, String granteeName) {
		this.granteeName=granteeName;
		this.grantNumber=grantNumber;
	}

	
	public void setGrantNumber(String grantNumber) {
		this.grantNumber = grantNumber;
	}
	public String getGranteeName() {
		return granteeName;
	}

	public void setGranteeName(String granteeName) {
		this.granteeName = granteeName;
	}
	
	
	
}


what I donot understand is my simple pojo  has nothing to do with   
InterceptFieldCallback, I looked GrantsDTO  using a decomplier  and
surprisingly it has InterceptFieldCallback
and here the code  from decompiler

package gov.hhs.acf.util.ws.grants.model;

import java.io.Serializable;
import net.sf.cglib.transform.impl.InterceptFieldCallback;
import net.sf.cglib.transform.impl.InterceptFieldEnabled;

public class GrantsDTO
    implements Serializable, InterceptFieldEnabled
{

    private transient InterceptFieldCallback $CGLIB_READ_WRITE_CALLBACK;
    private String grantNumber;
    private String granteeName;

    public InterceptFieldCallback getInterceptFieldCallback()
    {
        return $CGLIB_READ_WRITE_CALLBACK;
    }

    public void setInterceptFieldCallback(InterceptFieldCallback
interceptfieldcallback)
    {
        $CGLIB_READ_WRITE_CALLBACK = interceptfieldcallback;
    }

    public String $cglib_read_grantNumber()
    {
        grantNumber;
        if(getInterceptFieldCallback() != null) goto _L2; else goto _L1
_L1:
        return;
_L2:
        String s;
        s;
        return (String)getInterceptFieldCallback().readObject(this,
"grantNumber", s);
    }

    public void $cglib_write_grantNumber(String s)
    {
        grantNumber = getInterceptFieldCallback() == null ? s :
(String)getInterceptFieldCallback().writeObject(this, "grantNumber",
grantNumber, s);
    }

    public String $cglib_read_granteeName()
    {
        granteeName;
        if(getInterceptFieldCallback() != null) goto _L2; else goto _L1
_L1:
        return;
_L2:
        String s;
        s;
        return (String)getInterceptFieldCallback().readObject(this,
"granteeName", s);
    }

    public void $cglib_write_granteeName(String s)
    {
        granteeName = getInterceptFieldCallback() == null ? s :
(String)getInterceptFieldCallback().writeObject(this, "granteeName",
granteeName, s);
    }

    public String getGrantNumber()
    {
        return $cglib_read_grantNumber();
    }

    public GrantsDTO()
    {
    }

    public GrantsDTO(String grantNumber, String granteeName)
    {
        $cglib_write_granteeName(granteeName);
        $cglib_write_grantNumber(grantNumber);
    }

    public void setGrantNumber(String grantNumber)
    {
        $cglib_write_grantNumber(grantNumber);
    }

    public String getGranteeName()
    {
        return $cglib_read_granteeName();
    }

    public void setGranteeName(String granteeName)
    {
        $cglib_write_granteeName(granteeName);
    }
}

does cxf  does this change ?  and in this case how can I tell jaxb to ignore
the properties added by c glib ?

 
-- 
View this message in context: http://old.nabble.com/jaxb-and-my-model-tp27803093p27803093.html
Sent from the cxf-user mailing list archive at Nabble.com.