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

Mark Struberg commented on TOMEE-877:
-------------------------------------

It works, but I'm not really 100% happy with how you fixed it.

The fallback code in ParentClassLoaderFinder is exactly the same as your new 
class. By _always_ setting the ParentClassLoaderFinder component to 
ProvidedClassLoaderFinder you will never ever hit the default init in 
ParentClassLoadeFinderr#get().

Here is what I had locally (see attached patch)
                
> ParentClassLoaderFinder default strategy is broken for embedded OpenEJB
> -----------------------------------------------------------------------
>
>                 Key: TOMEE-877
>                 URL: https://issues.apache.org/jira/browse/TOMEE-877
>             Project: TomEE
>          Issue Type: Bug
>    Affects Versions: 1.5.1
>            Reporter: Mark Struberg
>            Priority: Critical
>
> ParentClassLoaderFinder default strategy always uses the ClassLoader which 
> got used to load OpenEJB.class. But this algorithm is broken for all 
> scenarios where a classloader hierarchy is in place. 
> Instead of this we should use the 
> Thread.currentThread.getContextClassLoader() by default.
> Please note that is is effectively not possible to set a custom 
> ParrentClassLoaderFinder (via 
> SystemInstance.get().setComponent(ParentClassLoaderFinder.class,... ) when 
> using EJBContainer.createEJBContainer() as this gets cleared via 
> SystemInstance.reset() at boot time. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to