Hi,
We are getting ArrayIndexOutOfBoundsException from the Solr core library on
calling CoreContainer.createAndLoad API while executing a Junit test case
through gradle. We can see from the logs that solr.xml is getting initialized.
Here is the code that we have in the Junit which is causing this issue:
CoreContainer container =
CoreContainer.createAndLoad(Paths.get(SOLR_HOME.getAbsolutePath()),
Paths.get(solrConfig.getURI()));
EmbeddedSolrServer solrServer = new EmbeddedSolrServer(container, CORE_NAME);
Here is the exception stacktrack we get when the test case is executed:
java.lang.ArrayIndexOutOfBoundsException: 1
at org.apache.solr.api.ApiSupport.registerV2(ApiSupport.java:42)
at org.apache.solr.core.PluginBag.put(PluginBag.java:215)
at org.apache.solr.core.PluginBag.put(PluginBag.java:194)
at
org.apache.solr.core.CoreContainer.<init>(CoreContainer.java:314)
at
org.apache.solr.core.CoreContainer.<init>(CoreContainer.java:308)
at
org.apache.solr.core.CoreContainer.<init>(CoreContainer.java:300)
at
org.apache.solr.core.CoreContainer.<init>(CoreContainer.java:296)
at
org.apache.solr.core.CoreContainer.createAndLoad(CoreContainer.java:480)
at
org.company.alpha.solr.TestSolrCoreContainer.test(TestSolrCoreContainer.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
After going through the source code of ApiSupport.registerV2, there is no array
used anywhere. After doing some google, I found out that it could be due any
old version of ASM jar in classpath. I tried replacing the ASM jar with 5.1
version but that didn’t work. Please let me know if anybody has any idea on
this issue?
Thanks, Irfan
IMPORTANT NOTICE: This e-mail message is intended to be received only by
persons entitled to receive the confidential information it may contain. E-mail
messages to clients of Ventiv Technology Inc., may contain information that is
confidential and legally privileged. Please do not read, copy, forward, or
store this message unless you are an intended recipient of it. If you have
received this message in error, please forward it to the sender and delete it
completely from your computer system.