[arquillian-issues] [JBoss JIRA] Closed: (ARQ-294) Shrinkwrap has a dependency on ThreadContext ClassLoader
Aslak Knutsen (JIRA)
jira-events at lists.jboss.org
Wed Apr 27 11:27:18 EDT 2011
[ https://issues.jboss.org/browse/ARQ-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aslak Knutsen closed ARQ-294.
-----------------------------
> Shrinkwrap has a dependency on ThreadContext ClassLoader
> --------------------------------------------------------
>
> Key: ARQ-294
> URL: https://issues.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.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the arquillian-issues
mailing list