You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nathaniel Grove <nd...@virginia.edu> on 2010/06/28 16:27:41 UTC

Cocoon Source URLs and Unicode on WAMP Localhost

Hi,

I am using Cocoon 2.1.11 as a webapp in Tomcat on my windows 7 localhost 
WAMP server. The Cocoon app, which displays a catalog of Tibetan texts, 
interfaces with another webapp, a Solr/Lucene instance, for searching. 
When a search call comes into Cocoon, Cocoon calls SOLR to generate an 
XML document that is then processed through Cocoon and displayed. The 
pipeline use is:

            <map:match pattern="search/*">
                <map:generate 
src="{global:solrhost}{1}&amp;start=0{global:solrparams}"/>
                <map:transform src="xsl/search-processing.xsl"/>
                <map:transform src="xsl/search-results.xsl">
                    <map:parameter name="new" value="yes"/>
                    <map:parameter name="start" value="0"/>
                </map:transform>
                <map:serialize type="html" />
            </map:match>

When I run this on our server it works fine, but when I run it locally 
on my localhost, Cocoon responds with "java.io.IOException: Server 
returned HTTP response code: 400" when Unicode Tibetan is passed in the 
parameter (*,{1}), but returns Server returned HTTP response code: 505 
for URLwhen transliteration in Roman characters are used.. In looking at 
the log, the problem with the Tibetan is that SOLR is only receiving 
questions marks "?????" so it appears the Unicode is getting garbled by 
cocoon. In both cases, if I copy the URL from the Cocoon error page and 
paste it into the browser, it brings up the XML results of the search 
from SOLR.

The connection between Cocoon and Solr works on our Linux server, but 
doesn't work on my localhost, which is a pain for development purposes. 
I have set the encoding to UTF-8 for both the HTML and XML serializers 
in the sitemap document, but this has not helped. Any suggestions?

Thanks,

Than Grove

-- 
Nathaniel Grove
Research Associate & Technical Director
Tibetan & Himalayan Library
University of Virginia
http://www.thlib.org


Re: Cocoon Source URLs and Unicode on WAMP Localhost

Posted by Nathaniel Grove <nd...@virginia.edu>.
Yeah, I did that. The connector element for port 8080 has the attribute 
URIEncoding="UTF-8".

Jeroen Reijn wrote:
> Hi,
>
> just to be sure. Have you set the URIEncoding="UTF-8" in you tomcat
> server.xml connector configuration?
>
> Jeroen
>
> On Mon, Jun 28, 2010 at 4:27 PM, Nathaniel Grove <nd...@virginia.edu> wrote:
>   
>> Hi,
>>
>> I am using Cocoon 2.1.11 as a webapp in Tomcat on my windows 7 localhost
>> WAMP server. The Cocoon app, which displays a catalog of Tibetan texts,
>> interfaces with another webapp, a Solr/Lucene instance, for searching. When
>> a search call comes into Cocoon, Cocoon calls SOLR to generate an XML
>> document that is then processed through Cocoon and displayed. The pipeline
>> use is:
>>
>>             <map:match pattern="search/*">
>>                 <map:generate
>> src="{global:solrhost}{1}&amp;start=0{global:solrparams}"/>
>>                 <map:transform src="xsl/search-processing.xsl"/>
>>                 <map:transform src="xsl/search-results.xsl">
>>                     <map:parameter name="new" value="yes"/>
>>                     <map:parameter name="start" value="0"/>
>>                 </map:transform>
>>                 <map:serialize type="html" />
>>             </map:match>
>>
>> When I run this on our server it works fine, but when I run it locally on my
>> localhost, Cocoon responds with "java.io.IOException: Server returned HTTP
>> response code: 400" when Unicode Tibetan is passed in the parameter (*,{1}),
>> but returns Server returned HTTP response code: 505 for URLwhen
>> transliteration in Roman characters are used.. In looking at the log, the
>> problem with the Tibetan is that SOLR is only receiving questions marks
>> "?????" so it appears the Unicode is getting garbled by cocoon. In both
>> cases, if I copy the URL from the Cocoon error page and paste it into the
>> browser, it brings up the XML results of the search from SOLR.
>>
>> The connection between Cocoon and Solr works on our Linux server, but
>> doesn't work on my localhost, which is a pain for development purposes. I
>> have set the encoding to UTF-8 for both the HTML and XML serializers in the
>> sitemap document, but this has not helped. Any suggestions?
>>
>> Thanks,
>>
>> Than Grove
>>
>> --
>> Nathaniel Grove
>> Research Associate & Technical Director
>> Tibetan & Himalayan Library
>> University of Virginia
>> http://www.thlib.org
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>   

-- 
Nathaniel Grove
Research Associate & Technical Director
Tibetan & Himalayan Library
University of Virginia
http://www.thlib.org


Re: Cocoon Source URLs and Unicode on WAMP Localhost

Posted by Jeroen Reijn <j....@onehippo.com>.
Hi,

just to be sure. Have you set the URIEncoding="UTF-8" in you tomcat
server.xml connector configuration?

Jeroen

On Mon, Jun 28, 2010 at 4:27 PM, Nathaniel Grove <nd...@virginia.edu> wrote:
> Hi,
>
> I am using Cocoon 2.1.11 as a webapp in Tomcat on my windows 7 localhost
> WAMP server. The Cocoon app, which displays a catalog of Tibetan texts,
> interfaces with another webapp, a Solr/Lucene instance, for searching. When
> a search call comes into Cocoon, Cocoon calls SOLR to generate an XML
> document that is then processed through Cocoon and displayed. The pipeline
> use is:
>
>             <map:match pattern="search/*">
>                 <map:generate
> src="{global:solrhost}{1}&amp;start=0{global:solrparams}"/>
>                 <map:transform src="xsl/search-processing.xsl"/>
>                 <map:transform src="xsl/search-results.xsl">
>                     <map:parameter name="new" value="yes"/>
>                     <map:parameter name="start" value="0"/>
>                 </map:transform>
>                 <map:serialize type="html" />
>             </map:match>
>
> When I run this on our server it works fine, but when I run it locally on my
> localhost, Cocoon responds with "java.io.IOException: Server returned HTTP
> response code: 400" when Unicode Tibetan is passed in the parameter (*,{1}),
> but returns Server returned HTTP response code: 505 for URLwhen
> transliteration in Roman characters are used.. In looking at the log, the
> problem with the Tibetan is that SOLR is only receiving questions marks
> "?????" so it appears the Unicode is getting garbled by cocoon. In both
> cases, if I copy the URL from the Cocoon error page and paste it into the
> browser, it brings up the XML results of the search from SOLR.
>
> The connection between Cocoon and Solr works on our Linux server, but
> doesn't work on my localhost, which is a pain for development purposes. I
> have set the encoding to UTF-8 for both the HTML and XML serializers in the
> sitemap document, but this has not helped. Any suggestions?
>
> Thanks,
>
> Than Grove
>
> --
> Nathaniel Grove
> Research Associate & Technical Director
> Tibetan & Himalayan Library
> University of Virginia
> http://www.thlib.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon Source URLs and Unicode on WAMP Localhost

Posted by Nathaniel Grove <nd...@virginia.edu>.
That did it! Thanks, Laurent!

Laurent Medioni wrote:
> Hi,
> Dunno where your parameters come from but have a look at http://cocoon.apache.org/2.1/userdocs/concepts/modules-ref.html
> You have to URLEncode (if not already done) your parameters when building a URL, so maybe try <map:generate src="{global:solrhost}{url-encode: {1}}&amp;start=0{global:solrparams}"/> ?
> So you will not rely on auto-magic translations from http servers, proxies, browsers, ...
>
> L
>
> ________________________________________
> From: Nathaniel Grove [mailto:ndg8f@virginia.edu] 
> Sent: lundi, 28. juin 2010 16:28
> To: users@cocoon.apache.org
> Subject: Cocoon Source URLs and Unicode on WAMP Localhost
>
> Hi,
>
> I am using Cocoon 2.1.11 as a webapp in Tomcat on my windows 7 localhost WAMP server. The Cocoon app, which displays a catalog of Tibetan texts, interfaces with another webapp, a Solr/Lucene instance, for searching. When a search call comes into Cocoon, Cocoon calls SOLR to generate an XML document that is then processed through Cocoon and displayed. The pipeline use is:
>
>             <map:match pattern="search/*">
>                 <map:generate src="{global:solrhost}{1}&amp;start=0{global:solrparams}"/>
>                 <map:transform src="xsl/search-processing.xsl"/>
>                 <map:transform src="xsl/search-results.xsl">
>                     <map:parameter name="new" value="yes"/>
>                     <map:parameter name="start" value="0"/>
>                 </map:transform>
>                 <map:serialize type="html" />
>             </map:match>
>
> When I run this on our server it works fine, but when I run it locally on my localhost, Cocoon responds with "java.io.IOException: Server returned HTTP response code: 400" when Unicode Tibetan is passed in the parameter (*,{1}), but returns Server returned HTTP response code: 505 for URLwhen transliteration in Roman characters are used.. In looking at the log, the problem with the Tibetan is that SOLR is only receiving questions marks "?????" so it appears the Unicode is getting garbled by cocoon. In both cases, if I copy the URL from the Cocoon error page and paste it into the browser, it brings up the XML results of the search from SOLR.
>
> The connection between Cocoon and Solr works on our Linux server, but doesn't work on my localhost, which is a pain for development purposes. I have set the encoding to UTF-8 for both the HTML and XML serializers in the sitemap document, but this has not helped. Any suggestions?
>
> Thanks,
>
> Than Grove
>
>
>   

-- 
Nathaniel Grove
Research Associate & Technical Director
Tibetan & Himalayan Library
University of Virginia
http://www.thlib.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: Cocoon Source URLs and Unicode on WAMP Localhost

Posted by Laurent Medioni <lm...@odyssey-group.com>.
Hi,
Dunno where your parameters come from but have a look at http://cocoon.apache.org/2.1/userdocs/concepts/modules-ref.html
You have to URLEncode (if not already done) your parameters when building a URL, so maybe try <map:generate src="{global:solrhost}{url-encode: {1}}&amp;start=0{global:solrparams}"/> ?
So you will not rely on auto-magic translations from http servers, proxies, browsers, ...

L

________________________________________
From: Nathaniel Grove [mailto:ndg8f@virginia.edu] 
Sent: lundi, 28. juin 2010 16:28
To: users@cocoon.apache.org
Subject: Cocoon Source URLs and Unicode on WAMP Localhost

Hi,

I am using Cocoon 2.1.11 as a webapp in Tomcat on my windows 7 localhost WAMP server. The Cocoon app, which displays a catalog of Tibetan texts, interfaces with another webapp, a Solr/Lucene instance, for searching. When a search call comes into Cocoon, Cocoon calls SOLR to generate an XML document that is then processed through Cocoon and displayed. The pipeline use is:

            <map:match pattern="search/*">
                <map:generate src="{global:solrhost}{1}&amp;start=0{global:solrparams}"/>
                <map:transform src="xsl/search-processing.xsl"/>
                <map:transform src="xsl/search-results.xsl">
                    <map:parameter name="new" value="yes"/>
                    <map:parameter name="start" value="0"/>
                </map:transform>
                <map:serialize type="html" />
            </map:match>

When I run this on our server it works fine, but when I run it locally on my localhost, Cocoon responds with "java.io.IOException: Server returned HTTP response code: 400" when Unicode Tibetan is passed in the parameter (*,{1}), but returns Server returned HTTP response code: 505 for URLwhen transliteration in Roman characters are used.. In looking at the log, the problem with the Tibetan is that SOLR is only receiving questions marks "?????" so it appears the Unicode is getting garbled by cocoon. In both cases, if I copy the URL from the Cocoon error page and paste it into the browser, it brings up the XML results of the search from SOLR.

The connection between Cocoon and Solr works on our Linux server, but doesn't work on my localhost, which is a pain for development purposes. I have set the encoding to UTF-8 for both the HTML and XML serializers in the sitemap document, but this has not helped. Any suggestions?

Thanks,

Than Grove


-- 
Nathaniel Grove
Research Associate & Technical Director
Tibetan & Himalayan Library
University of Virginia
http://www.thlib.org

____________________________________________________________

• This email and any files transmitted with it are CONFIDENTIAL and intended
  solely for the use of the individual or entity to which they are addressed.
• Any unauthorized copying, disclosure, or distribution of the material within
  this email is strictly forbidden.
• Any views or opinions presented within this e-mail are solely those of the
  author and do not necessarily represent those of Odyssey Financial
Technologies SA unless otherwise specifically stated.
• An electronic message is not binding on its sender. Any message referring to
  a binding engagement must be confirmed in writing and duly signed.
• If you have received this email in error, please notify the sender immediately
  and delete the original.