[jboss-jira] [JBoss JIRA] (AS7-2986) ModuleClassLoader can't load HttpClient within a spring loaded bean using RESTEasy

Stuart Douglas (Resolved) (JIRA) jira-events at lists.jboss.org
Mon Jan 2 20:54:09 EST 2012


     [ https://issues.jboss.org/browse/AS7-2986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stuart Douglas resolved AS7-2986.
---------------------------------

      Assignee: Stuart Douglas  (was: David Lloyd)
    Resolution: Rejected


This occurring because you are not using the containers built in JAX-RS support (https://docs.jboss.org/author/display/AS71/JAX-RS+Reference+Guide). 

You have a few options: 

- change your deployment to use the spec compliant method of activating resteasy, and don't bundle resteasy. 

- disable the jaxrs subsystem by removing it from standalone.xml and bundle resteasy.

- don't bundle resteasy and use a Dependencies: manifest entry to manually setup a dependency on the containers resteasy version. 

https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7



                
> 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: Stuart Douglas
>
> 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