I would like to retrieve some information from the UME and get the following exception: com.sap.security.api.UMRuntimeException: UME factory 'com.sap.security.api.IUserFactory' cannot be accessed because UME initialization has not started yet. Please check UMFactory.isInitialized() before using UME functionality.
How do I initialize the UME?
Are there any code nippets?
please check <a href="https://help.sap.com/javadocs/NW04/current/um/com/sap/security/api/UMFactory.html">THIS</a> to know more about UMFactory and different ways how it can initialised.
But - UMFactory initialization is required explicitly only when you are using it standalone. Normally portal runtime should initialize it automatically. If you are using the UMFactory inside portal I guess you should check whether the UMFatory related services are getting started properly or not instead of coding something to initialize it.