Author: rwesten
Date: Sat Oct 13 10:53:05 2012
New Revision: 1397810

URL: http://svn.apache.org/viewvc?rev=1397810&view=rev
Log:
fix for STANBOL-775

Modified:
    
stanbol/trunk/commons/solr/web/src/main/java/org/apache/stanbol/commons/solr/web/impl/SolrServerPublishingComponent.java

Modified: 
stanbol/trunk/commons/solr/web/src/main/java/org/apache/stanbol/commons/solr/web/impl/SolrServerPublishingComponent.java
URL: 
http://svn.apache.org/viewvc/stanbol/trunk/commons/solr/web/src/main/java/org/apache/stanbol/commons/solr/web/impl/SolrServerPublishingComponent.java?rev=1397810&r1=1397809&r2=1397810&view=diff
==============================================================================
--- 
stanbol/trunk/commons/solr/web/src/main/java/org/apache/stanbol/commons/solr/web/impl/SolrServerPublishingComponent.java
 (original)
+++ 
stanbol/trunk/commons/solr/web/src/main/java/org/apache/stanbol/commons/solr/web/impl/SolrServerPublishingComponent.java
 Sat Oct 13 10:53:05 2012
@@ -40,6 +40,7 @@ import org.apache.solr.core.CoreContaine
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.servlet.SolrDispatchFilter;
 import org.apache.stanbol.commons.solr.SolrConstants;
+import org.apache.stanbol.commons.solr.SolrServerAdapter;
 import org.apache.stanbol.commons.solr.utils.ServiceReferenceRankingComparator;
 import 
org.apache.stanbol.commons.solr.web.dispatch.DelegatingSolrDispatchFilter;
 import org.osgi.framework.BundleContext;
@@ -300,7 +301,13 @@ public class SolrServerPublishingCompone
             if(server == null){
                 server  = (CoreContainer)tracker.getService(ref);
             }
-            filter = new SolrFilter(server);
+            ClassLoader classLoader = 
Thread.currentThread().getContextClassLoader();
+            
Thread.currentThread().setContextClassLoader(SolrServerPublishingComponent.class.getClassLoader());
+            try {
+                filter = new SolrFilter(server);
+            }finally {
+                Thread.currentThread().setContextClassLoader(classLoader);
+            }
             Dictionary<String,Object> filterPrpoerties = new 
Hashtable<String,Object>();
             filterPrpoerties.put("path-prefix", serverPrefix);
             String filterPrefix = serverPrefix+"/.*";


Reply via email to