jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1451559 - in /jackrabbit/oak/trunk/oak-solr-embedded: pom.xml src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrServerProvider.java src/main/resources/solr/oak/conf/solrconfig.xml
Date Fri, 01 Mar 2013 10:35:56 GMT
Author: tommaso
Date: Fri Mar  1 10:35:55 2013
New Revision: 1451559

URL: http://svn.apache.org/r1451559
Log:
OAK-651 - fixed dependencies and classloading in embedded ss

Modified:
    jackrabbit/oak/trunk/oak-solr-embedded/pom.xml
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrServerProvider.java
    jackrabbit/oak/trunk/oak-solr-embedded/src/main/resources/solr/oak/conf/solrconfig.xml

Modified: jackrabbit/oak/trunk/oak-solr-embedded/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-embedded/pom.xml?rev=1451559&r1=1451558&r2=1451559&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-embedded/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-solr-embedded/pom.xml Fri Mar  1 10:35:55 2013
@@ -36,6 +36,10 @@
   </description>
   <packaging>bundle</packaging>
 
+  <properties>
+    <jetty.version>8.1.2.v20120308</jetty.version>
+  </properties>
+
   <build>
     <plugins>
       <plugin>
@@ -46,22 +50,33 @@
             <Export-Package>
               org.apache.jackrabbit.oak.plugins.index.solr.embedded
             </Export-Package>
+            <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
             <Import-Package>
-              !com.carrotsearch.*,
-              !com.sun.*,
+              !com.ibm.icu.*,
               !com.vividsolutions.*,
-              !javax.jms.*,
-              !javax.portlet.*,
               !org.apache.lucene.sandbox.queries,
-              !org.mortbay.*,
-              !sun.misc.*,
-              !org.relaxng.*,
+              !org.ietf.*,
               !org.eclipse.jetty.jmx.*,
+              !org.apache.zookeeper.server.quorum.flexible.*,
+              !org.mortbay.jetty.*,
+              !org.mortbay.util.*,
+              !org.mortbay.log,
+              !com.sun.msv.*,
+              !org.relaxng.datatype,
+              !org.apache.tika.*,
+              !javax.servlet.jsp.*,
+              !org.apache.commons.digester.*,
+              !org.apache.commons.validator.*,
+              !org.apache.log.*,
+              !org.apache.struts.*,
+              !org.apache.tools.ant.*,
+              !org.dom4j.*,
+              !org.jdom.*,
+              !com.werken.*,
+              !org.apache.oro.*,
               *
             </Import-Package>
-            <Embed-Dependency>*;scope=compile|runtime;inline=true
-            </Embed-Dependency>
-            <Embed-Transitive>true</Embed-Transitive>
+            <DynamicImport-Package>*</DynamicImport-Package>
           </instructions>
         </configuration>
       </plugin>
@@ -123,15 +138,26 @@
       <artifactId>solr-solrj</artifactId>
       <version>${solr.version}</version>
     </dependency>
+
     <dependency>
       <groupId>org.apache.solr</groupId>
       <artifactId>solr-core</artifactId>
       <version>${solr.version}</version>
+      <exclusions>
+        <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+        </exclusion>
+        <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-jdk14</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.jetty</groupId>
-      <artifactId>jetty-servlet</artifactId>
-      <version>8.1.2.v20120308</version>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-core</artifactId>
+      <version>${solr.version}</version>
     </dependency>
 
     <dependency>
@@ -139,6 +165,158 @@
       <artifactId>org.apache.felix.scr.annotations</artifactId>
       <scope>provided</scope>
     </dependency>
