Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9089821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:13:59+00:00 2026-06-16T22:13:59+00:00

I have a solr instance running and am able to access it through the

  • 0

I have a solr instance running and am able to access it through the browser and use the Admin to run queries. When I try to access it via Java code in Eclipse, however, I receive the following error:

Exception in thread "main" org.apache.solr.common.SolrException: Server at   http://localhost:8983/solr returned non ok status:404, message:Not Found
at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:372)
at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:181)
at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:90)
at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:301)
at testClass.main(testClass.java:18)

Here is the code I am running:

public static void main(String[] args) throws MalformedURLException, SolrServerException {
    SolrServer server = new HttpSolrServer("http://localhost:8983/solr/");
    ModifiableSolrParams params = new ModifiableSolrParams();
    params.set("myParam", "myValue");
    QueryResponse response = server.query(params);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T22:14:00+00:00Added an answer on June 16, 2026 at 10:14 pm

    It turns out that I had two errors:

    1) My setup actually has a nested solr directory so I needed to add another “solr” level.

    2) I was setting the params variable incorrectly. The first argument sent should be “q”, with the second argument being the “name:value” pairs.

    Updated example, includes passing multiple params at once:

    public static void main(String[] args) throws MalformedURLException, SolrServerException {
        SolrServer server = new HttpSolrServer("http://localhost:8983/solr/solr/");
        ModifiableSolrParams params = new ModifiableSolrParams();
        params.set("q", "param1:value1 AND param2:value2");
        QueryResponse response = server.query(params);
        System.out.println("response = " + response);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I a complete noob at solr/java . I have solr 3.6.1 running on Tomcat(Windows)
I have a single core solr instance running. I want to store two different
I already have a Solr instance running in my JBoss, with custom classes, config
So, I have a Solr instance which processes inputs and queries using StandardTokenizer (as
I have managed to install SOLR and run the admin interface... I have no
I am trying to find documents I have in my solr instance through php.
I have an instance of SOLR 3.6 running, with JSON as the default updateHandler.
ok, I'm totally new to SOLR and Lucene, but have got Solr running out-of-the-box
I have been using solr search and now I am adding pagination via the
I have followed this guide to install Solr in TomCat running on Windows Server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.