{"record":{"id":"02402b34fcec1d00","repo":"quarkusio/quarkus","slug":"classinfo-name-should-only-extend-rest-data-p","errorCode":null,"errorMessage":"${classInfo.name()} should only extend REST Data Panache interface","messagePattern":"(.+?) should only extend REST Data Panache interface","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/panache/hibernate-orm-rest-data-panache/deployment/src/main/java/io/quarkus/hibernate/orm/rest/data/panache/deployment/HibernateOrmPanacheRestProcessor.java","lineNumber":153,"sourceCode":"            String resourceClass = resourceImplementor.implement(\n                    classOutput, dataAccessImplementor, resourceInterface, entityType, listenersForEntityType);\n            // Make sure that repository bean is not removed and will be injected to the generated resource\n            unremovableBeansProducer.produce(new UnremovableBeanBuildItem(\n                    new UnremovableBeanBuildItem.BeanClassNameExclusion(repositoryClassName)));\n\n            restDataResourceProducer.produce(new RestDataResourceBuildItem(\n                    new ResourceMetadata(resourceClass, resourceInterface, entityType, idType,\n                            getEntityFields(index.getIndex(), entityType))));\n        }\n    }\n\n    private void validateResource(IndexView index, ClassInfo classInfo) {\n        if (!Modifier.isInterface(classInfo.flags())) {\n            throw new RuntimeException(classInfo.name() + \" has to be an interface\");\n        }\n\n        if (classInfo.interfaceNames().size() > 1) {\n            throw new RuntimeException(classInfo.name() + \" should only extend REST Data Panache interface\");\n        }\n\n        if (!index.getKnownDirectImplementors(classInfo.name()).isEmpty()) {\n            throw new RuntimeException(classInfo.name() + \" should not be extended or implemented\");\n        }\n    }\n\n    private List<Type> getGenericTypes(ClassInfo classInfo) {\n        return classInfo.interfaceTypes()\n                .stream()\n                .findFirst()\n                .orElseThrow(() -> new RuntimeException(classInfo.toString() + \" does not have generic types\"))\n                .asParameterizedType()\n                .arguments();\n    }\n}\n","sourceCodeStart":135,"sourceCodeEnd":170,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/panache/hibernate-orm-rest-data-panache/deployment/src/main/java/io/quarkus/hibernate/orm/rest/data/panache/deployment/HibernateOrmPanacheRestProcessor.java#L135-L170","documentation":"validateResource enforces that a REST Data Panache resource interface extends exactly one interface. Extending more than one interface breaks the generic signature extraction, so the build fails with this RuntimeException.","triggerScenarios":"A resource interface extending two or more interfaces, e.g. 'interface PersonResource extends PanacheEntityResource<Person, Long>, Serializable' or extending two Panache resource interfaces.","commonSituations":"Adding Serializable/Comparable to a resource interface; composing several resource interfaces into one.","solutions":["Remove all but the single REST Data Panache interface from the extends clause","Move shared methods to the entity or a separate service, not the resource interface","Split into multiple resource interfaces if two domains are needed"],"exampleFix":"// before\npublic interface PersonResource extends PanacheEntityResource<Person, Long>, Serializable {}\n// after\npublic interface PersonResource extends PanacheEntityResource<Person, Long> {}","handlingStrategy":"validation","validationCode":"if (resourceClass.getInterfaces().length != 1)\n    throw new IllegalStateException(resourceClass + \" must extend exactly one Panache REST Data interface\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Extend exactly one Panache resource interface","Do not add Serializable/Comparable or other marker interfaces to resources","Extract shared code into entities or repositories, not resource supertypes"],"tags":["quarkus","panache","rest-data","build-time","interface"],"backgroundTag":"resource-must-be-interface","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}