Created issue:

https://issues.apache.org/jira/browse/CAMEL-9736


On Mon, Mar 21, 2016 at 2:32 AM, Claus Ibsen <[email protected]> wrote:
> Hi
>
> Sounds like we could improve this, so you can specify the content-type
> using the Exchange.CONTENT_TYPE header.
> You are welcome to log a JIRA
> http://camel.apache.org/support.html
>
> On Mon, Mar 21, 2016 at 12:30 AM, Mansour Al Akeel
> <[email protected]> wrote:
>> Thank you Quinn,
>>
>> Unfortunately, I am having difficulties getting 2.17-SNAPSHOT to work.
>> I am getting this issue, and posted to the list in another thread.
>>
>> Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
>>
>> I downgrade to solr 4.10, but now having another problem with content
>> type. It looks like SolrProducer guesses the content type from the
>> file. This is from the source of SolrProducer.java:
>>
>>         if (body instanceof File) {
>>             MimetypesFileTypeMap mimeTypesMap = new MimetypesFileTypeMap();
>>             String mimeType = mimeTypesMap.getContentType((File)body);
>>             ContentStreamUpdateRequest updateRequest = new
>> ContentStreamUpdateRequest(getRequestHandler());
>>             updateRequest.addFile((File) body, mimeType);
>>
>> And for HTML files it's getting it as application/octet-stream:
>>
>> [ERROR] org.apache.solr.common.SolrException: Unsupported ContentType:
>> application/octet-stream  Not in: [application/xml, application/csv,
>> application/json, text/json, text/csv, text/xml, application/javabin]
>>     at 
>> org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:93)
>>     at 
>> org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:74)
>>     at 
>> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
>>     at org.apache.solr.core.SolrCore.execute(SolrCore.java:1976)
>>     at 
>> org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:777)
>>
>>
>> I tried to set it manually:
>>
>>         from("file:" + this.htmlDocsPath +
>> "/?delay=2000&noop=true&probeContentType=false") //
>>                 .setHeader(SolrConstants.OPERATION,
>> constant(SolrConstants.OPERATION_INSERT_STREAMING))//
>>                 .setHeader(SolrConstants.FIELD + "id", body())//
>>                 .setHeader(Exchange.CONTENT_TYPE, constant("text/xml"))//
>>                 .setHeader(Exchange.FILE_CONTENT_TYPE, constant("text/xml"))
>>                 .to(solrURL);
>>
>> But no luck. I will have to find anther way to do this. So the fight 
>> continues !
>>
>>
>>
>> On Sun, Mar 20, 2016 at 3:10 PM, Quinn Stevenson
>> <[email protected]> wrote:
>>> You can check the version of Solr that Camel is using in the parent pom for 
>>> the version of Camel you’re using.
>>>
>>> https://github.com/apache/camel/blob/master/parent/pom.xml 
>>> <https://github.com/apache/camel/blob/master/parent/pom.xml>
>>>
>>> For 2.17-SNAPSHOT, it looks like it’s using Solr 5.3
>>>
>>>> On Mar 18, 2016, at 11:54 PM, Mansour Al Akeel <[email protected]> 
>>>> wrote:
>>>>
>>>> Is the solr component compatible with solr 5.X ?
>>>>
>>>> Thank you.
>>>
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to