How to configure custom solr instance to use Morfologik? - solr

I have a custom solr instance running in tomcat. I followed tomcat deployment tutorial in SolrWiki. I want to index my data which are in Polish language and I want to use Morfologik. So i followed http://solr.pl/en/2012/04/02/solr-4-0-and-polish-language-analysis/. I've created lib folder in SOLR_HOME, added all libraries to this folder, changed schema to use solr.MorfologikFilterFactory but i still get such error:
'collection1: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Plugin init failure for [schema.xml] fieldType „text_pl”: Plugin init failure for [schema.xml] analyzer/filter: Error loading class "solr.MorfologikFilterFactory"'
I assume there is a problem with paths. I hope so, because if not it might by quite hard to solve...
Anybody can help me? Thanks!

you can add lib path to the solrconfig.xml - see the xml supplied with example.
are you using the SolrCloud mode or standalone?

Related

JavaMail not working in OSGI(ServiceMix/Karaf)

I created a Karaf Instance on a Service Mix(7.0.1) and deployed my bundles into it.
The camel route is starting up properly, but always fails when it should send an email.
With the following exception:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed;
I tried several solutions i found from different sources around the web, but cannot actually fix it.
I tried commenting javax.activation out in the jre.properties file of the instance, as well as using a bundle that contains java mail and the osgi friendly version of the activation bundle in the same feature.
Could openJDK be an issue here?
Note: Everything works perfectly fine on a windows/oraclejdk environment, the exception only occurs in a linux/openjdk environment.
My issue stemed from a class loader problem after all and i fixed it by bundling javax.mail/mail/1.4.7 and org.apache.servicemix.specs.activation-api-1.1/2.8.0 in the same bundle.
I also needed to remove every occurence of javax.activation from the jre.properties and config.properties file of the child instance.
I am not sure why it ran per default on a different environment, as in theory the same classloader problems should have occured too, but that might be connected to different JREs being in use.

Vespa Tutorial – HTTP API use-case fails to activate with IllegalArgumentException

I'm currently following the Vespa tutorials, and ran into an issue with the HTTP API use-case. Everything works fine from the mvn install package to the vespa-deploy prepare target/application.zip.
The call to vespa-deploy activate returns normally, but the application then never gets available on localhost:8080. Looking at /opt/vespa/logs/vespa/vespa.log (in the VM) one finds the following stack trace:
Container.com.yahoo.jdisc.core.StandaloneMain error Unexpected:
exception=
java.lang.IllegalArgumentException: Could not create a component with id 'com.mydomain.demo.DemoComponent'.
Tried to load class directly, since no bundle was found for spec: sample-app-http-api-searcher.
If a bundle with the same name is installed, there is a either a version mismatch or the installed bundle's version contains a qualifier string.
at com.yahoo.osgi.OsgiImpl.resolveFromClassPath(OsgiImpl.java:48)
...
This occurred using a fresh Docker image with a clean clone of the sample-apps git repository. Preparing and activating the basic sample as well as the other http example did work seamlessly.
I checked the sources and the xml files for obvious problems but don't have any clue about what is failing and where.
target/application.zip contains
application/components/http-api-using-searcher-1.0.1-deploy.jar
application/hosts.xml
application/searchdefinitions/basic.sd
application/services.xml
And the jar itself does contain a com/mydomain/demo/DemoComponent.class file (among other things).
Potentially related issue on the github tracker: https://github.com/vespa-engine/vespa/issues/3479 I'll be posting a link to this question there as well, but I still think it's worth a SO question, at least to get some action behind the vespa tag :)
The bundle id in the application's services.xml file was wrong. Please pull the application from git and try again now. See also PR: https://github.com/vespa-engine/sample-apps/pull/18
Brief explanation: The bundle id given in the bundle="<id>" declaration in services.xml must match the 'Bundle-SymbolicName' in the bundle's manifest. When the bundle has been built with the Vespa bundle-plugin, the symbolic name is by default the same as the project's artifactId. Hence, in most cases you just have to verify that the bundle id matches the artifactId.

