alibaba/spring-ai-alibaba · error · BizException

APP_COMPONENT_LIST_ERROR

APP_COMPONENT_LIST_ERROR

Error message

Failed to obtain component list.

What it means

AppComponentController.getAppComponentPageList wraps any exception thrown by appComponentService.getAppComponentList into a generic APP_COMPONENT_LIST_ERROR BizException. The controller deliberately discards the original cause, so the client only sees 'Failed to obtain component list.' The real failure (DB error, service wiring, bad query params) must be found in server logs.

Solutions

  1. Check server logs/stack trace for the original exception swallowed by the catch block.
  2. Verify database connectivity and that the component tables exist and are migrated.
  3. Retry the list request; if persistent, reproduce with the same AppComponentQuery parameters.
  4. Improve the code to log e (or chain it) so the cause is visible.

Example fix

// before
catch (Exception e) {
    throw new BizException(ErrorCode.APP_COMPONENT_LIST_ERROR.toError());
}
// after
catch (Exception e) {
    log.error("Failed to obtain component list", e);
    throw new BizException(ErrorCode.APP_COMPONENT_LIST_ERROR.toError());
}
Defensive patterns

Strategy: try-catch

Validate before calling

// validate paging params before calling
if (page == null || page < 1 || pageSize == null || pageSize > 100) throw new IllegalArgumentException('invalid paging');

Try / catch

try {
  const list = await api.getComponentPageList(query);
} catch (e) {
  if (e.code === 'APP_COMPONENT_LIST_ERROR') {
    // fallback: show cached/empty list and log server correlation id
  } else throw e;
}

Prevention

When it happens

Trigger: GET /appComponent page-list request where appComponentService.getAppComponentList(request) throws any Exception (database failure, service bean error, unexpected query state).

Common situations: Database down or connection pool exhausted; schema mismatch after upgrade; query parameters that cause the underlying query to fail.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of alibaba/spring-ai-alibaba@f82da0b50f (2026-09-09). Data as JSON: /api/errors/f4897b6b19c50bdd. Report an issue: GitHub.

Appendix: source

Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/controller/AppComponentController.java:113

	}

	/**
	 * Retrieves a paginated list of application components based on query parameters.
	 * @param request Query parameters for filtering components including: - type:
	 * Component type - name: Component name - appId: Associated application ID - status:
	 * Component status - pageSize: Number of items per page - pageNum: Page number
	 * @return Result containing a PagingList of AppComponent objects
	 */
	@GetMapping()
	public Result<PagingList<AppComponent>> getAppComponentPageList(@ApiModelAttribute AppComponentQuery request) {

		RequestContext context = RequestContextHolder.getRequestContext();
		try {
			PagingList<AppComponent> appComponentList = appComponentService.getAppComponentList(request);
			return Result.success(context.getRequestId(), appComponentList);
		}
		catch (Exception e) {
			throw new BizException(ErrorCode.APP_COMPONENT_LIST_ERROR.toError());
		}
	}

	/**
	 * Retrieves a paginated list of applications that can be published as components.
	 * This endpoint filters out applications that are already published as components.
	 * @param request Query parameters including: - type: Application type - appName:
	 * Application name
	 * @return Result containing a PagingList of Application objects that can be published
	 * as components
	 */
	@GetMapping("/app-publishable")
	public Result<PagingList<Application>> getAppPublishablePageList(@ApiModelAttribute AppComponentQuery request) {
		RequestContext context = RequestContextHolder.getRequestContext();
		if (Objects.isNull(request.getType())) {
			throw new BizException(ErrorCode.MISSING_PARAMS.toError("type"));
		}

View on GitHub (pinned to f82da0b50f)