Forums de discussion

Cant make solr work in 5.2 EE SP3

thumbnail
Sandeep Nair, modifié il y a 13 années.

Cant make solr work in 5.2 EE SP3

Liferay Legend Publications: 1744 Date d'inscription: 06/11/08 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

06:51:14,890 ERROR [SolrIndexWriterImpl:58] org.apache.solr.client.solrj.SolrServerException: org.apache.commons.httpcli
ent.ProtocolException: The server localhost failed to respond with a valid HTTP response
org.apache.solr.client.solrj.SolrServerException: org.apache.commons.httpclient.ProtocolException: The server localhost
failed to respond with a valid HTTP response
        at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:388)
        at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:183)
        at com.liferay.portal.search.solr.server.BasicAuthSolrServer.request(BasicAuthSolrServer.java:102)
        at org.apache.solr.client.solrj.request.UpdateRequest.process(UpdateRequest.java:217)
        at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:63)
        at com.liferay.portal.search.solr.SolrIndexWriterImpl.addDocument(SolrIndexWriterImpl.java:51)
        at com.liferay.portal.search.solr.SolrIndexWriterImpl.updateDocument(SolrIndexWriterImpl.java:112)
        at com.liferay.portal.kernel.search.messaging.SearchWriterMessageListener.doReceive(SearchWriterMessageListener.
java: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

06:51:14,906 ERROR [SearchWriterMessageListener:44] Unable to process message {destinationName=liferay/search_writer, re
sponseDestinationName=null, responseId=null, payload={searchEngineCommand=UPDATE, companyId=0, id=PluginPackageIndexer_P
ORTLET_liferay-ee/wsrp-portlet/5.2.5.1/war, document={title=[Ljava.lang.String;@4a117ftype=[Ljava.lang.String;@c2cef3uid
=[Ljava.lang.String;@1a0d6c9content=[Ljava.lang.String;@754ffdstatus=[Ljava.lang.String;@1d6768fchangeLog=[Ljava.lang.St
ring;@101dfa5installedVersion=[Ljava.lang.String;@1ff7eversion=[Ljava.lang.String;@12ce7c6modified=[Ljava.lang.String;@1
248513license=[Ljava.lang.String;@9ccd0arepositoryURL=[Ljava.lang.String;@594cddgroupId=[Ljava.lang.String;@c54366shortD
escription=[Ljava.lang.String;@cbdef5moduleId=[Ljava.lang.String;@9ada86osi-approved-license=[Ljava.lang.String;@8095c6t
ag=[Ljava.lang.String;@1e9247aportletId=[Ljava.lang.String;@15a0316author=[Ljava.lang.String;@80d069artifactId=[Ljava.la
ng.String;@f2d004}, query=null, sorts=null, start=0, end=0}, values=null}
com.liferay.portal.kernel.search.SearchException: org.apache.commons.httpclient.ProtocolException: The server localhost
failed to respond with a valid HTTP response
        at com.liferay.portal.search.solr.SolrIndexWriterImpl.addDocument(SolrIndexWriterImpl.java:60)
        at com.liferay.portal.search.solr.SolrIndexWriterImpl.updateDocument(SolrIndexWriterImpl.java:112)


Regards,
Sandeep
thumbnail
Sandeep Nair, modifié il y a 13 années.

RE: Cant make solr work in 5.2 EE SP3

Liferay Legend Publications: 1744 Date d'inscription: 06/11/08 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.
thumbnail
Samir Bhatt, modifié il y a 13 années.

RE: Cant make solr work in 5.2 EE SP3

New Member Publications: 10 Date d'inscription: 26/08/09 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
thumbnail
Sandeep Nair, modifié il y a 13 années.

RE: Cant make solr work in 5.2 EE SP3

Liferay Legend Publications: 1744 Date d'inscription: 06/11/08 Publications récentes
Thanks Samir
thumbnail
Sandeep Nair, modifié il y a 13 années.

RE: Cant make solr work in 5.2 EE SP3

Liferay Legend Publications: 1744 Date d'inscription: 06/11/08 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.

for (PluginPackage pluginPackage :
					_getAllAvailablePluginPackages()) {

				String[] statusAndInstalledVersion =
					_getStatusAndInstalledVersion(pluginPackage);

				String status = statusAndInstalledVersion[0];
				String installedVersion = statusAndInstalledVersion[1];

				com.liferay.portal.kernel.search.Document doc =
					PluginPackageIndexer.getPluginPackageDocument(
						pluginPackage.getModuleId(), pluginPackage.getName(),
						pluginPackage.getVersion(),
						pluginPackage.getModifiedDate(),
						pluginPackage.getAuthor(), pluginPackage.getTypes(),
						pluginPackage.getTags(), pluginPackage.getLicenses(),
						pluginPackage.getLiferayVersions(),
						pluginPackage.getShortDescription(),
						pluginPackage.getLongDescription(),
						pluginPackage.getChangeLog(),
						pluginPackage.getPageURL(),
						pluginPackage.getRepositoryURL(), status,
					installedVersion);

				SearchEngineUtil.addDocument(CompanyConstants.SYSTEM, doc);
			}

Regards,
Sandeep
thumbnail
Tina Agrawal, modifié il y a 10 années.

RE: Cant make solr work in 5.2 EE SP3

Expert Publications: 297 Date d'inscription: 03/01/08 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