我正在尝试开发自己的 IDREPO:
我的用户表如下:
(id,firstName,lastName,password,loginStatus.....)
我的 IDREpo 实现的类具有以下详细信息:
private static final Set<IdType> SUPPORTED_TYPES;
static {
logger.debug("\nMethod - Static Supported Types");
SUPPORTED_TYPES = new HashSet<>();
SUPPORTED_TYPES.add(IdType.USER);
SUPPORTED_TYPES.add(IdType.GROUP);
}
private static final Set<IdOperation> SUPPORTED_OPS;
static {
logger.debug("\nMethod - Static Supported OPS");
SUPPORTED_OPS = new HashSet<>();
// DELETE and SERVICE are the other options
SUPPORTED_OPS.add(IdOperation.READ);
SUPPORTED_OPS.add(IdOperation.CREATE);
SUPPORTED_OPS.add(IdOperation.EDIT);
//SUPPORTED_OPS.add(IdOperation.SERVICE);
}
static {
logger.debug("\nMethod - Static PropertyNameRemapper. Loaded Properties: "
+ dbColumnProperties);
PROP_REMAPPER.setOpenSSOtoJDBC("lastName",
dbColumnProperties.getProperty("user.lastName"));
PROP_REMAPPER.setOpenSSOtoJDBC("id",
dbColumnProperties.getProperty("user.id"));
PROP_REMAPPER.setOpenSSOtoJDBC("password",
dbColumnProperties.getProperty("user.password"));
PROP_REMAPPER.setOpenSSOtoJDBC("firstName",
dbColumnProperties.getProperty("user.firstname"));
}
但是当我调试我的代码时,我得到的异常是:
得到异常:
java.lang.ClassCastException: JDBCIdRepo cannot be cast to com.sun.identity.idm.plugins.database.DaoInterface
at com.sun.identity.idm.plugins.database.DatabaseRepo.initialize(DatabaseRepo.java:275)
at com.sun.identity.idm.server.IdRepoPluginsCache.constructIdRepoPlugin(IdRepoPluginsCache.java:475)
at com.sun.identity.idm.server.IdRepoPluginsCache.addIdRepo(IdRepoPluginsCache.java:353)
at com.sun.identity.idm.server.IdRepoPluginsCache.removeIdRepo(IdRepoPluginsCache.java:251)
at com.sun.identity.idm.server.IdRepoPluginsCache.organizationConfigChanged(IdRepoPluginsCache.java:646)
at com.sun.identity.sm.ServiceConfigManagerImpl.notifyOrgConfigChange(ServiceConfigManagerImpl.java:488)
at com.sun.identity.sm.ServiceConfigManagerImpl.objectChanged(ServiceConfigManagerImpl.java:448)
at com.sun.identity.sm.SMSNotificationManager.sendNotifications(SMSNotificationManager.java:289)
at com.sun.identity.sm.SMSNotificationManager$LocalChangeNotifcationTask.run(SMSNotificationManager.java:365)
at com.iplanet.am.util.ThreadPool$WorkerThread.run(ThreadPool.java:306)