[
https://issues.apache.org/jira/browse/PDFBOX-5242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17385647#comment-17385647
]
Clifford Dann commented on PDFBOX-5242:
---------------------------------------
Also in that, link I see they suggest swapping stuff around in ServiceLookup
this will not work as I have tried it, also tried swapping the current thread
class loader around before calling load, that also did not work, and in a true
test you need more that one war file deployed, and both of them must include
JBIG2 jar file, the easy answer is to put the jar in the /lib folder of tomcat,
but this means we would have to stop the tomcat service, every time we wanted
to update the jar and all the war deployment must have the same version of
JBIG2, all of that would cause us a big problem, so I have just stopped it from
being a service, there may be a better way, but I know little about
ServiceLoader and how to make it behave it self.
And if further version have the same problem , I will just do the same thing,
and strip out the Service loader.
> LoggerBridge loading under the wrong class loader
> -------------------------------------------------
>
> Key: PDFBOX-5242
> URL: https://issues.apache.org/jira/browse/PDFBOX-5242
> Project: PDFBox
> Issue Type: Bug
> Components: JBIG2
> Affects Versions: 3.0.0 JBIG2, 3.0.1 JBIG2, 3.0.2 JBIG2, 3.0.3 JBIG2
> Environment: Java 16
> Reporter: Clifford Dann
> Priority: Major
>
> When used in a Tomcat servelet LoggerBridge has a different class loader to
> JDKLoggerBridge so when it dose {color:#1d1c1d}if
> (service.isAssignableFrom(clazz)) {{color} in java.util.ServiceLoader it
> fails.
> took the source to 3.0.3 and replaced all.
> private static final Logger log
> with
> private final Logger log
> and also added , Thread.currentThread().getContextClassLoader() as a
> parameter to LoggerFactory.getLogger .
>
> This fixed the problem for me, not too sure if
> Thread.currentThread().getContextClassLoader() is over kill as I think it is
> the static that is causing the problem.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]