How should the AS7 copy of the JAX-RS API jars be initialized? It seems wrong to me, that each deployed Seam application is calling org.jboss.resteasy.spi.ResteasyProviderFactory.setInstance().
I also don't see why we need the org.jboss.seam.resteasy.SeamResteasyProviderFactory class which just passes through to the extended ResteasyProviderFactory class. Short term fix #1: eliminate the SeamResteasyProviderFactory class and use ResteasyProviderFactory in its place. Short term fix #2: don't package the rest easy jars with the application. I think with these changes, there may still be multiple calls to the ResteasyProviderFactory.setInstance() but each one should pass the same ResteasyProviderFactory (from the AS7 JAR-RS API jars). To be worked out, changes to avoid having applications call ResteasyProviderFactory.setInstance(), that should be initialized by AS7 (I think) or at least handled more gracefully. As things stand currently, applications probably shouldn't clear the instance (as that would break other apps). Thoughts? Scott On 02/14/2012 08:07 PM, Scott Marlow wrote: > I agree that if the user doesn't bundle their own rest east jars, that > would probably work around the issue. > > I haven't seen any standalone tests that recreate the leak yet but it > looks likely that the application copy of ResteasyBootstrap.java > (http://anonsvn.jboss.org/repos/seam/branches/community/Seam_2_2/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java) > would call the API > ResteasyProviderFactory.setInstance(ResteasyProviderFactory factory) > which would save the static reference that doesn't get cleared. Worse > than that, I think the setInstance call would blow away any other > ResteasyProviderFactory instance that is already set. > > Which backs up the assertion that rest easy jars shouldn't be bundled > with a user app currently. ResteasyBootstrap should probably clear the > instance at shutdown time but that wouldn't change the API static issue. > > On 02/14/2012 03:06 PM, Stuart Douglas wrote: >> >> I'm pretty sure this is because the user is bundling their own rest easy >> jars in EAR/lib. The API caches stuff in statics, which is keeping a >> reference to the user deployed RESTeasy. >> >> Stuart >> >> On 15/02/2012, at 2:17 AM, Scott Marlow wrote: >> >>> https://community.jboss.org/message/716191 is an AS7 user forum thread >>> about application classloader leaks in a few different areas. >>> >>> All of them involve a Seam 2.2.2 application using Resteasy 2.3.1. One >>> of the leaks is described in jira RESTEASY-660. >>> >>> Is there something that the users application has to do, to get Seam >>> 2.2.2 to call ResteasyProviderFactory.clearContextData() at the end of a >>> request? >>> >>> Scott >>> -------- Original Message -------- >>> Subject: Re: [jboss-as7-dev] help needed with responding to reported >>> classloader leaks in (Rest, Rest WS, JPA, EJB3 activation/passivation, >>> other)... >>> Date: Tue, 14 Feb 2012 07:33:29 -0500 >>> From: Bill Burke<[email protected]> >>> To: [email protected] >>> >>> >>> >>> On 2/13/12 12:59 PM, Scott Marlow wrote: >>>> org.jboss.resteasy.util.ThreadLocalStack creates ThreadLocal pseudo-leak >>>> on AS 7: https://issues.jboss.org/browse/RESTEASY-660 >>>> " >>>> >>> >>> This may be Seam related. >>> >>> -- >>> Bill Burke >>> JBoss, a division of Red Hat >>> http://bill.burkecentral.com >>> _______________________________________________ >>> jboss-as7-dev mailing list >>> [email protected] >>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev >>> _______________________________________________ >>> seam-dev mailing list >>> [email protected] >>> https://lists.jboss.org/mailman/listinfo/seam-dev >> > > _______________________________________________ > seam-dev mailing list > [email protected] > https://lists.jboss.org/mailman/listinfo/seam-dev _______________________________________________ seam-dev mailing list [email protected] https://lists.jboss.org/mailman/listinfo/seam-dev
