简体   繁体   English

Apache-tika 1.23 failed.eml 文件作为 email 的附件抛出 NoClassDefFoundError

[英]Apache-tika 1.23 fails .eml file as an attachment to email throws NoClassDefFoundError

java.lang.NoClassDefFoundError: org/apache/james/mime4j/stream/MimeConfig$Builder 
at org.apache.tika.parser.mail.RFC822Parser.parse(RFC822Parser.java:74)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
at org.apache.tika.parser.ParserDecorator.parse(ParserDecorator.java:188)
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.Tika.parseToString(Tika.java:527)
at org.apache.tika.Tika.parseToString(Tika.java:602)

When trying to parse the body content from.eml file using Apache Tika throws NoClassDefFoundError.当尝试使用 Apache 解析来自 .eml 文件的正文内容时,Tika 会抛出 NoClassDefFoundError。

AutoDetectParser identifies it as RFC822Parser to be used, however, in the parse method of RFC822Parser it tries to build the MimeConfig AutoDetectParser 将其标识为要使用的 RFC822Parser,但是,在 RFC822Parser 的 parse 方法中,它尝试构建 MimeConfig

MimeConfig config = new MimeConfig.Builder()
                .setMaxLineLen(100000)
                .setMaxHeaderLen(100000)
                .build();

Unable to construct the instance and breaks.无法构造实例并中断。

Actually, I figured the problem as to why RFC822Parser failing to create an instance of MimeConfig because there was a conflict between two Apache libraries -> Apache Tika and Apache James Jdkim library.实际上,我想出了为什么 RFC822Parser 无法创建 MimeConfig 实例的问题,因为两个 Apache 库之间存在冲突 -> Apache Tika 和 ZE9713AE04A02A810D6F33DDki 库。42794 James JDD9 Both have the same class name MimeConfig but different behavior and loading equivalent class Runtime go haywire两者具有相同的 class 名称 MimeConfig 但不同的行为和加载等效的 class 运行时 go

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM