[
https://issues.jboss.org/browse/AS7-5630?page=com.atlassian.jira.plugin.s...
]
Zachary Bedell updated AS7-5630:
--------------------------------
Attachment: SarTcclTst.tbz
Ant-based reproducer. Run `ant ear` to build minimal JBoss. Start the default standalone
configuration. Will throw on deployment if TCCL is wrong, should deploy successfully
& log if TCCL points to EAR.
MBean created via EAR/META-INF/jboss-service.xml from class defined
in JBoss module gets wrong TCCL
---------------------------------------------------------------------------------------------------
Key: AS7-5630
URL:
https://issues.jboss.org/browse/AS7-5630
Project: Application Server 7
Issue Type: Bug
Components: Class Loading, Server
Affects Versions: 7.1.1.Final
Environment: Java 6u31
Reporter: Zachary Bedell
Assignee: David Lloyd
Labels: classloader, mbean, modules
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 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