Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Getting error java.lang.ClassNotFoundException: com.drew.lang.RandomAccessReader not found by com.adobe.granite.poi [74]

Avatar

Level 1

Hello Team,

 

We are using AEM 6.4. We have custom code implemented to listen to Publish event when dam asset is published. Handler parses the contents of the asset

and indexes to apache solr outside AEM. We are using tika parser (AutoDetectParser) which parses the document based on Asset's MIME Type.

 

I am seeing below error when parsing a word document. Does anyone has solution to this problem?

 

14.06.2021 22:35:47.179 *ERROR* [NoRequestId] [sling-threadpool-f9839b70-bb24-4592-8cc2-43df74b20245-(apache-sling-job-thread-pool)-29-<main queue>(solr/indexing/handler)] org.apache.sling.event.impl.jobs.queues.JobQueueImpl.<main queue> Unhandled error occured in job processor com/drew/lang/RandomAccessReader while processing job Sling Job [topic=solr/indexing/handler, id=2021/6/14/22/35/da06c7b7-41b6-4f2d-bdd5-5085e9322fb2_170, properties=slingevent:application=da06c7b7-41b6-4f2d-bdd5-5085e9322fb2,jcr:created=java.util.GregorianCalendar(Mon Jun 14 22:35:46 PDT 2021),slingevent:created=java.util.GregorianCalendar(Mon Jun 14 22:35:46 PDT 2021),event.job.queuename=<main queue>,event.job.queued.time=java.util.GregorianCalendar(Mon Jun 14 22:35:46 PDT 2021),jcr:createdBy=sling-event,sling:resourceType=slingevent:Job,type=ACTIVATE,event.job.application=da06c7b7-41b6-4f2d-bdd5-5085e9322fb2,event.job.retries=10,event.job.started.time=java.util.GregorianCalendar(Mon Jun 14 22:35:47 PDT 2021),paths=[Ljava.lang.String;@6a9361c3,jcr:primaryType=slingevent:Job,event.job.retrycount=0] java.lang.NoClassDefFoundError: com/drew/lang/RandomAccessReader
at org.apache.tika.parser.jpeg.JpegParser.parse(JpegParser.java:58)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:143)
at org.apache.tika.parser.DelegatingParser.parse(DelegatingParser.java:72)
at org.apache.tika.extractor.ParsingEmbeddedDocumentExtractor.parseEmbedded(ParsingEmbeddedDocumentExtractor.java:102)
at org.apache.tika.parser.microsoft.ooxml.AbstractOOXMLExtractor.handleEmbeddedFile(AbstractOOXMLExtractor.java:380)
at org.apache.tika.parser.microsoft.ooxml.AbstractOOXMLExtractor.handleEmbeddedPart(AbstractOOXMLExtractor.java:263)
at org.apache.tika.parser.microsoft.ooxml.AbstractOOXMLExtractor.handleEmbeddedParts(AbstractOOXMLExtractor.java:205)
at org.apache.tika.parser.microsoft.ooxml.AbstractOOXMLExtractor.getXHTML(AbstractOOXMLExtractor.java:138)
at org.apache.tika.parser.microsoft.ooxml.OOXMLExtractorFactory.parse(OOXMLExtractorFactory.java:143)
at org.apache.tika.parser.microsoft.ooxml.OOXMLParser.parse(OOXMLParser.java:106)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:143)
at org.demo.cl.solr.search.core.document.builder.AbstractDocumentBuilder.parseStringValue(AbstractDocumentBuilder.java:105)
at org.demo.cl.solr.search.core.document.builder.DamAssetDocumentBuilder.buildInternal(DamAssetDocumentBuilder.java:47)
at org.demo.cl.solr.search.core.document.builder.AbstractDocumentBuilder.build(AbstractDocumentBuilder.java:76)
at org.demo.cl.solr.search.core.document.osgi.SolrDocumentIndexingServiceImpl.addIfIndexable(SolrDocumentIndexingServiceImpl.java:65)
at org.demo.cl.solr.search.core.document.osgi.SolrDocumentIndexingServiceImpl.addUpdateDocument(SolrDocumentIndexingServiceImpl.java:52)
at org.demo.cl.solr.search.core.handler.SolrIndexingJobExecutor.activateDocument(SolrIndexingJobExecutor.java:126)
at org.demo.cl.solr.search.core.handler.SolrIndexingJobExecutor.processDocument(SolrIndexingJobExecutor.java:80)
at org.demo.cl.solr.search.core.handler.SolrIndexingJobExecutor.process(SolrIndexingJobExecutor.java:66)
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.startJob(JobQueueImpl.java:293)
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.access$100(JobQueueImpl.java:60)
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl$1.run(JobQueueImpl.java:229)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.drew.lang.RandomAccessReader not found by com.adobe.granite.poi [74]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639)
at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1414)
at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1660)
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1590)
at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 31 common frames omitted

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

It looks like the dependency for RandomAccessReader is resolved compile time but its not available at the runtime. You might have to make necessary changes in pom.xml to export it to felix console. Check /system/console/depfinder

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

It looks like the dependency for RandomAccessReader is resolved compile time but its not available at the runtime. You might have to make necessary changes in pom.xml to export it to felix console. Check /system/console/depfinder