Hi everybody,

I am using Tika in a GWT project. My JUnit tests run fine and so does my GWT 
project in the so-called "GWT production mode". However, when I want to run GWT 
in the development mode from within eclipse, the statement

  Tika tika = new Tika();

creates internally a TikaConfig with no parsers. Looking at the sources, I see 
that the ServiceRegistry is used to find the parsers, and this one finds none 
at all.

I tried to do 

  Tika tika = new Tika(new TikaConfig(ClassLoader.getSystemClassLoader()));

but when I do this, I get

  ava.lang.ClassCastException: org.apache.tika.parser.asm.ClassParser cannot be 
cast to org.apache.tika.parser.Parser

I am not sure where exactly the problem lies. Obviously, my code finds the 
class Tika and I therefore suppose that all would work fine if only TikaConfig 
had its parsers list setup properly. So is there a way to populate this list 
with defaults WITHOUT calling the ServiceRegistry? (I do not have any custom 
parsers in my application.)

For the sake of completeness, I attach some information about my GWT config.

A lot of thanks in advance for any pointers or ideas, I am pretty lost here.

Thanks,
Kaspar

--

I have a Maven project that has dependencies to include version 0.8-SNAPSHOT of 
tika-core and tika-parsers. The Maven project uses the gwt-maven-plugin with 
the following setup (which according to 
http://mojo.codehaus.org/gwt-maven-plugin/eclipse/google_plugin.html is 
standard):

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>1.2</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <runTarget>org.myproject.web.Application/Application.html</runTarget>
          <extraJvmArgs>-Xmx512M -Xss1024k -ea -enableassertions</extraJvmArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
          <warSourceDirectory>war</warSourceDirectory>
          <webXml>src/main/webapp/WEB-INF/web.xml</webXml>
        </configuration>
      </plugin>

Reply via email to