[jboss-jira] [JBoss JIRA] (WFLY-822) MBean created via EAR/META-INF/jboss-service.xml from class defined in JBoss module gets wrong TCCL

RH Bugzilla Integration (JIRA) issues at jboss.org
Mon Jun 2 08:51:26 EDT 2014


    [ https://issues.jboss.org/browse/WFLY-822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972418#comment-12972418 ] 

RH Bugzilla Integration commented on WFLY-822:
----------------------------------------------

mark yarborough <myarboro at redhat.com> changed the Status of [bug 1054984|https://bugzilla.redhat.com/show_bug.cgi?id=1054984] from VERIFIED to CLOSED

> MBean created via EAR/META-INF/jboss-service.xml from class defined in JBoss module gets wrong TCCL
> ---------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-822
>                 URL: https://issues.jboss.org/browse/WFLY-822
>             Project: WildFly
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Class Loading, Server
>         Environment: Java 6u31
>            Reporter: Zachary Bedell
>            Assignee: jaikiran pai
>              Labels: classloader, mbean, modules
>             Fix For: 8.0.0.Alpha3
>
>         Attachments: SarTcclTst.tbz
>
>
> When an MBean is loaded from jboss-service.xml within an EAR, the TCCL should point to the EAR deployment so that config files and other resources can be classloaded from the EAR.  Under JBoss 7.1.1.Final, the TCCL in a module loaded MBean's start() method is the module's ClassLoader.  No reference to the EAR deployment's classloader is available, thus EAR resources are not available within the MBean.
> It appears that org.jboss.as.service.AbstractService::invokeLifecycleMethod() incorrectly sets the TCCL to the module's defining classloader rather than the EAR's:
> {{{
> protected void invokeLifecycleMethod(final Method method) throws InvocationTargetException, IllegalAccessException {
>         if (method != null) {
>             final ClassLoader old = SecurityActions.setThreadContextClassLoader(mBeanInstance.getClass().getClassLoader());
>             try {
>                 method.invoke(mBeanInstance);
>             } finally {
>                 SecurityActions.resetThreadContextClassLoader(old);
>             }
>         }
>     }
> }}}



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the jboss-jira mailing list