-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime exceptions #36
Comments
I think there might be several things going on here. Firstly, you're right in saying that some of the Apache HTTP Components classes seem to be missing from Baleen 2.2.0 - I'm not sure why that is (it's a sub-dependency of one of Baleen's dependencies rather than something we use directly, so it might be something to do with the version we're using there). However, in the latest snapshots of Baleen 2.3.0 it does seem to be included so perhaps consider using that instead? However, looking at the test code you've provided I'm not sure you're using Baleen in the correct way. Instantiating a single annotator on it's own almost certainly won't work as it will be missing a lot of the additional functionality provided by Baleen and required by a Baleen annotator. What is it you're trying to achieve? If you're trying to run Baleen inside your application, have you looked at this Wiki page: https://github.com/dstl/baleen/wiki/Run-as-a-Standalone-Application |
Thanks for the quick reply. I'm not sure from where I can get 2.3.0. Under releases, only 2.2.0 appears as the latest release. I should try that version definitely. As I came across these issues in my application, I just copied part of it to a sample application to make it simpler. To give you an overview of what I'm trying to do, I just copied few more lines of my program to this test application. Basically, I'm reading some external files (for the moment only a csv file) and read its data (employee data) and store them in ElasticSearch cluster through Baleen, so that later, when a search is performed, easily data can be retrieved. Logic is something similar to this. (This code may not compile, as I have just copied some lines from the main application) public static void main(String[] args) {
} //Then from somewhere else I can perform searches like this Here Employee class is similar to Person class in Baleen which is inherited from Entity. Employee_Type also there similar to Person_Type. |
To get Baleen 2.3.0-SNAPSHOT, you will need to compile it yourself (i.e. clone the repo and run In terms of what you're trying to acheive, it sounds like what you really want to do is develop additional components for Baleen and then use Baleen as normal with a pipeline including your components. Any components that are on the Classpath are automatically picked up and available for use. You can also add in additional types (Employee in your case) using a similar method (i.e. making them available on the Classpath). Have you read the Development Guides included in Baleen? Based on the code above, you probably want to develop your own ContentExtractor to handle your CSV files (or possibly your own CollectionReader) to read in the data and annotate it as appropriate. Your pipeline would then look something like:
Have a look also at the following pages for some examples: https://github.com/dstl/baleen/wiki/Additional-Components |
1.Thanks. I'll go through the docs again. 2.Some build errors cause not to compile.
{{ T E S T SResults : Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO] |
Have you tried building from the command line rather than through Eclipse? The Eclipse and Maven integration can be somewhat buggy, so it's possible that's the issue. The other thing to try might be building it on a path without spaces. I will try doing a clean compile of the code here later, but have built it before without issues. What JDK are you using to build Baleen? With regards to NetBeans, the files on GitHub don't include the Eclipse specific project files, so you should be able to import the Maven projects into NetBeans. |
I've just build the latest code from the command line and it worked fine, suggesting it's something with your setup (or possibly an Eclipse bug). |
In your logs the compile error about a method that is not being overridden is a default method, which were introduced with Java 8 - are you building with JDK7? |
Thanks a lot, I was able to compile and build Baleen 2.3.0 without errors after fixing couple of issues in my side. Then I imported Maven project to Netbeans, after removing the whitespaces in the project path, I was able to build Baleen. Cause for the some jar file missing errors was I had been using Baleen-core, but after importing to Netbeans I realized complete set of jar dependencies are available in the root of Baleen, so referencing to root Baleen solved those errors also. One last question Could you please send me the pipeline configuration file for this (https://github.com/jamesdbaker/Baleen-Components)? That would be handy to have a look at real example. I was referring this (https://github.com/dstl/baleen/wiki/Sample-Pipeline) pipeline and am not too sure certain information there. For example
What is the convention of these definitions?
Thanks in advance for your answers. |
Please read the 'Running Baleen with Additional Annotators' guide included within Baleen and the Javadoc for Also, consider using the Plankton tool to play around with building pipelines as this will produce the correct YAML for you. The one from that additional components project would look something like:
To include new entity types, I believe they just need to be on the classpath and defined in such a way that UimaFIT will detect them. Please refer to the UimaFIT documentation for how to do this. |
Thank you for the references, they are very helpful. |
Hello there,
I'm new to Baleen, I read most of the documentation. Baleen is running in the background. But when I run my test application, I get some runtime exceptions. I ran my test application with -verbose on so I could see all the messages. I have copied my code at the bottom.
Error1:
This comes when I link my test application only with Baleen library. I get an exception "java.lang.NoClassDefFoundError: org/apache/http/config/Lookup".
Error2:
Then I linked httpCore4.4.x jar (which I hope I'm not supposed to do), ran, then I don't get above error. But I get another new exception java.lang.NoSuchMethodError: org.apache.http.entity.ContentType.withCharset(Ljava/lang/String;)Lorg/apache/http/entity/ContentType;
I assume that I must not link apache libraries since Baleen already has references to them and the libraries I link may cause to make conflicts between libraries. I'm on Windows 10, 64x and IDE is Netbeans. I'm using Baleen 2.2.0. Could someone help me to figure out what I'm missing here please?
Following is my test program.
package testbaleen;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.uima.analysis_engine.AnalysisEngine;
import org.apache.uima.analysis_engine.AnalysisEngineDescription;
import org.apache.uima.fit.factory.AnalysisEngineFactory;
import org.apache.uima.fit.factory.ExternalResourceFactory;
import org.apache.uima.jcas.JCas;
import org.apache.uima.resource.ExternalResourceDescription;
import org.apache.uima.resource.ResourceInitializationException;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.node.Node;
import org.elasticsearch.node.NodeBuilder;
import uk.gov.dstl.baleen.consumers.ElasticsearchRest;
import uk.gov.dstl.baleen.resources.SharedElasticsearchRestResource;
/**
*
@author Susantha
*/
public class TestBaleen {
private static Path tmpDir;
private static final String ELASTICSEARCH = "elasticsearchRest";
protected static Client client;
protected static JCas jCas;
protected static AnalysisEngine ae;
/**
@param args the command line arguments
*/
public static void main(String[] args) {
}
}
}
The text was updated successfully, but these errors were encountered: