Hello,
I'm trying to run a CPE of an AAE that consists of an Annotator Project (embedded as jar) and an installed Annotator-Pear. All dependencies are defined in maven. Both Annotators use the same version of the slf4j-logger-api thus the slf4j-api-1.6.4.jar is provided in both lib-folders. When I try to run this CPE with the runCPE.sh-Script the attached exception appears. It seems like the Class-Loader has problems with the two identic slf4j's.

This could be avoided by deleting the slf4j in the pears lib-folder I think. But that wouldn't be an ideal solution.

Is there any other way - without deleting anything - to solve this? Maybe manipulate the class loader?!

Thanks in advance for any help! :)

Regards,
Matthias

----------------------------------------------------------------------

Parsing CPE Descriptor
Instantiating CPE
#logback.classic pattern: %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 16:12:01.365 [main] INFO d.j.jules.ae.SentenceAnnotator - [JSBD] initializing... 16:12:01.375 [main] INFO d.j.jules.ae.SentenceAnnotator - initialize() - processing scope set to: document text
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.uima.bootstrap.UimaBootstrap.main(UimaBootstrap.java:98)
Caused by: org.apache.uima.resource.ResourceInitializationException: Initialization of CAS Processor with name "TestAAE3" failed. at org.apache.uima.collection.impl.CollectionProcessingEngine_impl.initialize(CollectionProcessingEngine_impl.java:83) at org.apache.uima.impl.UIMAFramework_impl._produceCollectionProcessingEngine(UIMAFramework_impl.java:420) at org.apache.uima.UIMAFramework.produceCollectionProcessingEngine(UIMAFramework.java:864) at org.apache.uima.examples.cpe.SimpleRunCPE.<init>(SimpleRunCPE.java:78) at org.apache.uima.examples.cpe.SimpleRunCPE.main(SimpleRunCPE.java:114)
    ... 5 more
Caused by: org.apache.uima.resource.ResourceConfigurationException: Initialization of CAS Processor with name "TestAAE3" failed. at org.apache.uima.collection.impl.cpm.container.CPEFactory.produceIntegratedCasProcessor(CPEFactory.java:1104) at org.apache.uima.collection.impl.cpm.container.CPEFactory.getCasProcessors(CPEFactory.java:550) at org.apache.uima.collection.impl.cpm.BaseCPMImpl.init(BaseCPMImpl.java:253) at org.apache.uima.collection.impl.cpm.BaseCPMImpl.<init>(BaseCPMImpl.java:127) at org.apache.uima.collection.impl.CollectionProcessingEngine_impl.initialize(CollectionProcessingEngine_impl.java:75)
    ... 9 more
Caused by: org.apache.uima.resource.ResourceInitializationException: Error initializing "org.apache.uima.analysis_engine.impl.PearAnalysisEngineWrapper" from descriptor file:/home/matthias/workspace_jl/0other/project-packer/svn_projects/jules-token-ae/target/pear-test-installation/jules-token-ae/jules-token-ae_pear.xml. at org.apache.uima.util.SimpleResourceFactory.produceResource(SimpleResourceFactory.java:144) at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:269) at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:387) at org.apache.uima.analysis_engine.asb.impl.ASB_impl.setup(ASB_impl.java:254) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initASB(AggregateAnalysisEngine_impl.java:431) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializeAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:375) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:185) at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94) at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:269) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:314) at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:425) at org.apache.uima.collection.impl.cpm.container.CPEFactory.produceIntegratedCasProcessor(CPEFactory.java:1088)
    ... 13 more
Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/uima/internal/util/UIMAClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for resolved class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type LoggerFactory; used in the signature
    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:284)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
    at de.julielab.jules.ae.TokenAnnotator.<clinit>(TokenAnnotator.java:48)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at java.lang.Class.newInstance0(Class.java:372)
    at java.lang.Class.newInstance(Class.java:325)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:227) at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:156) at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94) at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:269) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:314) at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:425) at org.apache.uima.analysis_engine.impl.PearAnalysisEngineWrapper.initialize(PearAnalysisEngineWrapper.java:269) at org.apache.uima.util.SimpleResourceFactory.produceResource(SimpleResourceFactory.java:123)
    ... 26 more

Reply via email to