Details

      Description

      1. Set Solr on tomcat with basic authentication
        • Edit conf/tomcat-users.xml
            <role rolename="role"/>
            <user username="username" password="password" roles="role"/>
          
        • Edit solr/WEB-INF/web.xml
            <security-constraint>
              <web-resource-collection>
                <web-resource-name>Protected Solr</web-resource-name>
                <url-pattern>/*</url-pattern>
                <http-method>GET</http-method>
                <http-method>POST</http-method>
              </web-resource-collection>
              <auth-constraint>
                <role-name>role</role-name>
              </auth-constraint>
            </security-constraint>
          
            <login-config>
              <auth-method>BASIC</auth-method>
              <realm-name>Basic Authentication</realm-name>
            </login-config>
          
            <security-role>
              <description>role</description>
              <role-name>role</role-name>
            </security-role>
          
      2. Set Liferay Solr plugin
        • Edit solr4-web/WEB-INF/classes/META-INF/solr-spring.xml
          	<bean id="com.liferay.portal.search.solr.server.BasicAuthSolrServer" class="com.liferay.portal.search.solr.server.BasicAuthSolrServer">
          		<property name="httpRequestInterceptors">
          			<list>
          				<bean class="com.liferay.portal.search.solr.interceptor.PreemptiveAuthInterceptor" />
          			</list>
          		</property>
          		<property name="username" value="username" />
          		<property name="password" value="password" />
          		<property name="url" value="http://localhost:9080/solr" />
          	</bean>
          
      3. Reindex

      Expected result:
      No errors.

      Actual result:
      When reindex, an exception about "Unauthorized" was thrown:

      08:18:09,097 ERROR [liferay/search_writer/SYSTEM_ENGINE-1][SolrIndexWriter:102] org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      	at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:372)
      	at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:180)
      	at com.liferay.portal.search.solr.server.BasicAuthSolrServer.request(BasicAuthSolrServer.java:98)
      	at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:117)
      	at org.apache.solr.client.solrj.SolrServer.deleteById(SolrServer.java:239)
      	at org.apache.solr.client.solrj.SolrServer.deleteById(SolrServer.java:225)
      	at com.liferay.portal.search.solr.SolrIndexWriter.deleteDocument(SolrIndexWriter.java:95)
      	at com.liferay.portal.search.solr.SolrIndexWriter.updateDocument(SolrIndexWriter.java:172)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyRequest.execute(ProxyRequest.java:85)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyMessageListener.receive(ProxyMessageListener.java:51)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:71)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      	at java.lang.Thread.run(Thread.java:724)
      08:18:09,109 WARN  [liferay/search_writer/SYSTEM_ENGINE-1][ProxyMessageListener:81] com.liferay.portal.kernel.search.SearchException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      com.liferay.portal.kernel.search.SearchException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      	at com.liferay.portal.search.solr.SolrIndexWriter.deleteDocument(SolrIndexWriter.java:104)
      	at com.liferay.portal.search.solr.SolrIndexWriter.updateDocument(SolrIndexWriter.java:172)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyRequest.execute(ProxyRequest.java:85)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyMessageListener.receive(ProxyMessageListener.java:51)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:71)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      	at java.lang.Thread.run(Thread.java:724)
      08:18:09,177 ERROR [liferay/search_writer/SYSTEM_ENGINE-1][SolrIndexWriter:102] org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      	at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:372)
      	at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:180)
      	at com.liferay.portal.search.solr.server.BasicAuthSolrServer.request(BasicAuthSolrServer.java:98)
      	at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:117)
      	at org.apache.solr.client.solrj.SolrServer.deleteById(SolrServer.java:239)
      	at org.apache.solr.client.solrj.SolrServer.deleteById(SolrServer.java:225)
      	at com.liferay.portal.search.solr.SolrIndexWriter.deleteDocument(SolrIndexWriter.java:95)
      	at com.liferay.portal.search.solr.SolrIndexWriter.updateDocument(SolrIndexWriter.java:172)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyRequest.execute(ProxyRequest.java:85)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyMessageListener.receive(ProxyMessageListener.java:51)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:71)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      	at java.lang.Thread.run(Thread.java:724)
      08:18:09,183 WARN  [liferay/search_writer/SYSTEM_ENGINE-1][ProxyMessageListener:81] com.liferay.portal.kernel.search.SearchException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      com.liferay.portal.kernel.search.SearchException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      	at com.liferay.portal.search.solr.SolrIndexWriter.deleteDocument(SolrIndexWriter.java:104)
      	at com.liferay.portal.search.solr.SolrIndexWriter.updateDocument(SolrIndexWriter.java:172)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyRequest.execute(ProxyRequest.java:85)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyMessageListener.receive(ProxyMessageListener.java:51)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:71)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      	at java.lang.Thread.run(Thread.java:724)
      08:18:09,282 ERROR [liferay/search_writer/SYSTEM_ENGINE-1][SolrIndexWriter:102] org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      	at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:372)
      	at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:180)
      	at com.liferay.portal.search.solr.server.BasicAuthSolrServer.request(BasicAuthSolrServer.java:98)
      	at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:117)
      	at org.apache.solr.client.solrj.SolrServer.deleteById(SolrServer.java:239)
      	at org.apache.solr.client.solrj.SolrServer.deleteById(SolrServer.java:225)
      	at com.liferay.portal.search.solr.SolrIndexWriter.deleteDocument(SolrIndexWriter.java:95)
      	at com.liferay.portal.search.solr.SolrIndexWriter.updateDocument(SolrIndexWriter.java:172)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyRequest.execute(ProxyRequest.java:85)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyMessageListener.receive(ProxyMessageListener.java:51)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:71)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      	at java.lang.Thread.run(Thread.java:724)
      08:18:09,298 WARN  [liferay/search_writer/SYSTEM_ENGINE-1][ProxyMessageListener:81] com.liferay.portal.kernel.search.SearchException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      com.liferay.portal.kernel.search.SearchException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      	at com.liferay.portal.search.solr.SolrIndexWriter.deleteDocument(SolrIndexWriter.java:104)
      	at com.liferay.portal.search.solr.SolrIndexWriter.updateDocument(SolrIndexWriter.java:172)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyRequest.execute(ProxyRequest.java:85)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyMessageListener.receive(ProxyMessageListener.java:51)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:71)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      	at java.lang.Thread.run(Thread.java:724)
      08:18:09,321 ERROR [liferay/search_writer/SYSTEM_ENGINE-2][SolrIndexWriter:102] org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      	at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:372)
      	at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:180)
      	at com.liferay.portal.search.solr.server.BasicAuthSolrServer.request(BasicAuthSolrServer.java:98)
      	at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:117)
      	at org.apache.solr.client.solrj.SolrServer.deleteById(SolrServer.java:239)
      	at org.apache.solr.client.solrj.SolrServer.deleteById(SolrServer.java:225)
      	at com.liferay.portal.search.solr.SolrIndexWriter.deleteDocument(SolrIndexWriter.java:95)
      	at com.liferay.portal.search.solr.SolrIndexWriter.updateDocument(SolrIndexWriter.java:172)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyRequest.execute(ProxyRequest.java:85)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyMessageListener.receive(ProxyMessageListener.java:51)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:71)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      	at java.lang.Thread.run(Thread.java:724)
      08:18:09,337 WARN  [liferay/search_writer/SYSTEM_ENGINE-2][ProxyMessageListener:81] com.liferay.portal.kernel.search.SearchException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      com.liferay.portal.kernel.search.SearchException: Server at http://localhost:9080/solr returned non ok status:401, message:Unauthorized
      	at com.liferay.portal.search.solr.SolrIndexWriter.deleteDocument(SolrIndexWriter.java:104)
      	at com.liferay.portal.search.solr.SolrIndexWriter.updateDocument(SolrIndexWriter.java:172)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyRequest.execute(ProxyRequest.java:85)
      	at com.liferay.portal.kernel.messaging.proxy.ProxyMessageListener.receive(ProxyMessageListener.java:51)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:71)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      	at java.lang.Thread.run(Thread.java:724)
      
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 21 weeks, 3 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 M3