public static CaptchaInfoBean generateCaptchaImage() throws Exception {
String randomSecretKey = UUID.randomUUID().toString(); //random string for the captcha.
String imagePath = StratosConstants.CAPTCHA_IMAGES_PATH + RegistryConstants.PATH_SEPARATOR +
randomSecretKey + ".jpg";
Config config = new Config(new Properties());
Producer captchaProducer = config.getProducerImpl();
String captchaText = captchaProducer.createText();
BufferedImage image = captchaProducer.createImage(captchaText);
File tempFile = File.createTempFile("temp-", ".jpg");