Re: Using BasicAuth with SolrJ Code

2017-04-17 Thread Zheng Lin Edwin Yeo
I'm using Solr 6.4.2. The JARs from SolrJ which I'm using are also from Solr 6.4.2. Regards, Edwin On 18 April 2017 at 08:05, Noble Paul wrote: > I tested this with the > > following code > > SolrRequest req = new QueryRequest(new SolrQuery("*:*"));//create a new > req.setBasicAuthCredentials

Re: Using BasicAuth with SolrJ Code

2017-04-17 Thread Noble Paul
I tested this with the following code SolrRequest req = new QueryRequest(new SolrQuery("*:*"));//create a new req.setBasicAuthCredentials("solr", "SolrRocks"); client.setDefaultCollection(COLLECTION); NamedList res = cluster.getSolrClient().request(req); System.out.println("successful"+ Utils.toJ

Re: Using BasicAuth with SolrJ Code

2017-04-15 Thread Zheng Lin Edwin Yeo
Ok, thank you. Regards, Edwin On 15 April 2017 at 08:05, Noble Paul wrote: > I'll test with this and let you know > > On Apr 13, 2017 23:06, "Zheng Lin Edwin Yeo" wrote: > > > The security.json which I'm using is the default one that is available > from > > the Solr Documentation https://cwiki

Re: Using BasicAuth with SolrJ Code

2017-04-14 Thread Noble Paul
I'll test with this and let you know On Apr 13, 2017 23:06, "Zheng Lin Edwin Yeo" wrote: > The security.json which I'm using is the default one that is available from > the Solr Documentation https://cwiki.apache.org/confluence/display/ > solr/Basic+Authentication+Plugin. > > { > "authentication

Re: Using BasicAuth with SolrJ Code

2017-04-13 Thread Zheng Lin Edwin Yeo
The security.json which I'm using is the default one that is available from the Solr Documentation https://cwiki.apache.org/confluence/display/ solr/Basic+Authentication+Plugin. { "authentication":{ "blockUnknown": true, "class":"solr.BasicAuthPlugin", "credentials":{"solr":"IV0EHq1OnNrj6

Re: Using BasicAuth with SolrJ Code

2017-04-13 Thread Noble Paul
That looks good. can you share the security.json (commenting out anything that's sensitive of course) On Wed, Apr 12, 2017 at 5:10 PM, Zheng Lin Edwin Yeo wrote: > This is what I get when I run the code. > > org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error > from server

Re: Using BasicAuth with SolrJ Code

2017-04-12 Thread Zheng Lin Edwin Yeo
This is what I get when I run the code. org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr/testing: Expected mime type application/octet-stream but got text/html. Error 401 require authentication HTTP ERROR 401 Problem accessin

Re: Using BasicAuth with SolrJ Code

2017-04-11 Thread Noble Paul
can u paste the stacktrace here On Tue, Apr 11, 2017 at 1:19 PM, Zheng Lin Edwin Yeo wrote: > I found from StackOverflow that we should declare it this way: > http://stackoverflow.com/questions/43335419/using-basicauth-with-solrj-code > > > SolrRequest req = new QueryRequest(new SolrQuery("*:*")

Re: Using BasicAuth with SolrJ Code

2017-04-10 Thread Zheng Lin Edwin Yeo
I found from StackOverflow that we should declare it this way: http://stackoverflow.com/questions/43335419/using-basicauth-with-solrj-code SolrRequest req = new QueryRequest(new SolrQuery("*:*"));//create a new request object req.setBasicAuthCredentials(userName, password); solrClient.request(re