You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/03/27 15:29:00 UTC
[jira] [Commented] (OPENJPA-2575) wrong context class loader in
org.apache.openjpa.enhance.PCClassFileTransformer#transform0
[ https://issues.apache.org/jira/browse/OPENJPA-2575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16415807#comment-16415807 ]
ASF subversion and git services commented on OPENJPA-2575:
----------------------------------------------------------
Commit 1827843 from [~dazeydev] in branch 'openjpa/branches/2.2.x'
[ https://svn.apache.org/r1827843 ]
OPENJPA-2575: temporary set TCCL to _tmpClassloader
This prevents using the wrong ClassLoader during OpenJPA bootstrap
which might lead to memory leaks.
> wrong context class loader in org.apache.openjpa.enhance.PCClassFileTransformer#transform0
> ------------------------------------------------------------------------------------------
>
> Key: OPENJPA-2575
> URL: https://issues.apache.org/jira/browse/OPENJPA-2575
> Project: OpenJPA
> Issue Type: New Feature
> Reporter: Romain Manni-Bucau
> Assignee: Mark Struberg
> Priority: Major
> Fix For: 2.4.0
>
> Attachments: OPENJPA-2575.patch
>
>
> Hi
> if there is a temp loader in org.apache.openjpa.enhance.PCClassFileTransformer#transform0 then it should be the context where classes are loaded during the enhancement (transform0). typically "new Project().loadClass(new ByteArrayInputStream(bytes), _tmpLoader)" shouldn't be done outside of _tmpLoader contextual loader.
> Standard Thread.currentThread().setContextClassLoader(_tmpLoader); then setContextClassLoader(old) try/finally solves it.
> Side note: this issue has been reported originally on tomee@.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)