IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Services Web Java Discussion :

Erreur dans la génération du fichier WSDL sous Netbeans


Sujet :

Services Web Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre très actif
    Profil pro
    Inscrit en
    Octobre 2010
    Messages
    131
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2010
    Messages : 131
    Par défaut Erreur dans la génération du fichier WSDL sous Netbeans
    Bonsoir tout le monde,
    SVP j'ai essayé de générer le fichier wsdl de mon projet de web service sous Netbeans mais j'ai eu ce code d'erreur:
    command line: wsgen -classpath "C:\Program Files\Java\jdk1.6.0_25\lib\tools.jar;C:\Users\Essia\Documents\NetBeansProjects\ontologie2\build\web\WEB-INF\classes;C:\Program Files\glassfish-3.1\glassfish\modules\webservices-osgi.jar;C:\Program Files\glassfish-3.1\glassfish\modules\endorsed\webservices-api-osgi.jar;C:\Program Files\glassfish-3.1\glassfish\modules\jaxb-osgi.jar;C:\Program Files\glassfish-3.1\glassfish\modules\endorsed\jaxb-api-osgi.jar;C:\Program Files\glassfish-3.1\glassfish\modules\javax.ejb.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\arq-2.8.8-tests.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\arq-2.8.8.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\icu4j-3.4.4.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\iri-0.8.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\jena-2.6.4-tests.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\jena-2.6.4.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\junit-4.5.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\log4j-1.2.14.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\lucene-core-2.3.1.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\slf4j-api-1.5.8.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\slf4j-log4j12-1.5.8.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\stax-api-1.0.1.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\wstx-asl-3.2.9.jar;C:\Users\Essia\Downloads\arq-2.8.8\ARQ-2.8.8\lib\xercesImpl-2.7.1.jar;C:\Program Files\NetBeans 7.0\ide\modules\ext\jaxb\activation.jar;C:\Program Files\NetBeans 7.0\enterprise\modules\ext\metro\webservices-api.jar;C:\Program Files\NetBeans 7.0\enterprise\modules\ext\metro\webservices-extra-api.jar;C:\Program Files\NetBeans 7.0\enterprise\modules\ext\metro\webservices-extra.jar;C:\Program Files\NetBeans 7.0\enterprise\modules\ext\metro\webservices-rt.jar;C:\Program Files\NetBeans 7.0\enterprise\modules\ext\metro\webservices-tools.jar" -d C:\Users\Essia\Documents\NetBeansProjects\ontologie2\build\generated-sources\jax-ws -Xendorsed -keep -wsdl -r C:\Users\Essia\Documents\NetBeansProjects\ontologie2\build\generated-sources\jax-ws\resources -s C:\Users\Essia\Documents\NetBeansProjects\ontologie2\build\generated-sources\jax-ws -verbose main.testWS
    Note: ap round: 1
    [ProcessedMethods Class: main.testWS]
    [should process method: main hasWebMethods: true ]
    Problem encountered during annotation processing;
    see stacktrace below for more information.
    com.sun.tools.ws.processor.modeler.ModelerException: modeler error: Method annotated with @javax.jws.WebMethod must not be static or final. Class: main.testWS Method: main(java.lang.String[])
    at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.onError(WebServiceAP.java:244)
    at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.shouldProcessMethod(WebServiceVisitor.java:483)
    at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitMethodDeclaration(WebServiceVisitor.java:451)
    at com.sun.tools.apt.mirror.declaration.MethodDeclarationImpl.accept(MethodDeclarationImpl.java:41)
    at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.processMethods(WebServiceVisitor.java:391)
    at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.postProcessWebService(WebServiceVisitor.java:348)
    at com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.postProcessWebService(WebServiceWrapperGenerator.java:147)
    at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitClassDeclaration(WebServiceVisitor.java:152)
    at com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl.accept(ClassDeclarationImpl.java:95)
    at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.buildModel(WebServiceAP.java:334)
    at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.process(WebServiceAP.java:275)
    at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
    at com.sun.tools.apt.comp.Apt.main(Apt.java:454)
    at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:258)
    at com.sun.tools.apt.main.Main.compile(Main.java:1102)
    at com.sun.tools.apt.main.Main.compile(Main.java:964)
    at com.sun.tools.apt.Main.processing(Main.java:95)
    at com.sun.tools.apt.Main.process(Main.java:85)
    at com.sun.tools.apt.Main.process(Main.java:67)
    at com.sun.tools.ws.wscompile.WsgenTool.buildModel(WsgenTool.java:222)
    at com.sun.tools.ws.wscompile.WsgenTool.run(WsgenTool.java:126)
    at com.sun.tools.ws.ant.WsGen2.execute(WsGen2.java:546)
    at com.sun.istack.tools.ProtectedTask.execute(ProtectedTask.java:55)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)
    error: compilation failed, errors should have been reported
    C:\Users\Essia\Documents\NetBeansProjects\ontologie2\nbproject\jaxws-build.xml:36: wsgen failed
    BUILD FAILED (total time: 7 seconds)

    Je fais quoi exactement??????
    et merciiiiii

  2. #2
    Membre éprouvé Avatar de anisj1m
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juillet 2006
    Messages
    1 067
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2006
    Messages : 1 067
    Par défaut
    il ne faut pas annoté la methode main comme il t'as dis :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Method annotated with @javax.jws.WebMethod must not be static or final. Class: main.testWS Method: main(java.lang.String[])

  3. #3
    Membre très actif
    Profil pro
    Inscrit en
    Octobre 2010
    Messages
    131
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2010
    Messages : 131
    Par défaut
    mais dans toute la classe je n'ai que la méthode main !! est ce que la classe peut être considérée comme un web service même si y'a pas de méthodes dedans !!!???? et merciiii

  4. #4
    Membre éprouvé Avatar de anisj1m
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juillet 2006
    Messages
    1 067
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2006
    Messages : 1 067
    Par défaut
    fait moi voir ta classe

  5. #5
    Membre très actif
    Profil pro
    Inscrit en
    Octobre 2010
    Messages
    131
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2010
    Messages : 131
    Par défaut
    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    package main;

    import javax.jws.WebService;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.ejb.Stateless;
    import Similarity.*;

    /**
    *
    * @author Essia
    */
    @WebService(serviceName = "testWS")
    @Stateless()

    /** This is a sample web service operation */

    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */


    /**
    *
    * @author Essia
    */

    public class testWS extends Object {


    static final String inputFileName1 = "C:/benchmarks/101/onto.rdf";
    static final String inputFileName2 = "C:/benchmarks/304/onto.rdf";

    @WebMethod


    public static void main (String args[]) {

    sim_ling sim=new sim_ling(inputFileName1,inputFileName2);
    sim.parsing();
    }
    }






    en fait c'est une méthode qui fait appel à un algorithme d'alignement entre deux ontologies que je veux implémenter sous forme de web service

  6. #6
    Membre éprouvé Avatar de anisj1m
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juillet 2006
    Messages
    1 067
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2006
    Messages : 1 067
    Par défaut
    Citation Envoyé par ebenmous Voir le message

    @WebMethod


    public static void main (String args[]) {

    sim_ling sim=new sim_ling(inputFileName1,inputFileName2);
    sim.parsing();
    }
    t'as vu, tu es entrain de annoter la méthode main avec @WebMethod
    ce qui est faut,
    je te propose de faire enlever cette annotation de la methode main et faire une autre méthode et cette dernière tu l'annote et re-teste

  7. #7
    Membre très actif
    Profil pro
    Inscrit en
    Octobre 2010
    Messages
    131
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2010
    Messages : 131
    Par défaut
    SVP, je suis encore débutante en Java, comment je fais pour transformer cette méthode main en une autre que je peux annoter??? sachant que cette méthode me génère un fichier RDF qui fait l'alignement entre les deux ontologies. Merci

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Génération de fichiers stub sous Windows
    Par eddieange dans le forum NetBeans
    Réponses: 4
    Dernier message: 27/01/2010, 09h55
  2. Réponses: 5
    Dernier message: 30/01/2008, 14h47
  3. [AJAX] Erreur dans la fonction de déclaration xhr sous IE6 et 7
    Par aigleblanc dans le forum Général JavaScript
    Réponses: 0
    Dernier message: 23/10/2007, 15h47
  4. [1.1] Ajout de DTD dans la génération de fichier XML
    Par shadowninja dans le forum Windows Forms
    Réponses: 1
    Dernier message: 22/01/2007, 10h33
  5. Réponses: 6
    Dernier message: 19/06/2006, 12h15

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo