Bonjour,
J'ai compilé mon programme par eclipse et par ant et il ne m'ont affiché aucun problème.
Par contre, dans le fichier html, j'ai deux erreurs liées à la classe Product mais je ne comprends pas d'ou elles viennent car elles sont de nature java.lang.NoSuchMethodError.
Que veut dire ce genre d'erreur?
Merci beaucoup
Que veut dire cette exception?
Modérateurs : graffion, jmdouin, agoncal, mlebihan
Re: Que veut dire cette exception?
Bonjour,
Pouvez vous nous donner le message véhiculé avec l'exception NoSuchMethodError dans le fichier html?
Pouvez vous nous donner le message véhiculé avec l'exception NoSuchMethodError dans le fichier html?
-
- Messages : 55
- Inscription : 01 nov. 2016 16:13
Re: Que veut dire cette exception?
Oui la voici, merci
Voici les tests qui ont posé des problèmes à votre exécutable. Cette liste est vide si tous se sont déroulés sans incident.
testDomainUpdateProduct(g): Votre exécutable a échoué en levant une exception.
Exception levée: java.lang.NoSuchMethodError
Message : com.yaps.petstore.domain.Product.getCategory()Lcom/yaps/petstore/domain/Category;
Pile d'appel:
java.lang.NoSuchMethodError: com.yaps.petstore.domain.Product.getCategory()Lcom/yaps/petstore/domain/Category;
at g.b(Unknown Source)
at g.testDomainUpdateProduct(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at K.tester(Unknown Source)
at K.testerEtQuitter(Unknown Source)
at Tests.main(Unknown Source)
testDomainUpdateProduct(g): com.yaps.petstore.domain.Product.getCategory()Lcom/yaps/petstore/domain/Category;
testDomainCreateProduct(g): Votre exécutable a échoué en levant une exception.
Exception levée: java.lang.NoSuchMethodError
Message : com.yaps.petstore.domain.Product.getCategory()Lcom/yaps/petstore/domain/Category;
Pile d'appel:
java.lang.NoSuchMethodError: com.yaps.petstore.domain.Product.getCategory()Lcom/yaps/petstore/domain/Category;
at g.b(Unknown Source)
at g.testDomainCreateProduct(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at K.tester(Unknown Source)
at K.testerEtQuitter(Unknown Source)
at Tests.main(Unknown Source)
testDomainCreateProduct(g): com.yaps.petstore.domain.Product.getCategory()Lcom/yaps/petstore/domain/Category;
Voici les tests qui ont posé des problèmes à votre exécutable. Cette liste est vide si tous se sont déroulés sans incident.
testDomainUpdateProduct(g): Votre exécutable a échoué en levant une exception.
Exception levée: java.lang.NoSuchMethodError
Message : com.yaps.petstore.domain.Product.getCategory()Lcom/yaps/petstore/domain/Category;
Pile d'appel:
java.lang.NoSuchMethodError: com.yaps.petstore.domain.Product.getCategory()Lcom/yaps/petstore/domain/Category;
at g.b(Unknown Source)
at g.testDomainUpdateProduct(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at K.tester(Unknown Source)
at K.testerEtQuitter(Unknown Source)
at Tests.main(Unknown Source)
testDomainUpdateProduct(g): com.yaps.petstore.domain.Product.getCategory()Lcom/yaps/petstore/domain/Category;
testDomainCreateProduct(g): Votre exécutable a échoué en levant une exception.
Exception levée: java.lang.NoSuchMethodError
Message : com.yaps.petstore.domain.Product.getCategory()Lcom/yaps/petstore/domain/Category;
Pile d'appel:
java.lang.NoSuchMethodError: com.yaps.petstore.domain.Product.getCategory()Lcom/yaps/petstore/domain/Category;
at g.b(Unknown Source)
at g.testDomainCreateProduct(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at K.tester(Unknown Source)
at K.testerEtQuitter(Unknown Source)
at Tests.main(Unknown Source)
testDomainCreateProduct(g): com.yaps.petstore.domain.Product.getCategory()Lcom/yaps/petstore/domain/Category;
Re: Que veut dire cette exception?
Quelle est la signature de votre méthode getCategory() dans votre implémentation de la classe Product du package com.yaps.petstore.domain ?
-
- Messages : 55
- Inscription : 01 nov. 2016 16:13
Re: Que veut dire cette exception?
public String getCategory() {...}
J'ai changé en Category mais tous les tests de ItemDAO ne marchent plus!
Apparemment c'est cannot load persistantItem.ser
Que se passe-t-il maintenant?
J'ai changé en Category mais tous les tests de ItemDAO ne marchent plus!
Apparemment c'est cannot load persistantItem.ser
Que se passe-t-il maintenant?
Re: Que veut dire cette exception?
getCategory ne doit pas retourner une String mais une instance de Category!
Supprimez tous les fichiers .ser avant de relancer ant yaps-mark.
Supprimez tous les fichiers .ser avant de relancer ant yaps-mark.
Qui est en ligne ?
Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 1 invité