lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jennifer Coston <Jennifer.Cos...@raytheon.com>
Subject RE: Can I use SolrJ 6.3.0 to talk to a Solr 5.2.3 server?
Date Wed, 04 Jan 2017 15:29:38 GMT
Can anyone explain how to get rid of this error?

java.lang.Exception: Assertions mismatch: -ea was not specified but -Dtests.asserts=true
	at __randomizedtesting.SeedInfo.seed([5B25E606A72BD541]:0)
	at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:47)
	at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
	at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
	at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:54)
	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:367)
	at java.lang.Thread.run(Thread.java:745)


Here is my test class:

public class SolrCatalogClientTest extends SolrJettyTestBase {

	private static SolrCatalogClient solrClient;	
	protected static JettySolrRunner SOLR;
		
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		System.setProperty("tests.asserts", "false");
		System.setProperty("solr.solr.home", "solr/conf");
		System.setProperty("solr.core.name", "mySolrCore");
		System.setProperty("solr.data.dir", new File("target/solr-embedded-data").getAbsolutePath());
		
		System.out.println("Initializing Solr for JUnit tests");
		
		SOLR = createJetty(
				"target/solr-embedded-data",
				JettyConfig.builder()
					.setPort(8983)
					.setContext("/solr")
					.stopAtShutdown(true)
					.build());

		solrClient = new SolrCatalogClient();

	...}
}

Should I be using initCore instead of createJetty?

Thank you!
-Jennifer

-----Original Message-----
From: Shawn Heisey [mailto:apache@elyograg.org] 
Sent: Tuesday, January 03, 2017 2:31 PM
To: solr-user@lucene.apache.org
Subject: Re: Can I use SolrJ 6.3.0 to talk to a Solr 5.2.3 server?

On 1/3/2017 10:35 AM, Jennifer Coston wrote:
> I am running into a conflict with Solr and ElasticSearch. We are trying to add support
for Elastic Search 5.1.1 which requires Lucene 6.3.0 to an existing system that uses Solr
5.2.3. At the moment I am using SolrJ 5.3.1 to talk to the 5.2.3 Server. I was hoping I could
just update the SolrJ libraries to 6.3.0 so the Lucene conflict goes away, but when I try
to run my unit tests I'm seeing this error:

There is no 5.2.3 version of Solr.  The 5.2.x line ended with 5.2.1. 
There is a 5.3.2 version.

If you're using HttpSolrClient, mixing a 5.x server and a 6.x client will be no problem at
all.  If you're using CloudSolrClient you may run into issues because of the very rapid pace
of change in SolrCloud -- mixing major versions is not recommended.  If you're using EmbeddedSolrServer,
then the client and the server are not separate, so upgrading both at once is probably OK,
but the code and the core config might require changes.

> java.util.ServiceConfigurationError: Cannot instantiate SPI class: 
> org.apache.lucene.codecs.simpletext.SimpleTextPostingsFormat

This is an error from a Solr *server*, not a client.  Are you using EmbeddedSolrServer?

> Here are the Solr Dependencies I have in my pom.xml:

You've got a solr-core dependency here.  That is not at all necessary for a SolrJ client,
*unless* you are using EmbeddedSolrServer.  If you are using the embedded server, then things
are much more complicated, and your code may require changes before it will work correctly
with a new major version.  The embedded server is NOT recommended unless you have no other
choice.  The unit tests included with Solr are able to fire up Solr with Jetty for tests,
just like a real separate Solr server.  Your tests can also do this.  Look for tests in the
Lucene/Solr codebase that extend SolrJettyTestBase, and use those as a guide.

Thanks,
Shawn

Mime
View raw message