开发者

javax.mail.MessagingException in Tika

开发者 https://www.devze.com 2023-03-31 03:55 出处:网络
Hi I am using using apache Tika, and I made few changes to Tika as per my requirement and I am able to build the Tika successfully. But when i am trying to run the Tika i am getting the following exce

Hi I am using using apache Tika, and I made few changes to Tika as per my requirement and I am able to build the Tika successfully. But when i am trying to run the Tika i am getting the following exception, I added mail.jar and activation. jar to the classpath.

can any one help me in solving this problem .

D:\Tika\apache-tika-0.9>java -jar D:\Tika\apache-tika-0.9\tika-app\target\tika-app-0.9.jar TikaCLI
Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/MessagingException
Caused by: java.lang.ClassNotFoundException: javax.mail.MessagingException
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: org.开发者_StackOverflow社区apache.tika.cli.TikaCLI. Program will exit.

Thanks in advance...


That exception is telling you that you really don't have the mail jar on your classpath after all.

When maven builds the tika-app jar, all the declared dependencies get inlined into it. If you're adding new dependencies for your own custom build, you need to list those too in the tika-app pom so they get rolled in. Otherwise, you can just pass in the extra jars on the command line to java, with a -classpath statement, which your example doesn't show you doing.

0

精彩评论

暂无评论...
验证码 换一张
取 消