[arquillian-issues] [JBoss JIRA] Updated: (ARQ-294) Shrinkwrap has a dependency on ThreadContext ClassLoader

Thomas Diesler (JIRA) jira-events at lists.jboss.org
Tue Sep 14 19:47:28 EDT 2010


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

Thomas Diesler updated ARQ-294:
-------------------------------

    Component/s: OSGi Containers


> Shrinkwrap has a dependency on ThreadContext ClassLoader
> --------------------------------------------------------
>
>                 Key: ARQ-294
>                 URL: https://jira.jboss.org/browse/ARQ-294
>             Project: Arquillian
>          Issue Type: Bug
>          Components: OSGi Containers
>            Reporter: Thomas Diesler
>
> The Shrinkrap API provided by the arquillian-osgi-bundle has a dependency on TCCL
> See AbstractOSGiContainer
>    public Bundle installBundle(Archive<?> archive) throws BundleException
>    {
>       InputStream inputStream;
>       ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
>       try
>       {
>          // Read the archive in the context of the arquillian-osgi-bundle 
>          Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
>          ZipExporter exporter = archive.as(ZipExporter.class);
>          ByteArrayOutputStream baos = new ByteArrayOutputStream();
>          exporter.exportZip(baos);
>          inputStream = new ByteArrayInputStream(baos.toByteArray());
>       }
>       finally
>       {
>          Thread.currentThread().setContextClassLoader(ctxLoader);
>       }
>       return context.installBundle(archive.getName(), inputStream);
>    }
> As long as this internal code needs to set the TCCL, user code that works on the Archive will also need to do that.
> The likely resolution is, to remove TCCL dependency iin shrinkwrap.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the arquillian-issues mailing list