Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Sandeep Nair
Cant make solr work in 5.2 EE SP3
22 mai 2010 00:19
Réponse

Sandeep Nair

Rang: Liferay Legend

Publications: 1721

Date d'inscription: 5 novembre 2008

Publications Récentes

Hi,

I have configured liferay to work with solr. When i am uploading new documents its working fine. But when i reindex it gives me exception in console and the search doesnt work
I am getting the following exception
 1
 206:51:14,890 ERROR [SolrIndexWriterImpl:58] org.apache.solr.client.solrj.SolrServerException: org.apache.commons.httpcli
 3ent.ProtocolException: The server localhost failed to respond with a valid HTTP response
 4org.apache.solr.client.solrj.SolrServerException: org.apache.commons.httpclient.ProtocolException: The server localhost
 5failed to respond with a valid HTTP response
 6        at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:388)
 7        at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:183)
 8        at com.liferay.portal.search.solr.server.BasicAuthSolrServer.request(BasicAuthSolrServer.java:102)
 9        at org.apache.solr.client.solrj.request.UpdateRequest.process(UpdateRequest.java:217)
10        at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:63)
11        at com.liferay.portal.search.solr.SolrIndexWriterImpl.addDocument(SolrIndexWriterImpl.java:51)
12        at com.liferay.portal.search.solr.SolrIndexWriterImpl.updateDocument(SolrIndexWriterImpl.java:112)
13        at com.liferay.portal.kernel.search.messaging.SearchWriterMessageListener.doReceive(SearchWriterMessageListener.
14java:78)



Further down i am getting this error which is strange like i dont have that portlet then why is it going to update index for that
 1
 206:51:14,906 ERROR [SearchWriterMessageListener:44] Unable to process message {destinationName=liferay/search_writer, re
 3sponseDestinationName=null, responseId=null, payload={searchEngineCommand=UPDATE, companyId=0, id=PluginPackageIndexer_P
 4ORTLET_liferay-ee/wsrp-portlet/5.2.5.1/war, document={title=[Ljava.lang.String;@4a117ftype=[Ljava.lang.String;@c2cef3uid
 5=[Ljava.lang.String;@1a0d6c9content=[Ljava.lang.String;@754ffdstatus=[Ljava.lang.String;@1d6768fchangeLog=[Ljava.lang.St
 6ring;@101dfa5installedVersion=[Ljava.lang.String;@1ff7eversion=[Ljava.lang.String;@12ce7c6modified=[Ljava.lang.String;@1
 7248513license=[Ljava.lang.String;@9ccd0arepositoryURL=[Ljava.lang.String;@594cddgroupId=[Ljava.lang.String;@c54366shortD
 8escription=[Ljava.lang.String;@cbdef5moduleId=[Ljava.lang.String;@9ada86osi-approved-license=[Ljava.lang.String;@8095c6t
 9ag=[Ljava.lang.String;@1e9247aportletId=[Ljava.lang.String;@15a0316author=[Ljava.lang.String;@80d069artifactId=[Ljava.la
10ng.String;@f2d004}, query=null, sorts=null, start=0, end=0}, values=null}
11com.liferay.portal.kernel.search.SearchException: org.apache.commons.httpclient.ProtocolException: The server localhost
12failed to respond with a valid HTTP response
13        at com.liferay.portal.search.solr.SolrIndexWriterImpl.addDocument(SolrIndexWriterImpl.java:60)
14        at com.liferay.portal.search.solr.SolrIndexWriterImpl.updateDocument(SolrIndexWriterImpl.java:112)


Regards,
Sandeep
Sandeep Nair
RE: Cant make solr work in 5.2 EE SP3
22 mai 2010 07:15
Réponse

Sandeep Nair

Rang: Liferay Legend

Publications: 1721

Date d'inscription: 5 novembre 2008

Publications Récentes

UPDATE
----------------------

Have noticed that when i am disconnected of internet and configure solr its working fine.

So the problem is while i am configuring solr with internet connection on.
Samir Bhatt
RE: Cant make solr work in 5.2 EE SP3
22 mai 2010 22:16
Réponse

Samir Bhatt

Rang: New Member

Publications: 12

Date d'inscription: 26 août 2009

Publications Récentes

Hi Sandeep,

Its seems the issue is with httpclient api. The problem is that if localhost is not mapped to actual IP of your machine in host file. So either we need to use ip address instead of localhost in solr-spring.xml or we need to add entry in host file to map localhost with ip address of the machine.

I replicated the error and tried both options and it worked.

Regards,
Samir Bhatt
Sandeep Nair
RE: Cant make solr work in 5.2 EE SP3
23 mai 2010 01:35
Réponse

Sandeep Nair

Rang: Liferay Legend

Publications: 1721

Date d'inscription: 5 novembre 2008

Publications Récentes

Thanks Samir
Sandeep Nair
RE: Cant make solr work in 5.2 EE SP3
23 mai 2010 02:16
Réponse

Sandeep Nair

Rang: Liferay Legend

Publications: 1721

Date d'inscription: 5 novembre 2008

Publications Récentes

This problem is happening when reload repositories is getting called. It calls a method reindex which tries to do re-indexing of all the plugins available in repository and that is giving error

so even if i configure it properly, the next time when server starts, it again goes to do reindex, which would again give error.
 1
 2for (PluginPackage pluginPackage :
 3                    _getAllAvailablePluginPackages()) {
 4
 5                String[] statusAndInstalledVersion =
 6                    _getStatusAndInstalledVersion(pluginPackage);
 7
 8                String status = statusAndInstalledVersion[0];
 9                String installedVersion = statusAndInstalledVersion[1];
10
11                com.liferay.portal.kernel.search.Document doc =
12                    PluginPackageIndexer.getPluginPackageDocument(
13                        pluginPackage.getModuleId(), pluginPackage.getName(),
14                        pluginPackage.getVersion(),
15                        pluginPackage.getModifiedDate(),
16                        pluginPackage.getAuthor(), pluginPackage.getTypes(),
17                        pluginPackage.getTags(), pluginPackage.getLicenses(),
18                        pluginPackage.getLiferayVersions(),
19                        pluginPackage.getShortDescription(),
20                        pluginPackage.getLongDescription(),
21                        pluginPackage.getChangeLog(),
22                        pluginPackage.getPageURL(),
23                        pluginPackage.getRepositoryURL(), status,
24                    installedVersion);
25
26                SearchEngineUtil.addDocument(CompanyConstants.SYSTEM, doc);
27            }

Regards,
Sandeep
Tina Agrawal
RE: Cant make solr work in 5.2 EE SP3
20 septembre 2013 05:15
Réponse

Tina Agrawal

Rang: Expert

Publications: 295

Date d'inscription: 2 janvier 2008

Publications Récentes

Sandeep,

Did you find a solution for this? I am using Liferay 6.1 GA2 and SOLR 1.4 and facing the same issue.
The document is added and I can even search it from SOLR Admin console but the search fails from Liferay giving the error -
The server localhost failed to respond

My hosts file have the needed entries.

Tina