hi,

the error already says what the problem is: Jaxb can't handle interfaces, so 
making changes to the interface templates won't help. 
I don't know if there is a work around for this with JAXB, maybe this page will 
help:   http://weblogs.java.net/blog/2006/06/06/jaxb-and-interfaces

greets, 

Basil

On Apr 28, 2010, at 5:00 PM, <[email protected]> wrote:

> Hello,
> 
> I try to use Jaxb (instead of SAXBuilder) to unmarshall an xml file 
> containing a ADD_ROSPEC. This is a snippet of the code :
> 
>         ADD_ROSPEC spec = null; 
>         JAXBContext context = 
> JAXBContext.newInstance(org.llrp.ltk.generated.messages.ADD_ROSPEC.class); 
>         Unmarshaller unmarshaller = context.createUnmarshaller(); 
>         unmarshaller.setEventHandler(new 
> javax.xml.bind.helpers.DefaultValidationEventHandler()); 
>         spec = ((JAXBElement<ADD_ROSPEC>) 
> unmarshaller.unmarshal(inputStream)).getValue(); 
>         return spec;
> 
> 
> But, when I try to execute the code, it fails saying that there is a problem 
> on the interface in the generated classes of LTKJava. Examples of error 
> messages :
> 
> org.llrp.ltk.generated.interfaces.AirProtocolEPCMemorySelector is an 
> interface, and JAXB can't handle interfaces. 
> org.llrp.ltk.generated.interfaces.AirProtocolEPCMemorySelector does not have 
> a no-arg default constructor.
> 
> 
> To solve this problem, I think I have to add some modifications in the  
> javaInterfaceTemplate.vm and then generate again the LTKJava.
> 
> 
> Can you help me by telling me what should I add in this template (or others 
> ?) so I can use Jaxb on the classes defined in LTKJava ?
> 
> Thanks in advance for your help.
> 
>   
> Wafa SOUBRA 
> Orange Labs 
> 905, rue Albert Einstein 
> 06921 - Sophia Antipolis Cedex 
> [email protected] 
>  
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> llrp-toolkit-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/llrp-toolkit-devel

------------------------------------------------------------------------------
_______________________________________________
llrp-toolkit-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/llrp-toolkit-devel

Reply via email to