Package com.oorian
Class DuplicatePagePathException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.oorian.DuplicatePagePathException
- All Implemented Interfaces:
Serializable
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
@PagePathannotation 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 Summary
ConstructorsConstructorDescriptionDuplicatePagePathException(String class1, String class2, String path) Constructs a new DuplicatePagePathException with details about the conflicting classes. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
DuplicatePagePathException
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 pathclass2- the fully qualified name of the second class mapped to the same pathpath- the duplicate URL path causing the conflict
-