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

Gary Karasiuk commented on TIKA-966:
------------------------------------

I am still investigating this. This may turn out to be a bug in the Eclipse 
plug-in development environment. 

I created a small test bundle, that has this test method:


        private void testParse() {
                Tika tika = new Tika();
                Metadata meta = new Metadata();
                InputStream in = null;
                String html = "<html><body><p>A test HTML 
document.</p></body></html>";
                try {
                        in = new ByteArrayInputStream(html.getBytes());
                        String contents = tika.parseToString(in, meta, -1);
                        System.err.printf("length of contents %d\n", 
contents.length());
                        System.err.println("contents: " + contents);
                } catch (Exception e) {
                        e.printStackTrace();
                }       
                finally {
                        try {if (in != null)in.close();}
                        catch (IOException e){}
                }
        }

When I run it inside of Eclipse I get this output:

GRK - start of test
length of contents 0
contents: 
GRK - end of test

When I export the application, and run it as a standalone OSGi application I 
get this (correct) output:

GRK - start of test
length of contents 22
contents: A test HTML document.

GRK - end of test

                
> org.apache.tika.Tika missing from tika-bundle-1.2.jar
> -----------------------------------------------------
>
>                 Key: TIKA-966
>                 URL: https://issues.apache.org/jira/browse/TIKA-966
>             Project: Tika
>          Issue Type: Bug
>          Components: packaging
>    Affects Versions: 1.2
>            Reporter: Gary Karasiuk
>
> In version 0.9 I was able to use the org.apache.tika.Tika class in my OSGi 
> application simply by including the tika-bundle.
> I am now trying to move to version 1.2 and this class is missing from the 
> tika-bundle-1.2.jar
> The top level documentation says "Tika bundle. An OSGi bundle that includes 
> everything you need to use all Tika functionality in an OSGi environment." so 
> I think that this should be continued to included.
> I tried including the tika-core-1.2.jar into my application, but even after 
> fiddling with various start levels I can't get the Tika class to find the 
> parsers in the tika-bundle.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to