solr wikipedia error in adding the WikipediaTokenizerFactory

I am trying to use the WikipediaTokenizerFactory http://lucene.apache.org/solr/3_6_0/org/apache/solr/analysis/WikipediaTokenizerFactory.html
But when I start solr I get
{msg=SolrCore 'collection1' is not available due to init failure: Plugin init failure for [schema.xml] fieldType "text": Plugin init failure for [schema.xml] analyzer/filter: Error loading class 'solr.WikipediaTokenizerFactory'.
Is this Tokenizer removed in solr 4.5.1, or what am I missing here?
WikipediaTokenizerFactory is now part of Lucene repository. You can try using the respective package name.
Note: I haven't used this tokenizer myself, so can't guarantee it would work.

Extracting .docx files with Tika in Apache Solr gives NoSuchMethod error

I have a Solr 4.0 module in my project (basically, a maven web project with all the solr dependencies). It worked pretty well, including content extraction and everything.
But, when I tested it with a .docx document, It gives me the following error:
13:50:34,468 ERROR [org.apache.solr.servlet.SolrDispatchFilter] (http--0.0.0.0-8080-9)
null:java.lang.RuntimeException: java.lang.NoSuchMethodError:
org.apache.poi.openxml4j.opc.PackagePart.getRelatedPart(Lorg/apache/poi/openxml4j/opc/PackageRelationship;)
Lorg/apache/poi/openxml4j/opc/PackagePart;
I tried to manually add the openxml4j dependency to the project. I've downloaded the sources and looked at it, the PackagePart#getRelatedPart really doesn't exist.
What is this error? How can I fix this?
Thanks in advance.
EDIT
I noticed that poi-ooxml already had those classes inside it. Cool, but I also inspected those sources, and still doesn't have the needed method in the PackagePart class.
BTW: I tried to add openxml4j version 1.0-beta.
It was a jarhell related issue.
Thanks, "jarhell related" was the clue I needed!
My project had POI jars prior to import of the Tika app jar, which includes its own POI jars. I deleted the standalone POI jars, and then Tika was able to handle DOCX Word 2013 file without error.
Now hopefully I won't run into a situation where I need both! :|

jTwitter, oAuth, and Google App Engine. NoClassDefFoundError

I'm trying to use jTwitter to get an oauth instance to twitter with my consumer key/secret and access token/secret. This is well documented in the javadoc here. I have downloaded signpost, signpost-jetty, and the jtwitter library, but after deploying and running the servlet, I get a error java.lang.NoClassDefFoundError: winterwell/jtwitter/OAuthSignpostClient Eclipse isn't complaining about the class not being there, because it is there-- I can see it in the JAR file itself, which is in my project. So, I said forget it, I'll try out OAuthScribeClient instead, but this generated a VERY SIMILAR ERROR java.lang.NoClassDefFoundError: org/scribe/oauth/Token This one confuses me even further because I have the following code in my java file, and it compiles without error or warning:
import org.scribe.oauth.Token;
Token token = new Token("myaccesstokeninfo", "accesstokensecret");
Clearly, I'm missing something very fundamental, but I am at an absolute loss as to what it may be. Thanks.
Usually "NoClassDefFoundError" happens when you forget to copy all jar-files to your "/war/WEB-INF/lib" directory, so those libs will be unavailable from server-side.
Xo4yHaMope is probably right.
If you're working from Eclipse but running using a web container, then your runtime classpath might be different from your project classpath - which can cause this error.
In order to complete Ben Winters answer what I actually did and worked is add the jar in
the libs folder within the project
see also here about folder hierarchy.
When you do this eclipse will normally add the jar to the android dependencies before launching the application. What I realise is that adding a jar in the build path will make classes available only during the build

Resources