apereo/cas · error · InvalidTicketException

Invalid ticket type [blank] specified

Error message

Invalid ticket type [blank] specified

What it means

deserializeTicket(content, type) was called with a blank/null ticket type string; the manager cannot load a serializer or resolve the ticket class without it, so InvalidTicketException is thrown immediately as an input guard. The input at fault is the 'type' parameter, which must be a fully-qualified ticket class name (e.g., org.apereo.cas.ticket.TicketGrantingTicketImpl).

Solutions

  1. Pass the correct fully-qualified ticket class name as the type argument
  2. Check that the stored serialization record includes the ticket type metadata
  3. Trace the caller that lost the type information before deserialization
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/serialization/DefaultTicketStringSerializationManager.java:33 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apereo/cas@e7288fc434 (2026-09-08). Data as JSON: /api/errors/89a2b2f097640624. Report an issue: GitHub.

Appendix: source

Thrown at core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/serialization/DefaultTicketStringSerializationManager.java:33

 * @author Misagh Moayyed
 * @since 6.1.0
 */
@RequiredArgsConstructor
@Slf4j
public class DefaultTicketStringSerializationManager implements TicketSerializationManager {
    private final TicketSerializationExecutionPlan ticketSerializationExecutionPlan;

    @Override
    public String serializeTicket(final Ticket ticket) {
        val serializer = Objects.requireNonNull(ticketSerializationExecutionPlan.getTicketSerializer(ticket),
            () -> "Unable to find ticket serializer for " + ticket.getId());
        return serializer.toString(ticket);
    }

    @Override
    public Ticket deserializeTicket(final String ticketContent, final String type) {
        if (StringUtils.isBlank(type)) {
            throw new InvalidTicketException("Invalid ticket type [blank] specified");
        }
        val serializer = ticketSerializationExecutionPlan.getTicketSerializer(type);
        if (serializer == null) {
            throw new IllegalArgumentException("Unable to find ticket deserializer for " + type);
        }
        return Unchecked.supplier(() -> {
            val clazz = Class.forName(type);
            return deserializeTicket(ticketContent, (Class) clazz);
        }).get();
    }

    @Override
    public <T extends Ticket> T deserializeTicket(final String ticketContent, final Class<T> clazz) {
        val serializer = Objects.requireNonNull(ticketSerializationExecutionPlan.getTicketSerializer(clazz),
            () -> "Unable to find ticket deserializer for " + clazz.getSimpleName());
        LOGGER.trace("Unmarshalling ticket content from [{}]", ticketContent);
        val ticket = serializer.from(ticketContent);
        if (ticket == null) {

View on GitHub (pinned to e7288fc434)