You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by satya swaroop <ss...@gmail.com> on 2010/09/02 09:35:34 UTC

stream.url

Hi all,

      I am using stream.url to index the files in the remote system. when i
use the url as
1) curl "
http://localhost:8080/solr/update/extract?stream.url=http://remotehost:port/file_download.yaws?file=yaws_presentation.pdf&literal.id=schb4
"
it works and i get the response as the file got indexed.

but when i use
2) curl "
http://localhost:8080/solr/update/extract?stream.url=http://remotehost:port/file_download.yaws?file=solr&
apache.pdf&
literal.id=schb5"
i get the error in the solr... i replaced the escaped characters with %20
for space and %26 for &, but the error is same saying

""Unexpected end of file from server java.net.SocketException..""

when i used without solr as http://remotehost:port/file_download.yaws?file=solr
& apache.pdf then i get the file downloaded to my system.....

I here enclose the entire error=====

HTTP Status 500 - Unexpected end of file from server
java.net.SocketException: Unexpected end of file from server at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at
sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1368)
at java.security.AccessController.doPrivileged(Native Method) at
sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1362)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1016)
at
org.apache.solr.common.util.ContentStreamBase$URLStream.getStream(ContentStreamBase.java:88)
at
org.apache.solr.handler.extraction.ExtractingDocumentLoader.load(ExtractingDocumentLoader.java:169)
at
org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:57)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:133)
at
org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.handleRequest(RequestHandlers.java:242)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1355) at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:340)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619) Caused by:
java.net.SocketException: Unexpected end of file from server at
sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:769) at
sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632) at
sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:766) at
sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632) at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1072)
at
sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2173)
at java.net.URLConnection.getContentType(URLConnection.java:485) at
org.apache.solr.common.util.ContentStreamBase$URLStream.<init>(ContentStreamBase.java:81)
at
org.apache.solr.servlet.SolrRequestParsers.buildRequestFrom(SolrRequestParsers.java:138)
at
org.apache.solr.servlet.SolrRequestParsers.parse(SolrRequestParsers.java:117)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:226)
... 12 more


can anybody provide information regarding this??


Regards,
Satya

Re: stream.url

Posted by satya swaroop <ss...@gmail.com>.
Hi all,

      I am unable to index the files of remote system that contains escaped
characters in  their file names.... i think there is a problem in solr for
indexing the files of escaped characters in remote system...
Has anybody tried to index the files in remote system that contain the
escaped characters.... But solr is working good for files that has no
escaped characters in their name.....


I sent the request through the curl by encoding the filename in url format
but the problem is same...

Regards,
satya

Re: stream.url

Posted by satya swaroop <ss...@gmail.com>.
Hi,
    I made the curl from the shell(command prompt or terminal) with the
escaping characters but the error is same.... when i saw in the remote
system the request is not getting there.... Is there anything to be changed
in config file inorder to enable the escaping characters for stream.url????

Did anybody try indexing files in remote system through stream.url,  where
the files name contain escape characters like &,space

regards,
satya

Re: stream.url

Posted by Stefan Moises <mo...@shoptimax.de>.
  Hi,

well, you'll have to write a routine which escapes all filenames before 
transmitting... wether in a shell, in Java, PHP, Javascript or whereever 
you are submitting your CURL calls.
Here is a javascript example that helps with escaping: 
http://www.xs4all.nl/~jlpoutre/BoT/Javascript/Utils/endecode.html

Cheers,
Stefan

Am 02.09.2010 10:07, schrieb satya swaroop:
> Hi stefan,
>                 I used escape charaters and made it... It is not problem for
> a single file of 'solr&apache' but it shows the same problem for the files
> like Wireless lan.ppt, Tom info.pdf.....
>
> the curl i sent is::
>
> curl "
> http://localhost:8080/solr/update/extract?stream.url=http://remotehost:port/file_download.yaws%3Ffile=solr<http://localhost:8080/solr/update/extract?stream.url=http://remotehost:port/file_download.yaws?file=solr>
> %20%26%20apache.pdf&literal.id=schb5"
>
> Regards,
> satya
>

-- 
*******************************************
Stefan Moises
Senior Softwareentwickler

shoptimax GmbH
Guntherstraße 45 a
90461 Nürnberg
Amtsgericht Nürnberg HRB 21703
GF Friedrich Schreieck

Tel.: 0911/25566-25
Fax:  0911/25566-29
moises@shoptimax.de
http://www.shoptimax.de
*******************************************


Re: stream.url

Posted by satya swaroop <ss...@gmail.com>.
Hi Hoss,

             Thanks for reply and it got working.... The reason was as you
said i was not double escaping.... i used %2520 for whitespace and it is
working now

Thanks,
satya

Re: stream.url

