On Fri, 4 Dec 2009, Atsuo Ishimoto wrote:

I'm trying to build Apache Tika 0.5 module with jcc 2.5. The module
was built successfully by following command.

   python.exe -m jcc.__main__ --shared --jar ./tika-core-0.5.jar\
              --package java.lang java.lang.System  java.io.File\
                java.io.FileInputStreamjava.io.InputStreamReader\
                java.lang.Runtime\
              --python tika --build --install

But following Java method is not exported to Python.

class: org.apache.tika.parser.AutoDetectParser

   public void parse(
           InputStream stream, ContentHandler handler,
           Metadata metadata, ParseContext context)
           throws IOException, SAXException, TikaException {
   ...
   }

How can I generate Tika library?

See http://lucene.apache.org/pylucene/jcc/documentation/readme.html#use

JCC will generate wrappers for public methods if all classes involved (return type, parameters, exceptions) are in the set of classes that JCC could be generating classes for.

In your example above, it looks like you're missing one or more --package statements to let JCC generate wrappers for SAXException and ContentHandler.

Without including these packages, JCC will skip any method refering to classes in them. Letting JCC generate wrappers for these classes does not mean that it will; a --package statement only tells JCC that it can include classes in this package in the transitive closure of all dependencies on the classes you actually requested be wrapped by listing them individually or via a --jar statement.

Andi..

Reply via email to