Package com.oorian

Class DuplicatePagePathException

All Implemented Interfaces:
Serializable

public class DuplicatePagePathException extends RuntimeException
Unchecked exception thrown when two page classes are mapped to the same URL path.

This exception indicates a configuration error in the Oorian application where multiple page classes attempt to register the same URL path. Each page path must be unique within an application. This is typically detected during application startup when the page registry is being built.

Common Causes:

  • Two page classes using the same @PagePath annotation value
  • Copy-paste errors when creating new page classes
  • Refactoring that leaves duplicate path configurations
  • Conflicting page registrations in different modules

Resolution: Ensure that each page class has a unique URL path. Check all @PagePath annotations and page registration code to eliminate duplicates.

Usage:


 // During page registration:
 if (pageRegistry.containsPath(path)) {
     String existingClass = pageRegistry.getClassForPath(path);
     throw new DuplicatePagePathException(
         existingClass,
         newPageClass.getName(),
         path
     );
 }

 // Exception message format:
 // "com.example.HomePage and com.example.IndexPage are both mapped to the same path: /"
 
Since:
2021
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • DuplicatePagePathException

      public DuplicatePagePathException(String class1, String class2, String path)
      Constructs a new DuplicatePagePathException with details about the conflicting classes.

      The exception message is formatted to clearly identify both classes that are attempting to use the same path, making it easy to locate and fix the configuration error.

      Parameters:
      class1 - the fully qualified name of the first class mapped to the path
      class2 - the fully qualified name of the second class mapped to the same path
      path - the duplicate URL path causing the conflict