vendredi 12 mai 2017

NoSuchMethodException with javax.servlet.http.Cookie using reflection

I am currently calling javax.servlet.http.Cookie and receiving the NoSuchMethodException while running a program in Eclipse. The javax.servlet-api-4.0.0.x.jar is in the build path. Here is the code that I am running currently:

method = cms.getClass().getMethod(field, javax.servlet.http.Cookie.class);

I have also tried:

method = cms.getClass().getMethod(field, Cookie.class);

There is also an import for import javax.servlet.http.Cookie;.





Aucun commentaire:

Enregistrer un commentaire