[jboss-jira] [JBoss JIRA] (AS7-2986) ModuleClassLoader can't load HttpClient within a spring loaded bean using RESTEasy
Michael Steffens (Updated) (JIRA)
jira-events at lists.jboss.org
Tue Dec 13 05:00:11 EST 2011
[ https://issues.jboss.org/browse/AS7-2986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Steffens updated AS7-2986:
----------------------------------
Steps to Reproduce:
Build and deploy
http://community.jboss.org/servlet/JiveServlet/download/640810-46760/restws-client-in-service_jboss-as-7.1.0.Beta1b.zip
Bug will be triggered by a GET request to http://localhost:8080/restws-client-in-service/restws
assuming JBoss is listening on localhost port 8080.
was:
Build and deploy
http://community.jboss.org/servlet/JiveServlet/download/640810-46739/restws-client-in-service_jboss-as-7.1.0.Beta1b.zip
Bug will be triggered by a GET request to http://localhost:8080/restws-client-in-service/restws
assuming JBoss is listening on localhost port 8080.
Forum Reference: http://community.jboss.org/message/640810 (was: http://community.jboss.org/message/640810)
Example code was unintentionally packed as nested zip archive. Fixed and updated reference.
> 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