quarkusio/quarkus · error · DeploymentException

Unknown archive type: ${deploymentArchive}

Error message

Unknown archive type: ${deploymentArchive}

What it means

ArC's Arquillian TCK Deployer explodes the given deployment archive (jar or war) into a directory to run bean processing. If the archive passed to deploy() is neither a JavaArchive nor a WebArchive, the framework does not know how to explode it and throws DeploymentException. This is a defensive guard against unsupported archive types.

Source

Thrown at independent-projects/arc/tcks/arquillian/src/main/java/io/quarkus/arc/arquillian/Deployer.java:65

    private final DeploymentDir deploymentDir;
    private final String testClass;

    private final List<BeanArchive> beanArchives = new ArrayList<>();

    Deployer(Archive<?> deploymentArchive, DeploymentDir deploymentDir, String testClass) {
        this.deploymentArchive = deploymentArchive;
        this.deploymentDir = deploymentDir;
        this.testClass = testClass;
    }

    DeploymentClassLoader deploy() throws DeploymentException {
        try {
            if (deploymentArchive instanceof JavaArchive) {
                explodeJar();
            } else if (deploymentArchive instanceof WebArchive) {
                explodeWar();
            } else {
                throw new DeploymentException("Unknown archive type: " + deploymentArchive);
            }

            generate();

            return new DeploymentClassLoader(deploymentDir);
        } catch (IOException | ExecutionException | InterruptedException e) {
            throw new DeploymentException("Deployment failed", e);
        }
    }

    private void explodeJar() throws IOException {
        Archives.explode(deploymentArchive, "/", deploymentDir.appClasses);

        BeanArchive beanArchive = BeanArchive.detect(deploymentArchive);
        if (beanArchive != null) {
            beanArchives.add(beanArchive);
        }
    }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Change the test deployment to produce a JavaArchive (JAR) or WebArchive (WAR) via ShrinkWrap.create(JavaArchive.class/War.class, ...).
  2. If an EAR is required, extract the inner jar/war module and deploy that instead.
  3. Inspect the actual runtime class of the archive and add support (explode method) for it in Deployer if it is a legitimate new type.

Example fix

// before
WebArchive war = ShrinkWrap.create(EnterpriseArchive.class, "test.ear")...; deployer.deploy(ear);
// after
JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "test.jar")
        .addPackages(true, "org.acme")
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
deployer.deploy(jar);
Defensive patterns

Strategy: validation

Validate before calling

if (!(archive instanceof JavaArchive) && !(archive instanceof WebArchive)) {
    throw new IllegalArgumentException("Deployer supports only JavaArchive/WebArchive, got: " + archive.getClass().getName());
}
deployer.deploy(archive);

Type guard

static boolean isSupportedArchive(Object a) {
    return a instanceof JavaArchive || a instanceof WebArchive;
}

Try / catch

try {
    deployer.deploy(archive);
} catch (DeploymentException e) {
    if (e.getMessage().startsWith("Unknown archive type")) {
        throw new IllegalStateException("Unsupported archive type: " + archive.getClass(), e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling Deployer.deploy() with an archive object that is not an instance of org.jboss.shrinkwrap.api.spec.JavaArchive or WebArchive (e.g. an EnterpriseArchive/ear or a custom Archive implementation).

Common situations: Running the CDI TCK against a test deployment that produces an EAR archive, or a custom Arquillian protocol that wraps archives in a non-standard type; version changes where the archive type changed.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/4c37b336c513c7c2. Report an issue: GitHub.