hltfbk / Excitement-Transduction-Layer

1 stars 1 forks source link

exceptions #179

Closed fainalex closed 10 years ago

fainalex commented 10 years ago

Hi to all!

Today I've downloaded the freshest version of the TL, tried to run a short file and got an Exception.

INFO: TreeTagger executable location: C:\Users\Marie\AppData\Local\Temp\tree-tagger208785642952324567.exe Exception in thread "main" eu.excitementproject.tl.decomposition.exceptions.FragmentAnnotatorException: Calling on LAPAccess eu.excitementproject.tl.laputils.CachedLAPAccess didn't added Sentence annotation. Cannot proceed. at eu.excitementproject.tl.decomposition.fragmentannotator.SentenceAsFragmentAnnotator.annotateFragments(SentenceAsFragmentAnnotator.java:70) at eu.excitementproject.tl.demo.DemoUseCase2OMQGerman.buildGraph(DemoUseCase2OMQGerman.java:232) at eu.excitementproject.tl.demo.DemoUseCase2OMQGerman.main(DemoUseCase2OMQGerman.java:119)

then I tried to run another file and got another exception Exception in thread "main" java.lang.NoClassDefFoundError: gnu/trove/map/TObjectIntMap at eu.excitementproject.eop.globalgraphoptimizer.api.UntypedPredicateGraphLearner.learn(UntypedPredicateGraphLearner.java:43) at eu.excitementproject.tl.composition.graphoptimizer.GlobalGraphOptimizer.optimizeGraph(GlobalGraphOptimizer.java:116) at eu.excitementproject.tl.demo.DemoUseCase2OMQGerman.buildGraph(DemoUseCase2OMQGerman.java:242) at eu.excitementproject.tl.demo.DemoUseCase2OMQGerman.main(DemoUseCase2OMQGerman.java:119) Caused by: java.lang.ClassNotFoundException: gnu.trove.map.TObjectIntMap

Am I doing something wrong?

KathrinEichler commented 10 years ago

Hi Aleksandra. Can you tell me what you changed in the demo class and send me the file you ran it on, so I can reproduce the error? Thanks!

gilnoh commented 10 years ago

Hello, Alexandra,

I can answer only for the first exception that is generated from SentenceAsFragmentAnnotator. The LAP (sentence splitter + treeTagger) was not possible to find "sentence" in that specific file. Which means that, the tool that decides sentence boundary decided that it doesn't have any sentence. This can happen in a few cases where all the input has actually no sentences (e.g. only a few symbols like " ... -- ..."), or can be a bug.

Would you please let me know the content of the file? Also, we can prepare a workaround for this, such as if we find no sentence in the input; we treat whole input as fragment, etc.

KathrinEichler commented 10 years ago

I mean, Alexandra. :-) (My student assistant is called Aleksandra, so I got confused with the spelling sorry.)

KathrinEichler commented 10 years ago

Hi Alex, in the use case 2 demo, "keywordsProvided" is currently set to false (i.e., the input dataset should contain no keyword metadata) and "relevantTextProvided" is set to true (i.e., the input dataset should contain relevantText annotation). Please make sure this is true of your data file. Maybe this helps solve the problem (at least the first one).

fainalex commented 10 years ago

the second file doesn't contain keywords and contains relevant-text Tags

in the first file a deleted keywords tags and set relevantTextProvided as false. In this position I got Exception number 2 "Exception in thread "main" java.lang.NoClassDefFoundError: gnu/trove/map/TObjectIntMap"

KathrinEichler commented 10 years ago

So the first issue is solved then, right?

I ran the demo on both files you sent me, but I don't get the exception, so I'm not sure what goes wrong here. It seems to relate to the global graph optimizer.

Can anyone else help?

fainalex commented 10 years ago

yes, the first exception has become the second one :)

I have a notion about global graph optimizer: it didn't function as a snapshop dependency in my case, that's why I made a jar file and added it like the extended library. Can it influence? (the same scheme if integrating global optimized worked for 3-4 week ago without any exceptions.)

LiliKotlerman commented 10 years ago

The 2nd exception seems related to the trove version used at runtime. The class not found is not there in earlier versions (2.x I think). Sorry, I'm writing from my phone, cannot access git. Gil, do you know how to detect/solve version conflicts if any? On Jan 13, 2014 2:45 PM, "fainalex" notifications@github.com wrote:

yes, the first exception has become the second one :)

I have a notion about global graph optimizer: it didn't function as a snapshop dependency in my case, that's why I made a jar file and added it like the extended library. Can it influence? (the same scheme if integrating global optimized worked for 3-4 week ago without any exceptions.)

— Reply to this email directly or view it on GitHubhttps://github.com/hltfbk/Excitement-Transduction-Layer/issues/179#issuecomment-32166014 .

gilnoh commented 10 years ago

Hello, Alexandra and Lili,

IMHO, the issue is caused by using "manual JAR" addition to the project. --- Maven always makes sure only the "specified version" (Trobe, or any Jar) of Jar is to be avalilable at the classpath.

You should never add a Jar manually to a classpath, if you are relying on Maven --- this can destory dependency relations that is managed by Maven.

So I would recommend Alexandra to "not to add" anything to classpath manually.

Please try a normal build process. If you do this, you don't need to add any Jar in the class path.

(do all build from command line)

Everything should work okay (no build failure, no teste failure...) I tested this (last Friday), and everything is Okay with this. Please make sure this is the situation for you, Alexandra.

Then, I think, your problem will automatically go away ...

fainalex commented 10 years ago

Hi I'm trying to install everythig according to your instructions. Now everything functions well except this message: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. but I think it's not very important.

I have another additional question: is it possible somehow to create a jar-file for all the parts of TL and to add it to the bigger project just as a library?

gilnoh commented 10 years ago

I have no idea where or when slf4j logger operates... I do not understand what causes such exception or why.

About using TL as a library: It is very easy, if your Java project that uses TL as a library is a Maven project. Just make up a new Java Maven project, and add TL as dependency. It will resolve all Jar dependencies and everything in TL is visible. Check the following guide for easy-to-start Maven project. http://spring.io/guides/gs/maven/

If you want to build a project that is not a Maven project, than you have to use Maven Assembly Plugin. I would not recommend this. But this is doable. Check

http://stackoverflow.com/questions/3516859/exporting-eclipse-maven-project-as-a-non-maven-eclipse-project-with-dependencies http://maven.apache.org/plugins/maven-assembly-plugin/

I strongly recommend just use Maven to handle TL as a library (e.g. make your Application also a Maven project, since all IDEs well support Maven).

vnastase commented 10 years ago

We are using org.apache.log4j for logging. Is it possible that in one of your classes you imported this other logger? If yes, switch to the apache one.

gilnoh commented 10 years ago

Just one note: when you add "dependency" for the TL, this is the TL as the maven artifact.

Group Id: eu.excitementproject Artifact Id:tl Version: 0.0.1-SNAPSHOT

Note that TL is not available on artifactory yet -- this means you have to install it on your computer, by following the above mentioned build process. Once TL built, just run this "mvn package install". The command in TL directory, builds and installs the TL project to your computer.

We will release TL also on the project artifactory, when it becomes stable.

fainalex commented 10 years ago

Thank you all for your comments! I cannot find where slf4j is added, but the main problem of this issue is solved in any case