7 Replies Latest reply on Jun 5, 2014 9:56 AM by Steven Hawkins

    Consuming RESTful web services

    Ashish Sarin Newbie

      Hi,

       

      Is there any documentation available that talks about how to consume RESTful web services in Teiid? I was looking the the Import --> File Source (XML) option to consume a RESTful web service. But, it threw the following exception when I tried to execute a simple query:

       

      org.teiid.runtime.client.TeiidClientException: java.lang.RuntimeException: Remote org.teiid.core.TeiidException: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl from [Module "javax.ws.rs.api:main" from local module loader @1a2a46d1 (finder: local module finder @4d8f50c2 (roots: D:\TeiidInstal\jboss-eap-6.1\modules,D:\TeiidInstal\jboss-eap-6.1\modules\system\layers\base))]


      regards

      ashish

        • 1. Re: Consuming RESTful web services
          Ramesh Reddy Master

          Can you attach full exception from the server log?

          • 2. Re: Consuming RESTful web services
            Ashish Sarin Newbie

            15:22:18,909 ERROR [org.teiid.PROCESSOR] (Worker4_QueryProcessorQueue8) +Cx0B45k

            iIGv TEIID30019 Unexpected exception for request +Cx0B45kiIGv.0: java.lang.Runti

            meException: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegate

            Impl from [Module "javax.ws.rs.api:main" from local module loader @1a2a46d1 (fin

            der: local module finder @4d8f50c2 (roots: D:\TeiidInstal\jboss-eap-6.1\modules,

            D:\TeiidInstal\jboss-eap-6.1\modules\system\layers\base))]

                    at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:134)

                    at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:96)

                    at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:74)

                    at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:87)

                    at org.apache.cxf.jaxrs.client.LocalClientState.<init>(LocalClientState.java:50)

                    at org.apache.cxf.jaxrs.client.AbstractClient.<init>(AbstractClient.java:100)

                    at org.apache.cxf.jaxrs.client.WebClient.<init>(WebClient.java:78)

                    at org.apache.cxf.jaxrs.client.WebClient.<init>(WebClient.java:74)

                    at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.createWebClient(JAXRSClientFactoryBean.java:208)

                    at org.apache.cxf.jaxrs.client.WebClient.create(WebClient.java:92)

                    at org.teiid.resource.adapter.ws.WSConnectionImpl$HttpDispatch.<init>(WSConnectionImpl.java:125)

                    at org.teiid.resource.adapter.ws.WSConnectionImpl.createDispatch(WSConnectionImpl.java:287)

                    at org.teiid.translator.ws.BinaryWSProcedureExecution.execute(BinaryWSProcedureExecution.java:119)

                    at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:325) [teiid-engine-8.7.0.Final.jar:8.7.0.Final]

                    at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:298) [teiid-engine-8.7.0.Final.jar:8.7.0.Final]

                    at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110) [teiid-engine-8.7.0.Final.jar:8.7.0.Final]

                    at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107) [teiid-engine-8.7.0.Final.jar:8.7.0.Final]

                    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_21]

                    at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_21]

                    at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58) [teiid-engine-8.7.0.Final.jar:8.7.0.Final]

                    at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:274) [teiid-engine-8.7.0.Final.jar:8.7.0.Final]

                    at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.7.0.Final.jar:8.7.0.Final]

                    at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:214) [teiid-engine-8.7.0.Final.jar:8.7.0.Final]

                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]

                    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]

            Caused by: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl from [Module "javax.ws.rs.api:main" from local module loader @1a2a46d1 (finder: local module finder @4d8f50c2 (roots: D:\TeiidInstal\jboss-eap-6.1\modules,D:

            \TeiidInstal\jboss-eap-6.1\modules\system\layers\base))]

                    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.2.0.CR1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.2.0.CR1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.2.0.CR1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.2.0.CR1]

                    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.2.0.CR1]

                    at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_21]

                    at java.lang.Class.forName(Class.java:188) [rt.jar:1.7.0_21]

                    at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:77)

                    at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:201)

                    at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:113

            )

                    ... 25 more

            • 3. Re: Consuming RESTful web services
              Steven Hawkins Master

              Do you have the resteasy patch installed from the Teiid download page?

              • 4. Re: Consuming RESTful web services
                Ramesh Reddy Master

                [~shawkins] do you think this may be cause [TEIID-2986] issues with embedded - JBoss Issue Tracker on server too?

                • 5. Re: Consuming RESTful web services
                  Steven Hawkins Master

                  Not in any way I can see.  My best guess is that the upgraded version of the cxf front end jars effectively require resteasy 2.3.6 (which registers a bunch of services).  So we should probably just update the download page and say that the patch is required.

                  • 6. Re: Consuming RESTful web services
                    Ramesh Reddy Master

                    May be we should fold the Resteasy update during the build such that this task is not needed to be done separately.

                    • 7. Re: Consuming RESTful web services
                      Steven Hawkins Master

                      I think the idea behind not including it was that we wanted people to knowingly modify modules outside of Teiid, but we can always just add some sort of disclaimer to the download I suppose.