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

  • Home
  • SEARCH
  • 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 8598539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:10:35+00:00 2026-06-12T01:10:35+00:00

I am using SolrJ for the purposes of an embedded solr server for my

  • 0

I am using SolrJ for the purposes of an embedded solr server for my unit tests.

The problem is that my maven output is littered with solr logs that I don’t really want. For example, I am purposefully triggering a bad query as part of my test. My test passes, but it’s very hard to see that because the screen is filled with Solr errors.

I’m not clear how to get around this with SolrJ. I’d like to do this as part of my POM file so that if a test fails, a dev can edit the POM to expose more information.

EDIT:

Solr is instantiated this way:

System.setProperty("solr.solr.home", "solr/")
def coreInitter = new CoreContainer.Initializer()
def core = coreInitter.initialize()
this.server = new EmbeddedSolrServer(core, "")
  • 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-12T01:10:37+00:00Added an answer on June 12, 2026 at 1:10 am

    The Solr wiki explains that SLF4J is the logging framework used by versions > 1.4

    • http://wiki.apache.org/solr/SolrLogging

    You have not provided the POM dependencies of your project so I’ve made up my own:

    <project>
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.myspotontheweb.demo</groupId>
        <artifactId>demo</artifactId>
        <version>1.0-SNAPSHOT</version>
        <dependencies>
            <dependency>
                   <groupId>org.apache.solr</groupId>
                   <artifactId>solr-solrj</artifactId>
                   <version>3.6.1</version>
                   <exclusions>
                        <exclusion>
                            <groupId>commons-logging</groupId>
                            <artifactId>commons-logging</artifactId>
                        </exclusion>
                   </exclusions>
            </dependency>
            <dependency>
                   <groupId>org.apache.solr</groupId>
                   <artifactId>solr-core</artifactId>
                   <version>3.6.1</version>
            </dependency>
        </dependencies>
    </project>
    

    This has the following dependency tree:

    $ mvn dependency:tree
    ..
    ..
    [INFO] com.myspotontheweb.demo:demo:jar:1.0-SNAPSHOT
    [INFO] +- org.apache.solr:solr-solrj:jar:3.6.1:compile
    [INFO] |  +- commons-httpclient:commons-httpclient:jar:3.1:compile
    [INFO] |  +- commons-io:commons-io:jar:2.1:compile
    [INFO] |  +- org.codehaus.woodstox:wstx-asl:jar:3.2.7:runtime
    [INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.6.1:compile
    [INFO] |  \- org.slf4j:slf4j-api:jar:1.6.1:compile
    [INFO] \- org.apache.solr:solr-core:jar:3.6.1:compile
    [INFO]    +- org.apache.lucene:lucene-core:jar:3.6.1:compile
    [INFO]    +- org.apache.lucene:lucene-analyzers:jar:3.6.1:compile
    [INFO]    +- org.apache.lucene:lucene-highlighter:jar:3.6.1:compile
    [INFO]    +- org.apache.lucene:lucene-kuromoji:jar:3.6.1:compile
    [INFO]    +- org.apache.lucene:lucene-memory:jar:3.6.1:compile
    [INFO]    +- org.apache.lucene:lucene-misc:jar:3.6.1:compile
    [INFO]    +- org.apache.lucene:lucene-phonetic:jar:3.6.1:compile
    [INFO]    +- org.apache.lucene:lucene-queries:jar:3.6.1:compile
    [INFO]    |  \- jakarta-regexp:jakarta-regexp:jar:1.4:compile
    [INFO]    +- org.apache.lucene:lucene-spatial:jar:3.6.1:compile
    [INFO]    +- org.apache.lucene:lucene-spellchecker:jar:3.6.1:compile
    [INFO]    +- org.apache.lucene:lucene-grouping:jar:3.6.1:compile
    [INFO]    +- commons-codec:commons-codec:jar:1.6:compile
    [INFO]    +- commons-fileupload:commons-fileupload:jar:1.2.1:compile
    [INFO]    +- commons-lang:commons-lang:jar:2.6:compile
    [INFO]    +- com.google.guava:guava:jar:r05:compile
    [INFO]    \- javax.servlet:servlet-api:jar:2.4:compile
    

    None of these is a logging implementation jar. You’ll notice that “jcl-over-slf4j” has been added by SolrJ to ensure that commons logging API calls are redirected to SLF4J.

    To completely disable SLF4J logging, add the special NOP dependency:

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-nop</artifactId>
        <version>1.6.1</version>
        <scope>runtime</scope>
    </dependency>
    

    Note the scope declaration. Logging implementation jars are not needed for compiling your code, and can cause problems if another project were to use your project’s POM.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using solrj as client for indexing documents on the solr server. I
I have been using SolrJ, the Java client for Apache Solr server, at my
I'm using solr's faceting and i've run into a problem that i was hoping
I'm having a problem using the Solr ExtendedDisMax Query Parser with query that contains
I am using solr search engine to query an index for classifieds that match
I am completely new to java and I am using Solr search server. It
I am indexing some URIs in SOLR using the UAX29URLEmailTokenizerFactory tokenizer. The problem is
How can I load data from an xml file into solr using the solrj
I am working on Solr in my application. I am using apache-solr-solrj-1.4.0.jar . When
I am using solr server (linux) and sometimes it stops automatically. Can somebody please

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.