Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.
1. Jena는 기본적으로 multi thread환경을 지원하지 않는다.
(private Model model = ModelFactory.createDefaultModel();에서 오류발생함)
그래서 multi thread로 작동시키면 아래와 같은 오류가 발생한다. ==> 그렇지 않은거 같음
2. war파일에 아래와 같은 내용이 있는데 초기에 실행되는 클래스를 나타냄.==> 이부분이 초기화가 제대로 되지 않아서 오류가 발생하는거 같음
META-INF/services/org.apache.jena.system.JenaSubsystemLifecycle
org.apache.jena.tdb.sys.InitTDB
-------------META-INF/services/org.apache.jena.system.JenaSubsystemLifecycle파일을 삭제한 경우의 오류내용-----
Exception in thread "pool-2-thread-3" java.lang.ExceptionInInitializerError
at org.apache.jena.riot.RDFDataMgr.write$(RDFDataMgr.java:1217)
at org.apache.jena.riot.RDFDataMgr.write(RDFDataMgr.java:1035)
at org.apache.jena.riot.RDFDataMgr.write(RDFDataMgr.java:974)
at com.gooper.icbms.sda.kb.mapper.onem2m.OneM2MContentInstanceMapper.getTriple(OneM2MContentInstanceMapper.java:69)
at com.gooper.icbms.sda.kafka.onem2m.AvroOneM2MSubscribe.getTripleString(AvroOneM2MSubscribe.java:174)
at com.gooper.icbms.sda.kafka.onem2m.AvroOneM2MSubscribe$1.run(AvroOneM2MSubscribe.java:110)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.apache.jena.query.ARQ.isTrue(ARQ.java:605)
at org.apache.jena.riot.system.RiotLib.<clinit>(RiotLib.java:61)
... 9 more
------------오류내용 ----------
Exception in thread "pool-2-thread-2" java.lang.ExceptionInInitializerError
at com.gooper.icbms.sda.kb.mapper.onem2m.OneM2MContentInstanceMapper.<init>(OneM2MContentInstanceMapper.java:39)
at com.gooper.icbms.sda.sf.TripleService.getTriple(TripleService.java:57)
at com.gooper.icbms.sda.kafka.onem2m.AvroOneM2MSubscribe$1.run(AvroOneM2MSubscribe.java:123)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.apache.jena.tdb.sys.EnvTDB.processGlobalSystemProperties(EnvTDB.java:33)
at org.apache.jena.tdb.TDB.init(TDB.java:248)
at org.apache.jena.tdb.sys.InitTDB.start(InitTDB.java:29)
at org.apache.jena.system.JenaSystem.lambda$init$1(JenaSystem.java:111)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at org.apache.jena.system.JenaSystem.forEach(JenaSystem.java:186)
at org.apache.jena.system.JenaSystem.forEach(JenaSystem.java:163)
at org.apache.jena.system.JenaSystem.init(JenaSystem.java:109)
at org.apache.jena.rdf.model.ModelFactory.<clinit>(ModelFactory.java:49)
... 6 more