[ 
https://issues.apache.org/jira/browse/TIKA-1240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13900650#comment-13900650
 ] 

Uwe Schindler commented on TIKA-1240:
-------------------------------------

Hi Sudheshna,

this is a well-known issue caused by other dependencies in your classpath. The 
problem is caused by the ASM library, which is used by TIKA to parse .class 
files. TIKA uses version 4.1 of ASM. In this version, the given 
{{org.objectweb.asm.ClassVisitor}} is an abstract class, implemented by TIKA.

Because of some other Maven dependency, you seem to have an older version of 
ASM (possibly 3.x or earlier) on your classpath. ASM changed its API in an 
incompatible way, {{org.objectweb.asm.ClassVisitor}} is an interface in older 
versions. Unfortunately, ASM 3 and ASM 4 cannot cooexist.

You need to clean up your dependencies and remove the dependency that includes 
ASM 3.x (use a dependency viewer, e.g. in Eclipse) to view all versions.

This is no issue of TIKA, so this issue can be closed. A solution to solve this 
common problem would be to use the Maven Shade plugin to change the package 
names of ASM and bundling ASM with the class file parser together with TIKA. 
All other projects (like Maven itsself), which use ASM do this, because the 
incompatibility between ASM 3 and ASM 4 is not solveable in another way.

> IncompatibleClassChangeError with ->  new Tika().parseToString(stream);
> -----------------------------------------------------------------------
>
>                 Key: TIKA-1240
>                 URL: https://issues.apache.org/jira/browse/TIKA-1240
>             Project: Tika
>          Issue Type: Task
>          Components: parser
>            Reporter: sudheshna iyer
>            Priority: Critical
>
> I am receiving the following error from :  new Tika().parseToString(stream);
> Exception in thread "main" java.lang.IncompatibleClassChangeError: class 
> org.apache.tika.parser.asm.XHTMLClassVisitor has interface 
> org.objectweb.asm.ClassVisitor as super class
> At first I thought it is a problem with stream that is passed in. But it is 
> very random. File that worked started erroring out with the above exception.
> Please help.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to