+
+    <!-- OSGi deployment related dependencies -->
+    <!-- internal Jetty -->
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-servlet</artifactId>
+      <version>${jetty.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-io</artifactId>
+      <version>${jetty.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-security</artifactId>
+      <version>${jetty.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-http</artifactId>
+      <version>${jetty.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-util</artifactId>
+      <version>${jetty.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-continuation</artifactId>
+      <version>${jetty.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-server</artifactId>
+      <version>${jetty.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+
+    <!-- Solr -->
+    <dependency>
+      <groupId>org.apache.solr</groupId>
+      <artifactId>solr-analysis-extras</artifactId>
+      <version>${solr.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+
+    <!-- Lucene -->
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-analyzers-common</artifactId>
+      <version>${solr.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-codecs</artifactId>
+      <version>${solr.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-queries</artifactId>
+      <version>${solr.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-queryparser</artifactId>
+      <version>${solr.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-spatial</artifactId>
+      <version>${solr.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-grouping</artifactId>
+      <version>${solr.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-join</artifactId>
+      <version>${solr.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-suggest</artifactId>
+      <version>${solr.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-highlighter</artifactId>
+      <version>${solr.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-memory</artifactId>
+      <version>${solr.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+
+    <!-- Spatial -->
+    <dependency>
+      <groupId>com.spatial4j</groupId>
+      <artifactId>spatial4j</artifactId>
+      <version>0.3</version>
+      <scope>runtime</scope>
+    </dependency>
+
+    <!-- servlet API -->
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>javax.servlet-api</artifactId>
+      <version>3.0.1</version>
+      <scope>runtime</scope>
+    </dependency>
+
+    <!-- Commons -->
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.6</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>commons-cli</groupId>
+      <artifactId>commons-cli</artifactId>
+      <version>1.2</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+      <version>1.7</version>
+      <scope>runtime</scope>
+    </dependency>
+
   </dependencies>
 
 </project>

Modified: jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrServerProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrServerProvider.java?rev=1451559&r1=1451558&r2=1451559&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrServerProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-embedded/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/embedded/EmbeddedSolrServerProvider.java
Fri Mar  1 10:35:55 2013
@@ -27,6 +27,7 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Service;
 import org.apache.jackrabbit.oak.plugins.index.solr.OakSolrUtils;
 import org.apache.jackrabbit.oak.plugins.index.solr.SolrServerProvider;
+import org.apache.lucene.codecs.lucene40.Lucene40Codec;
 import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
@@ -60,7 +61,7 @@ public class EmbeddedSolrServerProvider 
     @Property(value = DEFAULT_PORT)
     private static final String SOLR_HTTP_PORT = "solr.http.port";
 
-    private SolrServer solrServer;
+    private static SolrServer solrServer;
 
     private String solrHome;
     private Integer solrHttpPort;
@@ -119,6 +120,13 @@ public class EmbeddedSolrServerProvider 
 
     private SolrServer initializeWithNewHttpServer() throws Exception {
         // try spawning a new Solr server using Jetty and connect to it via HTTP
+
+        // hack needed to let lucene SPIs work in an OSGi deploy
+        Thread thread = Thread.currentThread();
+        ClassLoader loader = thread.getContextClassLoader();
+        thread.setContextClassLoader(Lucene40Codec.class.getClassLoader());
+        thread.setContextClassLoader(loader);
+
         enableSolrCloud(solrHome, DEFAULT_CORE_NAME);
         JettySolrRunner jettySolrRunner = new JettySolrRunner(solrHome, CONTEXT, solrHttpPort,
"solrconfig.xml", "schema.xml", true);
         jettySolrRunner.start(true);

Modified: jackrabbit/oak/trunk/oak-solr-embedded/src/main/resources/solr/oak/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-embedded/src/main/resources/solr/oak/conf/solrconfig.xml?rev=1451559&r1=1451558&r2=1451559&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-embedded/src/main/resources/solr/oak/conf/solrconfig.xml
(original)
+++ jackrabbit/oak/trunk/oak-solr-embedded/src/main/resources/solr/oak/conf/solrconfig.xml
Fri Mar  1 10:35:55 2013
@@ -458,8 +458,8 @@ Lucene will flush based on whichever lim
                  and old cache.
         -->
         <filterCache class="solr.FastLRUCache"
-                     size="512"
-                     initialSize="512"
+                     size="0"
+                     initialSize="0"
                      autowarmCount="0"/>
 
         <!-- Query Result Cache
@@ -468,8 +468,8 @@ Lucene will flush based on whichever lim
            (DocList) based on a query, a sort, and the range of documents requested.
         -->
         <queryResultCache class="solr.LRUCache"
-                          size="512"
-                          initialSize="512"
+                          size="0"
+                          initialSize="0"
                           autowarmCount="0"/>
 
         <!-- Document Cache
@@ -479,8 +479,8 @@ Lucene will flush based on whichever lim
            this cache will not be autowarmed.
         -->
         <documentCache class="solr.LRUCache"
-                       size="512"
-                       initialSize="512"
+                       size="0"
+                       initialSize="0"
                        autowarmCount="0"/>
 
         <!-- Field Value Cache



Mime
View raw message