lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Woodward <alan.woodw...@romseysoftware.co.uk>
Subject Re: Can't run SolrExampleTests from IntelliJ
Date Sun, 19 Aug 2012 20:21:14 GMT
Worked it out.  The 'phonetic' module needs to have its resources/ directory added as a source
directory; at the moment IntelliJ doesn't copy the META-INF/services files to SOLR's classpath.

diff --git a/dev-tools/idea/lucene/analysis/phonetic/phonetic.iml b/dev-tools/idea/lucene/analysis/phonetic/phonetic.iml
index e986169..67c1670 100644
--- a/dev-tools/idea/lucene/analysis/phonetic/phonetic.iml
+++ b/dev-tools/idea/lucene/analysis/phonetic/phonetic.iml
@@ -6,6 +6,7 @@
     <exclude-output />
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/resources" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
     </content>
     <orderEntry type="inheritedJdk" />

On 19 Aug 2012, at 18:33, Alan Woodward wrote:

> Hi all,
> 
> When I try to run SolrExampleTests (or more specifically, SolrExampleStreamingTest) from
within IntelliJ against trunk, the example Solr instance doesn't start up properly, failing
to load solr.DoubleMetaphoneFilterFactory.  What's weird is that I *can* run the tests from
the command line using 'ant test', which presumably means that it's somehow a classpath issue
within IntelliJ.  I've tried digging into the weeds of the SolrResourceLoader but haven't
found anything useful so far.
> 
> Anybody have any ideas?
> 
> Thanks, 
> Alan Woodward
> 
> IntelliJ set up using 'ant idea'.
> 
> The following works:
> ant test -Dtests.class="*.SolrExampleStreamingTest"
> 
> But running from IntelliJ gives the following error:
> 147221 T15 oasc.SolrException.log SEVERE null:org.apache.solr.common.SolrException: Plugin
init failure for [schema.xml] fieldType "phonetic": Plugin init failure for [schema.xml] analyzer/filter:
Error loading class 'solr.DoubleMetaphoneFilterFactory'
> 		at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:168)
> 		at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:369)
> 		at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:113)
> 		at org.apache.solr.core.CoreContainer.create(CoreContainer.java:850)
> 		at org.apache.solr.core.CoreContainer.load(CoreContainer.java:539)
> 		at org.apache.solr.core.CoreContainer.load(CoreContainer.java:360)
> 		at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:309)
> 		at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:106)
> 		at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:114)
> 		at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
> 		at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:754)
> 		at org.eclipse.jetty.servlet.ServletHandler.updateMappings(ServletHandler.java:1227)
> 		at org.eclipse.jetty.servlet.ServletHandler.setFilterMappings(ServletHandler.java:1263)
> 		at org.eclipse.jetty.servlet.ServletHandler.addFilterWithMapping(ServletHandler.java:965)
> 		at org.eclipse.jetty.servlet.ServletHandler.addFilterWithMapping(ServletHandler.java:923)
> 		at org.eclipse.jetty.servlet.ServletContextHandler.addFilter(ServletContextHandler.java:333)
> 		at org.apache.solr.client.solrj.embedded.JettySolrRunner$1.lifeCycleStarted(JettySolrRunner.java:158)
> 		at org.eclipse.jetty.util.component.AbstractLifeCycle.setStarted(AbstractLifeCycle.java:169)
> 		at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:60)
> 		at org.apache.solr.client.solrj.embedded.JettySolrRunner.start(JettySolrRunner.java:210)
> 		at org.apache.solr.client.solrj.embedded.JettySolrRunner.start(JettySolrRunner.java:190)
> 		at org.apache.solr.SolrJettyTestBase.createJetty(SolrJettyTestBase.java:53)
> 		at org.apache.solr.client.solrj.embedded.SolrExampleStreamingTest.beforeTest(SolrExampleStreamingTest.java:46)
> 		at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 		at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 		at java.lang.reflect.Method.invoke(Method.java:597)
> 		at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1559)
> 		at com.carrotsearch.randomizedtesting.RandomizedRunner.access$600(RandomizedRunner.java:79)
> 		at com.carrotsearch.randomizedtesting.RandomizedRunner$4.evaluate(RandomizedRunner.java:677)
> 		at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:693)
> 		at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
> 		at com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule$1.evaluate(SystemPropertiesRestoreRule.java:53)
> 		at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
> 		at org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:42)
> 		at com.carrotsearch.randomizedtesting.rules.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:55)
> 		at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:39)
> 		at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:39)
> 		at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:40)
> 		at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48)
> 		at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:70)
> 		at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:55)
> 		at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
> 		at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:345)
> 		at java.lang.Thread.run(Thread.java:680)
> 	Caused by: org.apache.solr.common.SolrException: Plugin init failure for [schema.xml]
analyzer/filter: Error loading class 'solr.DoubleMetaphoneFilterFactory'
> 		at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:168)
> 		at org.apache.solr.schema.FieldTypePluginLoader.readAnalyzer(FieldTypePluginLoader.java:377)
> 		at org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:95)
> 		at org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:43)
> 		at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:142)
> 		... 44 more
> 	Caused by: org.apache.solr.common.SolrException: Error loading class 'solr.DoubleMetaphoneFilterFactory'
> 		at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:441)
> 		at org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:462)
> 		at org.apache.solr.util.plugin.AbstractPluginLoader.create(AbstractPluginLoader.java:86)
> 		at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:142)
> 		... 48 more
> 	Caused by: java.lang.ClassNotFoundException: solr.DoubleMetaphoneFilterFactory
> 		at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> 		at java.security.AccessController.doPrivileged(Native Method)
> 		at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> 		at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> 		at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:627)
> 		at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> 		at java.lang.Class.forName0(Native Method)
> 		at java.lang.Class.forName(Class.java:247)
> 		at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:425)
> 		... 51 more
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message