Posted by Chris Hostetter <ho...@fucit.org>.
:                I used escape charaters and made it... It is not problem for
: a single file of 'solr &apache' but it shows the same problem for the files
: like Wireless lan.ppt, Tom info.pdf.....

Since you haven't told us what the original URL is that you are trying to 
pass as a value for the stream.url value, it's impossible for us to guess 
wehter your URL escaping is working properly.

bear in mind that you need to escape url metacharacters *twice* for this 
type of thing -- once to encode the URL in a way that the final server 
will recognize it, and once again to pass it as a value in a URL to Solr.

since you explicitly mention having problems with white space, but i don't 
see any %25 or %2B sequences in your URL i'm going to guess that the 
porblem is you are not double escaping the white space properly -- the 
first time you escape it it should either be "+" or "%20" which means the 
second time it should either be "%2B" or "%2520"


-Hoss

--
http://lucenerevolution.org/  ...  October 7-8, Boston
http://bit.ly/stump-hoss      ...  Stump The Chump!


Re: stream.url

Posted by satya swaroop <ss...@gmail.com>.
Hi stefan,
               I used escape charaters and made it... It is not problem for
a single file of 'solr &apache' but it shows the same problem for the files
like Wireless lan.ppt, Tom info.pdf.....

the curl i sent is::

curl "
http://localhost:8080/solr/update/extract?stream.url=http://remotehost:port/file_download.yaws%3Ffile=solr<http://localhost:8080/solr/update/extract?stream.url=http://remotehost:port/file_download.yaws?file=solr>
%20%26%20apache.pdf&literal.id=schb5"

Regards,
satya

Re: stream.url

Posted by Stefan Moises <mo...@shoptimax.de>.
  Hi,

this has nothing to do with Solr... you can't use a filename containing 
"&" as a URL parameter... if you really need to submit such a weird 
named file, you have to escape the "&", see 
http://www.december.com/html/spec/esccodes.html for the code...

Cheers,
Stefan

Am 02.09.2010 09:35, schrieb satya swaroop:
> Hi all,
>
>        I am using stream.url to index the files in the remote system. when i
> use the url as
> 1) curl "
> http://localhost:8080/solr/update/extract?stream.url=http://remotehost:port/file_download.yaws?file=yaws_presentation.pdf&literal.id=schb4
> "
> it works and i get the response as the file got indexed.
>
> but when i use
> 2) curl "
> http://localhost:8080/solr/update/extract?stream.url=http://remotehost:port/file_download.yaws?file=solr&
> apache.pdf&
> literal.id=schb5"
> i get the error in the solr... i replaced the escaped characters with %20
> for space and %26 for&, but the error is same saying
>
> ""Unexpected end of file from server java.net.SocketException..""
>
> when i used without solr as http://remotehost:port/file_download.yaws?file=solr
> &  apache.pdf then i get the file downloaded to my system.....
>
> I here enclose the entire error=====
>
> HTTP Status 500 - Unexpected end of file from server
> java.net.SocketException: Unexpected end of file from server at
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at
> sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1368)
> at java.security.AccessController.doPrivileged(Native Method) at
> sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1362)
> at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1016)
> at
> org.apache.solr.common.util.ContentStreamBase$URLStream.getStream(ContentStreamBase.java:88)
> at
> org.apache.solr.handler.extraction.ExtractingDocumentLoader.load(ExtractingDocumentLoader.java:169)
> at
> org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:57)
> at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:133)
> at
> org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.handleRequest(RequestHandlers.java:242)
> at org.apache.solr.core.SolrCore.execute(SolrCore.java:1355) at
> org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:340)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
> at java.lang.Thread.run(Thread.java:619) Caused by:
> java.net.SocketException: Unexpected end of file from server at
> sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:769) at
> sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632) at
> sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:766) at
> sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632) at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1072)
> at
> sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2173)
> at java.net.URLConnection.getContentType(URLConnection.java:485) at
> org.apache.solr.common.util.ContentStreamBase$URLStream.<init>(ContentStreamBase.java:81)
> at
> org.apache.solr.servlet.SolrRequestParsers.buildRequestFrom(SolrRequestParsers.java:138)
> at
> org.apache.solr.servlet.SolrRequestParsers.parse(SolrRequestParsers.java:117)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:226)
> ... 12 more
>
>
> can anybody provide information regarding this??
>
>
> Regards,
> Satya
>

-- 
*******************************************
Stefan Moises
Senior Softwareentwickler

shoptimax GmbH
Guntherstraße 45 a
90461 Nürnberg
Amtsgericht Nürnberg HRB 21703
GF Friedrich Schreieck

Tel.: 0911/25566-25
Fax:  0911/25566-29
moises@shoptimax.de
http://www.shoptimax.de
*******************************************