TomEE
  1. TomEE
  2. TOMEE-42

TCCL.getResources() returns duplicated when deploying with OpenEJB deployer

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0-beta-2
    • Component/s: None
    • Labels:
      None
    • Environment:
      1.0.0-beta-2-20111019.211229-11-plus

      Description

      Having a testing listener:

      @WebListener
      public class Listener implements ServletContextListener {

      @Override
      public void contextInitialized(ServletContextEvent sce) {
      int j = 0;
      try {
      ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
      Enumeration<URL> urls = classLoader.getResources("foo.bar");
      while (urls.hasMoreElements())

      { urls.nextElement(); j++; }

      System.out.println("foo.bar count: " + j);
      } catch (IOException e)

      { e.printStackTrace(); }

      }

      @Override
      public void contextDestroyed(ServletContextEvent sce) {
      }
      }

      it returns the expected count (1) when deployed using the manager app or filesystem deployment. However, it returns 2 when deployed using OpenEJB deployer service (remote arquillian container).

      1. test.war
        3 kB
        Jozef Hartinger

        Activity

        Jozef Hartinger created issue -
        Jozef Hartinger made changes -
        Field Original Value New Value
        Attachment test.war [ 12500453 ]
        rmannibucau committed 1188254 (1 file)
        Reviews: none

        TOMEE-42 using catalina classloader as parent one for webapps created by TomEE itself

        rmannibucau committed 1188262 (5 files)
        rmannibucau committed 1188358 (1 file)
        Reviews: none

        TOMEE-42 using openejb classlaoder as parent classloader instead of catalina one

        rmannibucau committed 1189142 (2 files)
        Reviews: none

        TOMEE-42 TOMEE-43 adding a custom Loader to the standardcontext to be able to override the classloader used. In the tomcat deployement the classloader used by openejb is the stadnardcontext one so it is ok but in TomEE container (used by arquillian, DeployerEjb, tomee-embedded and TomEE EJBContainer) the classloader used is a classloader created by OpenEJB. So Class.isAssignable returns false when Foo.class.isAssignable(Foo.class) is called because classloaders are differents. - still to validate

        Hide
        David Blevins added a comment -

        Fixed with Arquillian unit test org.apache.openejb.arquillian.tests.getresources

        Show
        David Blevins added a comment - Fixed with Arquillian unit test org.apache.openejb.arquillian.tests.getresources
        David Blevins made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Romain Manni-Bucau [ romain.manni-bucau ]
        Resolution Fixed [ 1 ]
        Show
        David Blevins added a comment - 2011-10-24 - http://svn.apache.org/viewvc?view=revision&revision=1188254 - rmannibucau 2011-10-24 - http://svn.apache.org/viewvc?view=revision&revision=1188262 - rmannibucau 2011-10-24 - http://svn.apache.org/viewvc?view=revision&revision=1188358 - rmannibucau 2011-10-26 - http://svn.apache.org/viewvc?view=revision&revision=1189142 - rmannibucau 2011-10-30 - http://svn.apache.org/viewvc?view=revision&revision=1195198 - rmannibucau 2011-10-30 - http://svn.apache.org/viewvc?view=revision&revision=1195229 - rmannibucau 2011-11-01 - http://svn.apache.org/viewvc?view=revision&revision=1196093 - rmannibucau 2011-11-01 - http://svn.apache.org/viewvc?view=revision&revision=1196180 - rmannibucau 2011-11-06 - http://svn.apache.org/viewvc?view=revision&revision=1198591 - rmannibucau

          People

          • Assignee:
            Romain Manni-Bucau
            Reporter:
            Jozef Hartinger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development