Package org.apache.turbine.services

Examples of org.apache.turbine.services.InitializationException


                    }
                }
            }
            catch(Exception e)
            {
                throw new InitializationException("Failed to load " + log4jProperties + " - " + e.toString());
            }
        }
        setInit(true);
        initDone = true;
    } // init
View Full Code Here


        if (!(data instanceof JetspeedRunData))
        {
            logger.error(
                "[PortalPersistenceService] The current RunData implenetation does not implement the JetspeedRunData interface.");
            setInit(false);
            throw new InitializationException("The current RunData implenetation does not implement the JetspeedRunData interface.");              
        }
       
        ResourceService config = ((TurbineServices)TurbineServices.getInstance())
                                            .getResources(PortalPersistenceService.SERVICE_NAME);
       
View Full Code Here

            }
            catch (Exception e)
            {
                String msg = "ForwardService: Error in castor mapping creation";
                logger.error(msg, e);
                throw new InitializationException(msg, e);
            }
        }
        else
        {
            String msg = "ForwardService: Mapping not found or not a file or unreadable: " + this.mapping;
            logger.error(msg);
            throw new InitializationException(msg);
        }


        try
        {
       
            File directory = new File(this.directory);
            File[] files = directory.listFiles();
            for (int ix=0; ix < files.length; ix++)
            {
                if (files[ix].isDirectory())
                {
                    continue;
                }

                loadForwardConfiguration(files[ix]);
            }

        }
        catch (Exception e)
        {
            String msg = "ForwardService: Fatal error loading Forward configurations";
            logger.error(msg, e);
            throw new InitializationException(msg, e);
        }

    }
View Full Code Here

    private void internalInit() throws InitializationException
    {
        ResourceService props = getResources();
        if (props == null)
        {
            throw new InitializationException("LoggingService failed to "
                                              + "get access to the properties for this service.");
        }

        //looking for default logger name
        String defaultLoggerName = props.getString(LoggingConfig.DEFAULT);

        //checking whether default logger is properly configured
        if (defaultLoggerName == null)
        {
            throw new InitializationException("LoggingService can't find "
                                              + "default logger name in the configuration file.");
        }

        // Create default logger
        loggers.put(defaultLoggerName, defaultLogger);

        //checking whether default logger is properly configured
        if (defaultLogger == null)
        {
            throw new InitializationException("LoggingService can't find "
                                              + "default logger in working loggers.");
        }
    }
View Full Code Here

                logger.info("Created Lucene Index in " + rootDir.getPath());
            }
            catch (Exception e1)
            {
                logger.error(this.getClass().getName() + ".initConfiguration - Getting or creating IndexSearcher", e);
                throw new InitializationException("Getting or creating Index Searcher");
            }
        }

        //Mark that we are done
        setInit(true);
View Full Code Here

            serviceURL = new URL(soapEndPoint);
            locator = new QuoteServiceServiceLocator();           
        }
        catch (MalformedURLException e)
        {
            throw new InitializationException("Failed to locate Quote Service: " + soapEndPoint, e);
        }       
    }
View Full Code Here

            mapFile = TurbineServlet.getRealPath(mapFile);
            directory = TurbineServlet.getRealPath(directory);
        }
        catch (Throwable t)
        {
            throw new InitializationException("Unable to initialize LateInitCastorRegistryService, missing config keys");
        }

        // build the map of default fragments, eahc registry must be associated
        // with at least one fragment
        try
        {
            Iterator i = getConfiguration().getKeys("default");
            while (i.hasNext())
            {
                String key = (String) i.next();
                String name = key.substring(key.indexOf(".") + 1);
                String fragmentFileName = getConfiguration().getString(key);
                String absFileName = new File(directory, fragmentFileName + extension).getCanonicalPath();
                // add this name in the list of available registries
                names.add(name);

                // store the default file mapping
                this.defaults.put(name, absFileName);
            }
        }
        catch (Exception e)
        {
            logger.error("RegistryService: Registry init error", e);
            throw new InitializationException("Unable to initialize LateInitCastorRegistryService, invalid registries definition");
        }

        // create the serializer output format
        this.format = new OutputFormat();
        format.setIndenting(true);
        format.setIndent(4);
        format.setLineWidth(0);

        // test the mapping file and create the mapping object

        if (mapFile != null)
        {
            File map = new File(mapFile);
            if (map.exists() && map.isFile() && map.canRead())
            {
                try
                {
                    mapping = new SynchronizedMapping();
                    InputSource is = new InputSource(new FileReader(map));
                    is.setSystemId(mapFile);
                    mapping.loadMapping(is);
                }
                catch (Exception e)
                {
                    logger.error("RegistryService: Error in mapping creation", e);
                    throw new InitializationException("Error in mapping", e);
                }
            }
            else
            {
                throw new InitializationException("Mapping not found or not a file or unreadable: " + mapFile);
            }
        }

        // Set directory watcher if directory exists
        File base = new File(directory);
View Full Code Here

            mapFile = TurbineServlet.getRealPath(mapFile);
            directory = TurbineServlet.getRealPath(directory);
        }
        catch (Throwable t)
        {
            throw new InitializationException("Unable to initialize CastorRegistryService, missing config keys");
        }

        // build the map of default fragments, eahc registry must be associated
        // with at least one fragment
        try
        {
            Iterator i = getConfiguration().getKeys("default");
            while (i.hasNext())
            {
                String key = (String) i.next();
                String name = key.substring(key.indexOf(".") + 1);
                String fragmentFileName = getConfiguration().getString(key);
                String absFileName = new File(directory, fragmentFileName + extension).getCanonicalPath();
                // add this name in the list of available registries
                names.add(name);

                // store the default file mapping
                this.defaults.put(name, absFileName);
            }
        }
        catch (Exception e)
        {
            logger.error("RegistryService: Registry init error", e);
            throw new InitializationException("Unable to initialize CastorRegistryService, invalid registries definition");
        }

        // create the serializer output format
        this.format = new OutputFormat();
        format.setIndenting(true);
        format.setIndent(4);
        format.setLineWidth(0);

        // test the mapping file and create the mapping object

        if (mapFile != null)
        {
            File map = new File(mapFile);
            if (map.exists() && map.isFile() && map.canRead())
            {
                try
                {
                    mapping = new SynchronizedMapping();
                    InputSource is = new InputSource(new FileReader(map));
                    is.setSystemId(mapFile);
                    mapping.loadMapping(is);
                }
                catch (Exception e)
                {
                    logger.error("RegistryService: Error in mapping creation", e);
                    throw new InitializationException("Error in mapping", e);
                }
            }
            else
            {
                throw new InitializationException("Mapping not found or not a file or unreadable: " + mapFile);
            }
        }

        // Set directory watcher if directory exists
        File base = new File(directory);
View Full Code Here

                    mapping.loadMapping( is );
                }
                catch (Exception e)
                {
                    logger.error("PSMLManager: Error in psml mapping creation", e);
                    throw new InitializationException("Error in mapping",e);
                }
            }
            else
            {
                throw new InitializationException("PSML Mapping not found or not a file or unreadable: "+mapFile);
            }
        }
    }
View Full Code Here

            loadMapping();
        }
        catch (Throwable t)
        {
            logger.error(this + ".init:" , t);
            throw new InitializationException("Exception initializing DatabasePsmlManagerService" + t);
        }

        if (cachingOn)
        {
            this.refresher = new CacheRefresher();
View Full Code Here

TOP

Related Classes of org.apache.turbine.services.InitializationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.