|
From: Dileepa J. <dil...@gm...> - 2015-08-05 10:43:47
|
Hi All,
I'm developing a connector to Apache ManifoldCF and in my connector I'm
using RestEasy 3.0.8 Final version. When I invoke the Rest API in a
standalone java class (Main method) it works, but when I added the my
component jar with all dependencies (including RestEasy 3.0.8 related
dependencies: ) to ManifoldCF I keep getting below dependency error in
runtime.
I think it's due to some cyclic dependency issue with ManifoldCF and
RestEasy 3.0.8 used in my component.
I tried out this in both ManifoldCF 1.8 and 2.1 both get the same error.
Can someone please give me pointers on what dependencies I should resolve?
ERROR 2015-08-05 16:07:48,401 (Worker thread '4') - Error enhancing the
document :
file:/Users/djayakody/Documents/zaizi/manifoldTest/simple/sample0.txt
javax.ws.rs.ProcessingException: Unable to invoke request
at
org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:287)
at
org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:407)
at
org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.post(ClientInvocationBuilder.java:195)
at
org.apache.stanbol.client.rest.RestClientExecutor.post(RestClientExecutor.java:63)
at
org.apache.stanbol.client.enhancer.impl.EnhancerImpl.enhance(EnhancerImpl.java:74)
at
org.apache.manifoldcf.agents.transformation.stanbol.StanbolEnhancer.addOrReplaceDocumentWithException(StanbolEnhancer.java:251)
at
org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineAddEntryPoint.addOrReplaceDocumentWithException(IncrementalIngester.java:3221)
at
org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineAddFanout.sendDocument(IncrementalIngester.java:3072)
at
org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$MonitoredAddActivityWrapper.sendDocument(IncrementalIngester.java:3466)
at
org.apache.manifoldcf.agents.transformation.tika.TikaExtractor.addOrReplaceDocumentWithException(TikaExtractor.java:324)
at
org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineAddEntryPoint.addOrReplaceDocumentWithException(IncrementalIngester.java:3221)
at
org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineAddFanout.sendDocument(IncrementalIngester.java:3072)
at
org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineObjectWithVersions.addOrReplaceDocumentWithException(IncrementalIngester.java:2706)
at
org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester.documentIngest(IncrementalIngester.java:756)
at
org.apache.manifoldcf.crawler.system.WorkerThread$ProcessActivity.ingestDocumentWithException(WorkerThread.java:1503)
at
org.apache.manifoldcf.crawler.system.WorkerThread$ProcessActivity.ingestDocumentWithException(WorkerThread.java:1468)
at
org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector.processDocuments(FileConnector.java:404)
at
org.apache.manifoldcf.crawler.system.WorkerThread.run(WorkerThread.java:379)
*Caused by: javax.ws.rs.ProcessingException: could not find writer for
content-type text/plain type: java.io.ByteArrayInputStream * at
org.jboss.resteasy.core.interception.ClientWriterInterceptorContext.throwWriterNotFoundException(ClientWriterInterceptorContext.java:40)
at
org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.getWriter(AbstractWriterInterceptorContext.java:138)
at
org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:117)
at
org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.writeRequestBody(ClientInvocation.java:341)
at
org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.writeRequestBodyToOutputStream(ApacheHttpClient4Engine.java:558)
at
org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.buildEntity(ApacheHttpClient4Engine.java:524)
Thanks,
Dileepa
|
|
From: Ron S. <rs...@re...> - 2015-09-17 17:47:09
|
Hi Dileepa, This is a strange problem. org.jboss.resteasy.plugins.providers.InputStreamProvider, in the resteasy-jaxrs jar, can write a ByteArrayInputStream. By default, org.jboss.resteasy.spi.ResteasyProviderFactory should load all of the providers in the file META-INF/services/javax.ws.rs.ext.Providers, which is in the resteasy-jaxrs jar. If you execute ResteasyProviderFactory.getInstance().isRegisterBuiltins(), you should get true. If you execute ResteasyProviderFactory.getInstance().getClientMessageBodyWriters() and ResteasyProviderFactory.getInstance().getServerMessageBodyWriters(), you should see InputStreamProvider. You could also try stepping through org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(), which is responsible for loading the providers listed in javax.ws.rs.ext.Providers. I don't know what's going on in your case. Maybe you'll see something suggestive if you try these things. By the way, why do you think it's a dependency problem? -Ron On 08/05/2015 06:43 AM, Dileepa Jayakody wrote: > Hi All, > I'm developing a connector to Apache ManifoldCF and in my connector > I'm using RestEasy 3.0.8 Final version. When I invoke the Rest API in > a standalone java class (Main method) it works, but when I added the > my component jar with all dependencies (including RestEasy 3.0.8 > related dependencies: ) to ManifoldCF I keep getting below dependency > error in runtime. > I think it's due to some cyclic dependency issue with ManifoldCF and > RestEasy 3.0.8 used in my component. > I tried out this in both ManifoldCF 1.8 and 2.1 both get the same error. > > Can someone please give me pointers on what dependencies I should resolve? > > > ERROR 2015-08-05 16:07:48,401 (Worker thread '4') - Error enhancing > the document : > file:/Users/djayakody/Documents/zaizi/manifoldTest/simple/sample0.txt > javax.ws.rs.ProcessingException: Unable to invoke request > at > org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:287) > at > org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:407) > at > org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.post(ClientInvocationBuilder.java:195) > at > org.apache.stanbol.client.rest.RestClientExecutor.post(RestClientExecutor.java:63) > at > org.apache.stanbol.client.enhancer.impl.EnhancerImpl.enhance(EnhancerImpl.java:74) > at > org.apache.manifoldcf.agents.transformation.stanbol.StanbolEnhancer.addOrReplaceDocumentWithException(StanbolEnhancer.java:251) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineAddEntryPoint.addOrReplaceDocumentWithException(IncrementalIngester.java:3221) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineAddFanout.sendDocument(IncrementalIngester.java:3072) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$MonitoredAddActivityWrapper.sendDocument(IncrementalIngester.java:3466) > at > org.apache.manifoldcf.agents.transformation.tika.TikaExtractor.addOrReplaceDocumentWithException(TikaExtractor.java:324) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineAddEntryPoint.addOrReplaceDocumentWithException(IncrementalIngester.java:3221) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineAddFanout.sendDocument(IncrementalIngester.java:3072) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineObjectWithVersions.addOrReplaceDocumentWithException(IncrementalIngester.java:2706) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester.documentIngest(IncrementalIngester.java:756) > at > org.apache.manifoldcf.crawler.system.WorkerThread$ProcessActivity.ingestDocumentWithException(WorkerThread.java:1503) > at > org.apache.manifoldcf.crawler.system.WorkerThread$ProcessActivity.ingestDocumentWithException(WorkerThread.java:1468) > at > org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector.processDocuments(FileConnector.java:404) > at > org.apache.manifoldcf.crawler.system.WorkerThread.run(WorkerThread.java:379) > *Caused by: javax.ws.rs.ProcessingException: could not find writer for > content-type text/plain type: java.io.ByteArrayInputStream > * at > org.jboss.resteasy.core.interception.ClientWriterInterceptorContext.throwWriterNotFoundException(ClientWriterInterceptorContext.java:40) > at > org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.getWriter(AbstractWriterInterceptorContext.java:138) > at > org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:117) > at > org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.writeRequestBody(ClientInvocation.java:341) > at > org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.writeRequestBodyToOutputStream(ApacheHttpClient4Engine.java:558) > at > org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.buildEntity(ApacheHttpClient4Engine.java:524) > > > Thanks, > Dileepa > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers |
|
From: Dileepa J. <dil...@gm...> - 2015-09-18 05:03:35
|
Hi Ron, Thank you very much for your reply. I will go through the steps you have mentioned to figure out the problem. On Thu, Sep 17, 2015 at 11:17 PM, Ron Sigal <rs...@re...> wrote: > Hi Dileepa, > > This is a strange problem. > org.jboss.resteasy.plugins.providers.InputStreamProvider, in the > resteasy-jaxrs jar, can write a ByteArrayInputStream. By default, > org.jboss.resteasy.spi.ResteasyProviderFactory should load all of the > providers in the file META-INF/services/javax.ws.rs.ext.Providers, which is > in the resteasy-jaxrs jar. > > If you execute ResteasyProviderFactory.getInstance().isRegisterBuiltins(), > you should get true. If you execute > ResteasyProviderFactory.getInstance().getClientMessageBodyWriters() and > ResteasyProviderFactory.getInstance().getServerMessageBodyWriters(), you > should see InputStreamProvider. You could also try stepping through > org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(), which is > responsible for loading the providers listed in javax.ws.rs.ext.Providers. > > I don't know what's going on in your case. Maybe you'll see something > suggestive if you try these things. > > By the way, why do you think it's a dependency problem? > I thought it's a dependency issue because, ManifoldCF also has RestEasy dependency lib which is of a different version and I think at runtime my connector get's wired to the RestEasy lib from ManifoldCF instead of the rest easy 3.0.8 dependency library inside my connector. As a work around I used Jersey Rest client for my connector and proceeded with the development. But it's good if I can sort out this issue and use RestEasy. Thanks, Dileepa > -Ron > > > > On 08/05/2015 06:43 AM, Dileepa Jayakody wrote: > > Hi All, > I'm developing a connector to Apache ManifoldCF and in my connector I'm > using RestEasy 3.0.8 Final version. When I invoke the Rest API in a > standalone java class (Main method) it works, but when I added the my > component jar with all dependencies (including RestEasy 3.0.8 related > dependencies: ) to ManifoldCF I keep getting below dependency error in > runtime. > I think it's due to some cyclic dependency issue with ManifoldCF and > RestEasy 3.0.8 used in my component. > I tried out this in both ManifoldCF 1.8 and 2.1 both get the same error. > > Can someone please give me pointers on what dependencies I should resolve? > > > ERROR 2015-08-05 16:07:48,401 (Worker thread '4') - Error enhancing the > document : > file:/Users/djayakody/Documents/zaizi/manifoldTest/simple/sample0.txt > javax.ws.rs.ProcessingException: Unable to invoke request > at > org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:287) > at > org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:407) > at > org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.post(ClientInvocationBuilder.java:195) > at > org.apache.stanbol.client.rest.RestClientExecutor.post(RestClientExecutor.java:63) > at > org.apache.stanbol.client.enhancer.impl.EnhancerImpl.enhance(EnhancerImpl.java:74) > at > org.apache.manifoldcf.agents.transformation.stanbol.StanbolEnhancer.addOrReplaceDocumentWithException(StanbolEnhancer.java:251) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineAddEntryPoint.addOrReplaceDocumentWithException(IncrementalIngester.java:3221) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineAddFanout.sendDocument(IncrementalIngester.java:3072) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$MonitoredAddActivityWrapper.sendDocument(IncrementalIngester.java:3466) > at > org.apache.manifoldcf.agents.transformation.tika.TikaExtractor.addOrReplaceDocumentWithException(TikaExtractor.java:324) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineAddEntryPoint.addOrReplaceDocumentWithException(IncrementalIngester.java:3221) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineAddFanout.sendDocument(IncrementalIngester.java:3072) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester$PipelineObjectWithVersions.addOrReplaceDocumentWithException(IncrementalIngester.java:2706) > at > org.apache.manifoldcf.agents.incrementalingest.IncrementalIngester.documentIngest(IncrementalIngester.java:756) > at > org.apache.manifoldcf.crawler.system.WorkerThread$ProcessActivity.ingestDocumentWithException(WorkerThread.java:1503) > at > org.apache.manifoldcf.crawler.system.WorkerThread$ProcessActivity.ingestDocumentWithException(WorkerThread.java:1468) > at > org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector.processDocuments(FileConnector.java:404) > at > org.apache.manifoldcf.crawler.system.WorkerThread.run(WorkerThread.java:379) > > *Caused by: javax.ws.rs.ProcessingException: could not find writer for > content-type text/plain type: java.io.ByteArrayInputStream * at > org.jboss.resteasy.core.interception.ClientWriterInterceptorContext.throwWriterNotFoundException(ClientWriterInterceptorContext.java:40) > at > org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.getWriter(AbstractWriterInterceptorContext.java:138) > at > org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:117) > at > org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.writeRequestBody(ClientInvocation.java:341) > at > org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.writeRequestBodyToOutputStream(ApacheHttpClient4Engine.java:558) > at > org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.buildEntity(ApacheHttpClient4Engine.java:524) > > > Thanks, > Dileepa > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > Resteasy-developers mailing lis...@li...://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > > > ------------------------------------------------------------------------------ > Monitor Your Dynamic Infrastructure at Any Scale With Datadog! > Get real-time metrics from all of your servers, apps and tools > in one place. > SourceForge users - Click here to start your Free Trial of Datadog now! > http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > |