[jboss-jira] [JBoss JIRA] (AS7-2986) ModuleClassLoader can't load HttpClient within a spring loaded bean using RESTEasy
Michael Steffens (Created) (JIRA)
jira-events at lists.jboss.org
Mon Dec 12 12:25:12 EST 2011
ModuleClassLoader can't load HttpClient within a spring loaded bean using RESTEasy
----------------------------------------------------------------------------------
Key: AS7-2986
URL: https://issues.jboss.org/browse/AS7-2986
Project: Application Server 7
Issue Type: Bug
Components: Class Loading
Affects Versions: 7.1.0.Beta1b
Reporter: Michael Steffens
Assignee: David Lloyd
Can't instantiate a HttpClient within a spring loaded bean using RESTEasy.
Depending on whether resteasy-jaxrs included in war archive (scope "compile") or not included (scope "provided"), the ModuleClassLoader is trapped by either a duplicate class object, or none at all.
See http://community.jboss.org/message/640810 for further details and example code.
Tried following workarounds, but failed:
If you change the code not to instantiate HttpClient explicitly, as in
private ClientExecutor createClientExecutor()
{
ClientExecutor clientExecutor = new ApacheHttpClient4Executor();
return clientExecutor;
}
the code runs fine. But then you can't attach Credentials (not acceptable). Or you need to query the ClientExecutor's HttpClient afterwards, and cast the result to DefautHttpClient -> Class loader issue is back again.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list