On 16.08.2010, at 10:03, Jukka Zitting wrote:

> On Fri, Aug 13, 2010 at 5:02 PM, Kaspar Fischer <[email protected]> 
> wrote:
> 
>> org.apache.tika.parser.asm.ClassParser cannot be cast to 
>> org.apache.tika.parser.Parser
> 
> Sounds like you have multiple copies of the tika-core jar in your classpath.

I thought so, too, but could not see any second Tika JAR on the classpath (as 
reported via 'ps').

What helped was adding the line

  Parser.class.isAssignableFrom(Class.forName("org.apache.tika.parser.asm.Cla 
ssParser")); 

in my startup code. Without this, 

  final Iterator<Parser> it = 
ServiceRegistry.lookupProviders(org.apache.tika.parser.Parser.class); 
  while (it.hasNext()) 
  { 
    System.err.println(it.next().getClass()); 
  } 

produces no results; with the above line, I see all parsers from Tika. (It was 
not enough to simply define a ClassParser instance "ClassParser dummy".) 

If you have any idea what the reason could be, I am happy to learn about it.

Best regards and thanks, Jukka, for your feedback,
Kaspar

P.S. For the sake of completeness I posted this also to the Google Web Toolkit 
group:

  
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/fb9aa8b02223df03/5ac8dd79b0285d54#5ac8dd79b0285d54

Reply via email to