2 Replies Latest reply on Jan 21, 2015 11:18 AM by Ruben Lara

    ShrinkWrap UnknownExtensionTypeException during WebArchive creation

    Ruben Lara Newbie

      I want to create a full WebArchive for running Arquillian Tests using the new ShrinkWrap Feature MavenImporter (https://github.com/shrinkwrap/resolver).

       

      The Scenario:

      Arquillian should be integrated/extended with SoapUi to test a Spring application. There are n Endpoints exposed by the Spring application and implemented with cxf.

       

      The test method looks like this:

       

         /*

           * Source folder for SoapUi project files

           */

          @Value("${soapui.workspace}")

          private String soapUiWorkspace;

       

          /*

           * Output directory for test reports

           */

          @Value("${soapUi.reports.dir}")

          private String reportsOutpuDirectory;

       

          /*

           * Comma separated list of SoapUi projects to be tested

           */

          @Value("${soapUi.projects}")

          private String[] projects;

       

          /*

           * URL resource provided by Arquillian runtime

           */

          @ArquillianResource

          private URL serverUrl;

       

          @Test

          public void testServiceEndpoints() throws Exception {

              final SoapUITestCaseRunner runner = new SoapUITestCaseRunner();

       

              for (String project : projects) {

                  runner.setProjectFile(String.format("%s%s%s", soapUiWorkspace, "/", project));

                  runner.setHost(String.format("%s:%s", serverUrl.getHost(), serverUrl.getPort()));

                  runner.setOutputFolder(reportsOutpuDirectory);

       

                  LOG.info("SoapUi-Call for " + runner.getHost());

       

                  runner.setJUnitReport(true);

                  runner.setPrintReport(true);

                  runner.run();

              }

          }

       

       

      The @Deployment-Method looks like this:

       

      @Deployment
      public static Archive<?> createDeployment() {
        
      return ShrinkWrap.create(MavenImporter.class).loadPomFromFile("pom.xml").importBuildOutput().as(WebArchive.class);
      }


      I'm getting right now this Exception:


      java.lang.RuntimeException: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.Archive com.bosch.mome.ws.facade.common.soapui.MarketTransparencyServiceEndpointsSoapUiTest.createDeployment()
        at org
      .jboss.shrinkwrap.api.UnknownExtensionTypeException.newInstance(UnknownExtensionTypeException.java:68)
        at org
      .jboss.shrinkwrap.api.UnknownExtensionTypeExceptionDelegator.newExceptionInstance(UnknownExtensionTypeExceptionDelegator.java:37)
        at org
      .jboss.shrinkwrap.impl.base.ServiceExtensionLoader.findExtensionImpl(ServiceExtensionLoader.java:279)
        at org
      .jboss.shrinkwrap.impl.base.ServiceExtensionLoader.loadExtensionMapping(ServiceExtensionLoader.java:246)
        at org
      .jboss.shrinkwrap.impl.base.ServiceExtensionLoader.createFromLoadExtension(ServiceExtensionLoader.java:212)
        at org
      .jboss.shrinkwrap.impl.base.ServiceExtensionLoader.load(ServiceExtensionLoader.java:108)
        at org
      .jboss.shrinkwrap.impl.base.ArchiveBase.as(ArchiveBase.java:662)
        at org
      .jboss.shrinkwrap.api.ArchiveFactory.create(ArchiveFactory.java:150)
        at org
      .jboss.shrinkwrap.api.ShrinkWrap.create(ShrinkWrap.java:163)
        at com
      .bosch.mome.ws.facade.common.soapui.MarketTransparencyServiceEndpointsSoapUiTest.createDeployment(MarketTransparencyServiceEndpointsSoapUiTest.java:82)

      Jan 19, 2015 6:29:46 PM org.apache.coyote.http11.Http11Protocol destroy
      INFO
      : Stopping Coyote HTTP/1.1 on http-127.0.0.1-8888


      I'm not adding the Assets separately because I'm integrating currently the junit SoapUi library and Arquillian for testing Endpoints and need to load the full Application/WebArchive.

      I was looking to the ShrinkWrap javadoc but could not find a working solution/fix.

       

      In the javadoc I read the following:

       

      UnknownExtensionTypeException: Indicates that a default name cannot be generated for a given type because no extension mapping has been configured via ExtensionLoader.getExtensionFromExtensionMapping(Class)


      But I don't know where I can exactly configure the Extension mapping. There is no tutorial or samples. Or may be I could not find them.

       

      Does anybody have Experience with this new ShrinkWrap Feature? Can anybody give me a Hint how to deal with it?