[TP10] SignOnServlet et UpdateCustomerServlet not found

Modérateurs : graffion, jmdouin, agoncal, mlebihan

payneauj
Messages : 5
Inscription : 21 déc. 2015 21:03

[TP10] SignOnServlet et UpdateCustomerServlet not found

Message par payneauj » 21 déc. 2015 21:06

Bonjour,

Lorsque j'execute yaps-test ou les tests unitaires via eclipse, j'obtiens une erreur 500.

En revanche dans le navigateur web, si je navigue vers les 2 servlets, ça fonctionne bien.

Merci pour votre aide.

Jocelyn Payneau

graffion
Messages : 649
Inscription : 21 juin 2005 14:05

Re: [TP10] SignOnServlet et UpdateCustomerServlet not found

Message par graffion » 21 déc. 2015 23:08

Bonjour,

Pouvez vous coller ici la trace d'exécution de ant yaps-test ?

payneauj
Messages : 5
Inscription : 21 déc. 2015 21:03

Re: [TP10] SignOnServlet et UpdateCustomerServlet not found

Message par payneauj » 22 déc. 2015 12:30

Bonjour,

Voici la trace :
F:\Perso\CNAM\GLG203\TPs\TP10>ant yaps-test
Buildfile: F:\Perso\CNAM\GLG203\TPs\TP10\build.xml

check:

yaps-prepare:
[echo] Setup the Yaps environment

yaps-compile:
[echo] Compile the YAPS classes
[javac] F:\Perso\CNAM\GLG203\TPs\TP10\build.xml:240: warning: 'includeantrun
time' was not set, defaulting to build.sysclasspath=last; set to false for repea
table builds
[echo] Compile the YAPS test classes
[javac] F:\Perso\CNAM\GLG203\TPs\TP10\build.xml:248: warning: 'includeantrun
time' was not set, defaulting to build.sysclasspath=last; set to false for repea
table builds

yaps-test:
[echo] Tests the Yaps application in F:\Perso\CNAM\GLG203\TPs\TP10/Yaps/bui
ld
[junit] Running AllTests
[junit] Testsuite: AllTests
[junit] Tests run: 131, Failures: 2, Errors: 0, Time elapsed: 9,207 sec
[junit] Tests run: 131, Failures: 2, Errors: 0, Time elapsed: 9,207 sec
[junit]
[junit] Testcase: testDomainFindAllCategories took 0,229 sec
[junit] Testcase: testDomainCreateCategory took 0,054 sec
[junit] Testcase: testDomainUpdateCategory took 0,058 sec
[junit] Testcase: testDomainUpdateCategoryWithInvalidValues took 0,047 sec
[junit] Testcase: testDomainCreateCategoryWithInvalidValues took 0 sec
[junit] Testcase: testDomainFindCategoryWithInvalidValues took 0,029 sec
[junit] Testcase: testCreateCustomerWithInvalidValues took 0,001 sec
[junit] Testcase: testCreateValidCustomer took 0 sec
[junit] Testcase: testDomainCreateItem took 0,17 sec
[junit] Testcase: testDomainUpdateItem took 0,163 sec
[junit] Testcase: testDomainSearchItems took 0,099 sec
[junit] Testcase: testDomainFindItemWithInvalidValues took 0,024 sec
[junit] Testcase: testDomainUpdateItemWithInvalidValues took 0,091 sec
[junit] Testcase: testDomainFindAllItemsForAProduct took 0,115 sec
[junit] Testcase: testDomainCreateItemWithInvalidValues took 0 sec
[junit] Testcase: testDomainCreateItemWithInvalidProduct took 0,009 sec
[junit] Testcase: testDomainFindAllItems took 0,093 sec
[junit] Testcase: testDomainCreateOrderLineWithInvalidValues took 0 sec
[junit] Testcase: testDomainFindOrderLineWithInvalidValues took 0,022 sec
[junit] Testcase: testDomainUpdateOrderLineWithInvalidValues took 0,196 sec
[junit] Testcase: testDomainFindAllOrderLines took 0,206 sec
[junit] Testcase: testDomainCreateOrderLine took 0,165 sec
[junit] Testcase: testDomainFindOrderWithInvalidValues took 0,021 sec
[junit] Testcase: testDomainCreateOrder took 0,055 sec
[junit] Testcase: testDomainUpdateOrder took 0,077 sec
[junit] Testcase: testDomainUpdateOrderWithInvalidValues took 0,057 sec
[junit] Testcase: testDomainCreateOrderWithInvalidValues took 0 sec
[junit] Testcase: testDomainFindAllOrders took 0,058 sec
[junit] Testcase: testDomainDeleteUnknownProduct took 0,004 sec
[junit] Testcase: testDomainFindAllProductsForACategory took 0,06 sec
[junit] Testcase: testDomainUpdateProductWithInvalidValues took 0,069 sec
[junit] Testcase: testDomainCreateProductWithInvalidValues took 0 sec
[junit] Testcase: testDomainCreateProductWithInvalidCategory took 0,012 sec
[junit] Testcase: testDomainFindProductWithInvalidValues took 0,023 sec
[junit] Testcase: testDomainUpdateProduct took 0,098 sec
[junit] Testcase: testDomainFindAllProducts took 0,078 sec
[junit] Testcase: testDomainCreateProduct took 0,102 sec
[junit] Testcase: testServiceDeleteUnknownCategory took 0,182 sec
[junit] Testcase: testServiceDeleteUnknownProduct took 0,022 sec
[junit] Testcase: testServiceFindAllItemsForAProduct took 0,171 sec
[junit] Testcase: testServiceFindItemWithInvalidValues took 0,023 sec
[junit] Testcase: testServiceCreateItem took 0,137 sec
[junit] Testcase: testServiceUpdateItem took 0,193 sec
[junit] Testcase: testServiceUpdateItemWithInvalidValues took 0 sec
[junit] Testcase: testServiceCreateCategoryWithInvalidValues took 0,001 sec
[junit] Testcase: testServiceFindCategoryWithInvalidValues took 0,022 sec
[junit] Testcase: testServiceFindAllProductsForACategory took 0,091 sec
[junit] Testcase: testServiceFindAllItemsForAmazonParrot took 0,025 sec
[junit] Testcase: testServiceUpdateCategoryWithInvalidValues took 0 sec
[junit] Testcase: testServiceCreateProductWithInvalidCategory took 0,039 sec

[junit] Testcase: testServiceCreateItemWithInvalidValues took 0 sec
[junit] Testcase: testServiceUpdateProductWithInvalidValues took 0 sec
[junit] Testcase: testServiceFindProductWithInvalidValues took 0,015 sec
[junit] Testcase: testServiceCreateProductWithInvalidValues took 0,008 sec
[junit] Testcase: testServiceCreateItemWithInvalidProduct took 0,032 sec
[junit] Testcase: testServiceUpdateCategory took 0,049 sec
[junit] Testcase: testServiceCreateCategory took 0,043 sec
[junit] Testcase: testServiceFindAllProducts took 0,376 sec
[junit] Testcase: testServiceFindAllCategories took 0,053 sec
[junit] Testcase: testServiceFindAllItems took 0,507 sec
[junit] Testcase: testServiceDeleteUnknownItem took 0,022 sec
[junit] Testcase: testServiceCreateProduct took 0,118 sec
[junit] Testcase: testServiceSearchItems took 0,164 sec
[junit] Testcase: testServiceUpdateProduct took 0,111 sec
[junit] Testcase: testServiceAuthenticateCustomer took 0,208 sec
[junit] Testcase: testServiceDeleteUnknownCustomer took 0,018 sec
[junit] Testcase: testServiceFindCustomerWithInvalidValues took 0,013 sec
[junit] Testcase: testServiceUpdateCustomerWithInvalidValues took 0 sec
[junit] Testcase: testServiceCreateCustomerWithInvalidValues took 0 sec
[junit] Testcase: testServiceUpdateCustomerWithInvalidCreditCard took 0,068
sec
[junit] Testcase: testServiceCreateCustomerWithInvalidCreditCard took 0,04 s
ec
[junit] Testcase: testServiceFindAllCustomers took 0,046 sec
[junit] Testcase: testServiceCreateCustomer took 0,053 sec
[junit] Testcase: testServiceUpdateCustomer took 0,065 sec
[junit] Testcase: testServiceFindOrderWithInvalidValues took 0,026 sec
[junit] Testcase: testServiceCreateOrder took 0,196 sec
[junit] Testcase: testServiceCreateOrderWithInvalidCreditCard took 0,228 sec

[junit] Testcase: testServiceCreateOrderWithInvalidValues took 0 sec
[junit] Testcase: testServiceVerifyValidCreditCard took 0,003 sec
[junit] Testcase: testServiceVerifyOldCreditCard took 0,007 sec
[junit] Testcase: testServiceVerifyInvalidNumberCreditCard took 0,023 sec
[junit] Testcase: testDelegateDeleteUnknownCategory took 0,035 sec
[junit] Testcase: testDelegateFindItemWithInvalidValues took 0,019 sec
[junit] Testcase: testDelegateFindAllItemsForAProduct took 0,202 sec
[junit] Testcase: testDelegateDeleteUnknownProduct took 0,015 sec
[junit] Testcase: testDelegateCreateProduct took 0,09 sec
[junit] Testcase: testDelegateUpdateProduct took 0,11 sec
[junit] Testcase: testDelegateFindAllCategories took 0,056 sec
[junit] Testcase: testDelegateUpdateCategory took 0,059 sec
[junit] Testcase: testDelegateFindAllProducts took 0,334 sec
[junit] Testcase: testDelegateCreateCategory took 0,048 sec
[junit] Testcase: testDelegateUpdateItem took 0,135 sec
[junit] Testcase: testDelegateDeleteUnknownItem took 0,013 sec
[junit] Testcase: testDelegateCreateItem took 0,116 sec
[junit] Testcase: testDelegateFindAllItems took 0,439 sec
[junit] Testcase: testDelegateSearchItems took 0,183 sec
[junit] Testcase: testDelegateFindCategoryWithInvalidValues took 0,018 sec
[junit] Testcase: testDelegateUpdateProductWithInvalidValues took 0,005 sec
[junit] Testcase: testDelegateUpdateCategoryWithInvalidValues took 0,003 sec

[junit] Testcase: testDelegateCreateItemWithInvalidValues took 0,003 sec
[junit] Testcase: testDelegateCreateCategoryWithInvalidValues took 0,003 sec

[junit] Testcase: testDelegateCreateProductWithInvalidValues took 0,012 sec
[junit] Testcase: testDelegateFindProductWithInvalidValues took 0,007 sec
[junit] Testcase: testDelegateFindAllProductsForACategory took 0,129 sec
[junit] Testcase: testDelegateUpdateItemWithInvalidValues took 0,005 sec
[junit] Testcase: testDelegateAuthenticateCustomer took 0,059 sec
[junit] Testcase: testDelegateDeleteUnknownCustomer took 0,013 sec
[junit] Testcase: testDelegateUpdateCustomer took 0,064 sec
[junit] Testcase: testDelegateFindAllCustomers took 0,053 sec
[junit] Testcase: testDelegateCreateCustomer took 0,055 sec
[junit] Testcase: testDelegateUpdateCustomerWithInvalidCreditCard took 0,1 s
ec
[junit] Testcase: testDelegateCreateCustomerWithInvalidCreditCard took 0,045
sec
[junit] Testcase: testDelegateFindCustomerWithInvalidValues took 0,008 sec
[junit] Testcase: testDelegateCreateCustomerWithInvalidValues took 0,004 sec

[junit] Testcase: testDelegateUpdateCustomerWithInvalidValues took 0,003 sec

[junit] Testcase: testDelegateCreateOrder took 0,148 sec
[junit] Testcase: testDelegateCreateOrderWithInvalidValues took 0,004 sec
[junit] Testcase: testDelegateFindOrderWithInvalidValues took 0,015 sec
[junit] Testcase: testDelegateCreateOrderWithInvalidCreditCard took 0,161 se
c
[junit] Testcase: testUtilUniqueId took 0,043 sec
[junit] Testcase: testWebCheckLogin took 0,117 sec
[junit] FAILED
[junit] SignOnServlet hasn't been found
[junit] junit.framework.AssertionFailedError: SignOnServlet hasn't been foun
d
[junit] at com.yaps.petstore.web.WebTest.testWebCheckLogin(Unknown Sourc
e)
[junit]
[junit] Testcase: testWebCheckServlets took 0,017 sec
[junit] FAILED
[junit] The UpdateCustomerServlet hasn't been found
[junit] junit.framework.AssertionFailedError: The UpdateCustomerServlet hasn
't been found
[junit] at com.yaps.petstore.web.WebTest.testWebCheckServlets(Unknown So
urce)
[junit]
[junit] Testcase: testWebCheckPages took 0,069 sec
[junit] Testcase: testServletCreateCustomer took 0,097 sec
[junit] Testcase: testServletCreateCustomerWithInvalidValues took 0,027 sec
[junit] Testcase: testServletCreateCustomerWithInvalidPassword took 0,009 se
c
[junit] Testcase: testWebVisualiseCatalog took 0,066 sec
[junit] Testcase: testBarkBankVerifyValidCreditCard took 0,003 sec
[junit] Testcase: testBarkBankVerifyInvalidXMLDocument took 0,003 sec
[junit] Testcase: testBarkBankVerifyOldCreditCard took 0,005 sec
[junit] Testcase: testBarkBankVerifyInvalidNumberCreditCard took 0,003 sec
[junit] Test AllTests FAILED

BUILD SUCCESSFUL
Total time: 11 seconds

graffion
Messages : 649
Inscription : 21 juin 2005 14:05

Re: [TP10] SignOnServlet et UpdateCustomerServlet not found

Message par graffion » 22 déc. 2015 15:48

Bonjour,
[junit] FAILED
[junit] SignOnServlet hasn't been found
[junit] junit.framework.AssertionFailedError: SignOnServlet hasn't been found
[junit] at com.yaps.petstore.web.WebTest.testWebCheckLogin(Unknown Source)
[junit]
[junit] Testcase: testWebCheckServlets took 0,017 sec
[junit] FAILED
[junit] The UpdateCustomerServlet hasn't been found

Comme c'est bizarre, ce sont les 2 servlets que vous devez implémenter :
Yaps/src/java/com/yaps/petstore/web/servlet/SignOnServlet.java
Yaps/src/java/com/yaps/petstore/web/servlet/UpdateCustomerServlet.java


Les urls ci dessous fonctionnent elles vraiment dans votre navigateur?
http://localhost:8080/petstore/signon
http://localhost:8080/petstore/updatecustomer

payneauj
Messages : 5
Inscription : 21 déc. 2015 21:03

Re: [TP10] SignOnServlet et UpdateCustomerServlet not found

Message par payneauj » 23 déc. 2015 13:29

Bonjour,

Les 2 servlets sont bien accessibles avec le message d'erreur "Id should not be empty".

cf screenshot :

Image

Jocelyn

payneauj
Messages : 5
Inscription : 21 déc. 2015 21:03

Re: [TP10] SignOnServlet et UpdateCustomerServlet not found

Message par payneauj » 02 janv. 2016 12:52

Bonjour,

En fouillant dans les logs de tomcat, j'ai fini par trouver d'où venait le problème.

Le dispatcher.forward() n'était pas à l'intérieur du try.

Du coup, lors d'une exception, il y avait un premier forward vers la page d'exception puis un second vers index.jsp

Répondre

Qui est en ligne ?

Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 1 invité