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

ClassNotFoundException on Websphere

XMLWordPrintable

      I'm trying to make the TemperatureConverterTest running as an EAR on my WAS but I always get a ClassNotFoundException for the test class on the server side (test class is not missing in the jar). Relevant snippet from the test class:

      ...
      @Inject
      private TemperatureConverter converter;

      @Deployment
      public static EnterpriseArchive createTestArchive()

      { return ShrinkWrap.create(EnterpriseArchive.class, "testConverter.ear") .addAsModule( ShrinkWrap.create(JavaArchive.class, "test.jar"). addClass(TemperatureConverterTest.class). addClass(TemperatureConverter.class)); }

      ...

      ServletTestRunner fails on loading the class:

      Class<?> testClass = SecurityActions.getThreadContextClassLoader().loadClass(className);

      Looking into the deployed ear I cannot see any reason for this behavior. The strange is that after adding a @EJB (and the relevant ejb classes) to my test the classloader is able to resolve the test class:

      ...
      @EJB
      private MyEjbLocal instanceVariable;
      ...

            gpoul_jira Gerhard Poul (Inactive)
            ylangisc Yves Langisch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: