tika-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (TIKA-441) Sometimes, tika not working (crashed) because of null classloader
Date Wed, 16 Jun 2010 19:10:23 GMT

     [ https://issues.apache.org/jira/browse/TIKA-441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jukka Zitting resolved TIKA-441.
--------------------------------

      Assignee: Jukka Zitting
    Resolution: Fixed

Good point, fixed in revision 955348.

I used a slightly modified version of your patch. Instead of directly falling back to ClassLoader.getSystemClassLoader(),
I'm first trying TikaConfig.class.getClassLoader() as that's probably more accurate in many
cases. Only if neither the thread context class loader nor the TikaConfig class loader are
available, do we opt for the system class loader. And finally, if none of these is available,
Tika will simply just not load any Parser implementations by default.

PS. I noticed you updated also the MimeTypesReader.read(String) method in your patch. This
package-private method is actually not used anywhere, so I simply removed it entirely.

> Sometimes, tika not working (crashed) because of null classloader
> -----------------------------------------------------------------
>
>                 Key: TIKA-441
>                 URL: https://issues.apache.org/jira/browse/TIKA-441
>             Project: Tika
>          Issue Type: Bug
>          Components: general
>         Environment: MS Windows with tika running under Apache Commons Daemon (procrun)
>            Reporter: Alex Ott
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 0.8
>
>         Attachments: classloader-fix.diff
>
>
> I used Tika inside application, that should run as MS Windows service via Apache Commons
Daemon - procrun (http://commons.apache.org/daemon/procrun.html). When it was running under
procrun, then Thread.currentThread().getContextClassLoader() returned null instead ClassLoader's
instance. I made a workaround in my app by explicitly setting classloader for current thread.
 I'll attach fix, that should use system class loader if getContextClassLoader will return
null

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message