IIRC, char is not supported as the injectable type for *Param annotations. Please use String instead.
Marek
On Dec 6, 2012, at 1:14 PM, liyajun <li_yajun_at_nec.cn> wrote:
> To:jersey
>
> As below I used the @QueryParam annoation and the inject parameter type is
> char in jersey1.11,
>
> @Path("charTest")
> public class CharCanNotUse {
> @GET
> public String testChar(@QueryParam("param1") char c) {
> ...
> }
> }
>
> but when I accessed the resource URI, I got a exception.
> I also used char type in @MatrixParam and other param annotation, also got
> the exception.
> If the usage is not correct please tell me.
> If the use is correct,
> doesn't jersey support char type as @XXParam annonation inject type?
> or it is a bug?
>
> The exception is:
> SEVERE: Missing dependency for method public java.lang.String
> jersey.test.CharCanNotUse.testChar(char) at parameter at index 0
> SEVERE: Method, public java.lang.String
> jersey.test.CharCanNotUse.testChar(char), annotated with GET of resource,
> class jersey.test.CharCanNotUse, is not recognized as valid resource
> method.|#]
>
> 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(WebApplic
> ationImpl.java:771)
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplic
> ationImpl.java:766)
> at
> com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContai
> ner.java:488)
> at
> com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.i
> nitiate(ServletContainer.java:318)
> at
> com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:609
> )
> at
> com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210
> )
> at
> com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.
> java:373)
> at
> com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.
> java:556)
> at javax.servlet.GenericServlet.init(GenericServlet.java:244)
> at
> org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:14
> 45)
> at
> org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1072)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:189)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:175)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655
> )
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161
> )
> at
> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331
> )
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(Con
> tainerMapper.java:317)
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.
> java:195)
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
> at
> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.jav
> a:228)
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolCh
> ain.java:137)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.jav
> a:54)
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59
> )
> at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.jav
> a:532)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:5
> 13)
> at java.lang.Thread.run(Thread.java:662)
>
> Waiting for you answer.
> Thank you.
> Yours sincerely.
> =================================================
> liyajun
> TEL:010-59343527
> EMAIL:li_yajun_at_nec.cn
> =================================================
>
>