a blog for those who code

Tuesday 10 January 2017

[Solved] Unable to execute query in Solr

In this post we will be discussing about solving the error "org.apache.solr.handler.dataimport.DataImportHandlerException : Unable to execute query". When you try to do a full import in Solr you might get an error saying "Full Import failed: java.lang.RuntimeException: java.lang.RuntimeException:  org.apache.solr.handler.dataimport.DataImportHandlerException : Unable to execute query". There might be a lot of reasons why its failing.


The reasons might be it cannot able to connect to the database to run the query. But for us it was failing because our In-Use connections were equal to max-pool-size thus it does not have the connection pool to execute our query. As you can see below its giving us the warning first that it is "Failed to obtain /create connection from connection pool". The reason being com.sun.appserv.connectors.internal.api.PoolingException: In-use connections equal max-pool-size and expired max-wait-time. Cannot allocate more connections.


To solve this error you need to increase the max-pool-size (we have increased from 32 to 48) and increase the max-wait-time (we have increased from 60000 to 120000). After doing this when we ran the solr Full Import again, it ran successfully.

So any point of time if you are getting SEVERE exceptions try looking at the Warning message as well. Might be your exception can be linked to that warning.

Please Like and Share the CodingDefined Blog, if you find it interesting and helpful.

No comments:

Post a Comment