0 Replies Latest reply on Nov 4, 2015 5:14 AM by Sreenath Reddy

    Unable to find a constructor that takes a String param or a valueOf() or fromString() method for javax.ws.rs.PathParam(“id”)

    Sreenath Reddy Novice

      I have a web service which will consume the xml data

       

      @Override
      @GET
      @Consumes("*/*")
      @Produces("application/xml")
      @Path("page/{id}")
      public PageData getPage(@QueryParam("session") final String sessionId,
        @PathParam("id") final String valueId)
        throws SessionNotFoundException {

        final PageData pageData= getPageData(valueId);
        return pageData;
      }

      While starting the wildfly server I am getting the below Exception. Another thing is if I add my Jars to eclipse and run from the eclipse I am not getting any Exception, But if I build my application from and script and deploy on WildFly then only I am getting the Exception.

      14:33:33,272 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./project: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./project: Failed to start service
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_11]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_11]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_11]
      Caused by: java.lang.RuntimeException: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.resteasy.bootstrap
        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:222)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:87)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
        ... 3 more
      Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.resteasy.bootstrap
        at org.jboss.seam.Component.newInstance(Component.java:2208)
        at org.jboss.seam.contexts.Contexts.startup(Contexts.java:343)
        at org.jboss.seam.contexts.Contexts.startup(Contexts.java:317)
        at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:143)
        at org.jboss.seam.init.Initialization.init(Initialization.java:813)
        at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)
        at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:193)
        ... 7 more
      Caused by: java.lang.RuntimeException: Unable to find a constructor that takes a String param or a valueOf() or fromString() method for javax.ws.rs.PathParam("id") on public com.project..pojo.flex.PageData com.project.ws.PageDataService.getPage(
      java.lang.String,java.lang.Object) throws com.project.SessionNotFoundException for basetype: java.lang.Object
        at org.jboss.resteasy.core.StringParameterInjector.initialize(StringParameterInjector.java:206)
        at org.jboss.resteasy.core.StringParameterInjector.<init>(StringParameterInjector.java:57)
        at org.jboss.resteasy.core.PathParamInjector.<init>(PathParamInjector.java:49)
        at org.jboss.resteasy.core.InjectorFactoryImpl.createParameterExtractor(InjectorFactoryImpl.java:98)
        at org.jboss.resteasy.core.InjectorFactoryImpl.createParameterExtractor(InjectorFactoryImpl.java:61)
        at org.jboss.resteasy.core.MethodInjectorImpl.<init>(MethodInjectorImpl.java:75)
        at org.jboss.resteasy.core.InjectorFactoryImpl.createMethodInjector(InjectorFactoryImpl.java:55)
        at org.jboss.resteasy.core.ResourceMethod.<init>(ResourceMethod.java:71)
        at org.jboss.resteasy.core.ResourceMethodRegistry.processMethod(ResourceMethodRegistry.java:178)
        at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:123)
        at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:106)
        at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:83)
        at org.jboss.seam.resteasy.ResteasyBootstrap.registerPlainResource(ResteasyBootstrap.java:504)
        at org.jboss.seam.resteasy.ResteasyBootstrap.registerResources(ResteasyBootstrap.java:422)
        at org.jboss.seam.resteasy.ResteasyBootstrap.init(ResteasyBootstrap.java:133)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_11]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_11]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_11]
        at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0_11]
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
        at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
        at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
        at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:79)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
        at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
        at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
        at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
        at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:196)
        at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:114)
        at com.project.report.api.RESTCaptureBootstrap_$$_javassist_seam_0.init(RESTCaptureBootstrap_$$_javassist_seam_0.java)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_11]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_11]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_11]
        at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0_11]
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
        at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
        at org.jboss.seam.Component.callComponentMethod(Component.java:2313)
        at org.jboss.seam.Component.callCreateMethod(Component.java:2236)
        at org.jboss.seam.Component.newInstance(Component.java:2196)
        ... 15 more

       

       

      Please suggest if anyone knows the why it is throwing the Exception when we are deploying the ant generated build file..