quarkusio/quarkus · error · IllegalArgumentException

Cycle detected in BeanParam annotations; already processed c

Error message

Cycle detected in BeanParam annotations; already processed class " + beanParamClass.name()

What it means

Build-time error from BeanParamParser.parseInternal: while recursively expanding @BeanParam types, a class was encountered that is already on the processing stack — i.e. the bean param composition is cyclic (a bean param type that (transitively) embeds itself). The already-processed class name is appended to the message.

Source

Thrown at independent-projects/resteasy-reactive/client/processor/src/main/java/org/jboss/resteasy/reactive/client/processor/beanparam/BeanParamParser.java:52

import org.jboss.jandex.MethodInfo;
import org.jboss.jandex.Type;
import org.jboss.resteasy.reactive.common.processor.AsmUtil;
import org.jboss.resteasy.reactive.common.processor.JandexUtil;
import org.jboss.resteasy.reactive.common.processor.JavaBeanUtil;
import org.jboss.resteasy.reactive.common.processor.ResteasyReactiveDotNames;
import org.jboss.resteasy.reactive.common.processor.StringUtil;

public class BeanParamParser {

    public static List<Item> parse(ClassInfo beanParamClass, IndexView index) {
        Set<ClassInfo> processedBeanParamClasses = Collections.newSetFromMap(new IdentityHashMap<>());
        return parseInternal(beanParamClass, index, processedBeanParamClasses);
    }

    private static List<Item> parseInternal(ClassInfo beanParamClass, IndexView index,
            Set<ClassInfo> processedBeanParamClasses) {
        if (!processedBeanParamClasses.add(beanParamClass)) {
            throw new IllegalArgumentException("Cycle detected in BeanParam annotations; already processed class "
                    + beanParamClass.name());
        }

        try {
            List<Item> resultList = new ArrayList<>();

            // Parse class tree recursively
            if (!JandexUtil.DOTNAME_OBJECT.equals(beanParamClass.superName())) {
                resultList
                        .addAll(parseInternal(index.getClassByName(beanParamClass.superName()), index,
                                processedBeanParamClasses));
            }

            resultList.addAll(paramItemsForFieldsAndMethods(beanParamClass, QUERY_PARAM,
                    (annotationValue, fieldInfo) -> new QueryParamItem(fieldInfo.name(), annotationValue,
                            fieldInfo.hasDeclaredAnnotation(ENCODED),
                            new FieldExtractor(null, fieldInfo.name(), fieldInfo.declaringClass().name().toString()),
                            fieldInfo.type()),

View on GitHub (pinned to e1c734241f)

Solutions

  1. Break the cycle in the @BeanParam object graph — remove the self-reference or mutual nesting
  2. Use @Context or a separate resource method parameter instead of nesting the same bean param type
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at independent-projects/resteasy-reactive/client/processor/src/main/java/org/jboss/resteasy/reactive/client/processor/beanparam/BeanParamParser.java:52 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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