[Web Services] There's no ObjectFactory with an @XmlElementDecl

There's no ObjectFactory with an @XmlElementDecl [Web Services] - Java - Programmation

Marsh Posté le 15-11-2007 à 16:50:16    

Bonjour,
 
Des que je lance un wsimport pour utiliser mon webservice depuis un client et ceci depuis que j'ai rajouté une méthode qui retourne un tableau de byte sur mon webservice j'ai There's no ObjectFactory with an @XmlElementDecl for the element   :pfff:  
 
J'utilise Sun java application server (dernière version) et donc glassfish.
 
Voici la méthode en question :  
 
 

Code :
  1. @WebMethod
  2.     public byte[] getFichier(@WebParam(name = "idChanson" ) long idChanson) {
  3.         FileInputStream fis;
  4.         byte[] fichier=null;
  5.         try {
  6.             fis = new FileInputStream("path" );
  7.        
  8.    FileChannel fc = fis.getChannel();
  9.    fichier = new byte[(int)fc.size()];   // fc.size returns the size of the file which backs the channel
  10.    ByteBuffer bb = ByteBuffer.wrap(fichier);
  11.    fc.read(bb);
  12.         } catch (IOException ex) {
  13.             ex.printStackTrace();
  14.         }
  15.         return fichier;
  16.     }


 
 Et l'erreur un peu mieux détaillée
 
Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
There's no ObjectFactory with an @XmlElementDecl for the element {http://webservices/}return.
this problem is related to the following location:
at protected javax.xml.bind.JAXBElement ws.chanson.GetFichierResponse._return
at ws.chanson.GetFichierResponse
 
 
Je n'ai aucun soucis sur le serveur lorsque je déploie mon ws.
 
Si quelqu'un a une idée je suis preneur !!!

Reply

Marsh Posté le 15-11-2007 à 16:50:16   

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed