0

I am new to Java and especially web services. I am getting following exception when running it on tomcat. Can someone please tell me what is this error and why I am getting this exception? Error :

 SEVERE: Missing dependency for method public java.lang.String getPDFs(java.lang.String,java.util.List) at parameter at index 1


SEVERE: Method, public java.lang.String getPDFs(java.lang.String,java.util.List), annotated with GET of resource, class Service, is not recognized as valid resource method.


Jul 04, 2015 7:23:58 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
com.sun.jersey.spi.inject.Errors$ErrorMessagesException
    at com.sun.jersey.spi.inject.Errors.processErrorMessages(Errors.java:170)
    at com.sun.jersey.spi.inject.Errors.postProcess(Errors.java:136)
    at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:199)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790)
    at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:509)
    at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:339)
    at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605)
    at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:577)
    at javax.servlet.GenericServlet.init(GenericServlet.java:160)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5266)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5554)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardContext.reload(StandardContext.java:4033)
    at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:425)
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1345)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1546)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1556)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1556)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1524)
    at java.lang.Thread.run(Thread.java:745)

My Method :

public String getPDFs(@QueryParam("code") String code, @QueryParam("mapsList") List<Map<String,String>> mapsList)
Paul Samsotha
  • 205,037
  • 37
  • 486
  • 720
Jenny
  • 345
  • 3
  • 5
  • 15
  • possible duplicate of http://stackoverflow.com/questions/15024408/jax-rs-exception-annotated-with-get-of-resource-class-is-not-recognized-as-val – Roman Vottner Jul 05 '15 at 00:08
  • So I cannot pass List as parameter? If not, How am I supposed to pass this value? Can you please tell me how? – Jenny Jul 05 '15 at 00:22
  • As [the Jersey documentation](https://jersey.java.net/documentation/latest/jaxrs-resources.html#d0e2153) states, as well as the linked answer, the type of the List element needs either a single String argument constructor or a `valueOf(String)` or `fromString(String)` method - Map has neither of these. Please explain what exactly you want to pass to the method. – Roman Vottner Jul 05 '15 at 00:36
  • possible duplicate of [Passing custom type query parameter](http://stackoverflow.com/questions/30403033/passing-custom-type-query-parameter) – Paul Samsotha Jul 05 '15 at 02:32

0 Answers0