Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-294

Shrinkwrap has a dependency on ThreadContext ClassLoader

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • None
    • OSGi Containers
    • None

      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.

            Unassigned Unassigned
            tdiesler@redhat.com Thomas Diesler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: