Package org.apache.avalon.framework.configuration

Examples of org.apache.avalon.framework.configuration.ConfigurationException


                StringBuffer errorBuffer =
                    new StringBuffer(128)
                        .append("Spool directory is improperly configured.  The specified path ")
                        .append(spoolPathString)
                        .append(" is not a directory.");
                throw new ConfigurationException(errorBuffer.toString());
            }
        } catch (Exception e) {
            getLogger().fatalError(e.getMessage(), e);
            throw e;
        }
View Full Code Here


            m_sqlParameters.put("table", urlParams.get(1));
        case 1:
            m_datasourceName = (String)urlParams.get(0);
            break;
        default:
            throw new ConfigurationException
                ("Malformed destinationURL - " +
                 "Must be of the format \"db://<data-source>[/<table>[/<key>]]\".");
        }

        if (getLogger().isDebugEnabled()) {
            logBuffer =
                new StringBuffer(128)
                        .append("Parsed URL: table = '")
                        .append(m_sqlParameters.get("table"))
                        .append("', key = '")
                        .append(m_sqlParameters.get("key"))
                        .append("'");
            getLogger().debug(logBuffer.toString());
        }
       
        // Get the SQL file location
        m_sqlFileName = configuration.getChild("sqlFile", true).getValue();
        if (!m_sqlFileName.startsWith("file://")) {
            throw new ConfigurationException
                ("Malformed sqlFile - Must be of the format \"file://<filename>\".");
        }

        // Get other sql parameters from the configuration object,
        // if any.
View Full Code Here

                m_bindTo = InetAddress.getByName( bindAddress );
            }
        }
        catch( final UnknownHostException unhe )
        {
            throw new ConfigurationException( "Malformed bind parameter", unhe );
        }

        final String useTLS = configuration.getChild("useTLS").getValue( "" );
        if( useTLS.equals( "TRUE" ) ) m_serverSocketType = "ssl";
View Full Code Here

            }
            catch( final IOException ioe )
            {
                final String message =
                    REZ.getString( "target.nocreate", name, file, ioe.getMessage() );
                throw new ConfigurationException( message, ioe );
            }

            targetSet.put( name, logTarget );
        }
View Full Code Here

            final LogTarget logTarget = (LogTarget)targets.get( target );
            if( null == target )
            {
                final String message = REZ.getString( "unknown-target", target, name );
                throw new ConfigurationException( message );
            }

            final Priority priority = Priority.getPriorityForName( priorityName );
            if( !priority.getName().equals( priorityName ) )
            {
                final String message = REZ.getString( "unknown-priority", priorityName, name );
                throw new ConfigurationException( message );
            }

            if( getLogger().isDebugEnabled() )
            {
                final String message =
View Full Code Here

        throws ConfigurationException
    {
        if( null == m_factoryManager )
        {
            final String message = REZ.getString( "target.error.null-target-factory" );
            throw new ConfigurationException( message );
        }

        final Configuration[] confs = configuration.getChildren();
        for( int i = 0; i < confs.length; i++ )
        {
            final String targetName = confs[ i ].getName();
            final LogTargetFactory logTargetFactory = m_factoryManager.getLogTargetFactory( targetName );
            if( logTargetFactory == null )
            {
                final String message = REZ.getString( "target.error.missing", targetName );
                throw new ConfigurationException( message );
            }
            final LogTarget logTarget = logTargetFactory.createTarget( confs[ i ] );
            final String targetId = confs[ i ].getAttribute( "id" );
            if( getLogger().isDebugEnabled() )
            {
View Full Code Here

            ContainerUtil.contextualize( targetFactoryManager, m_context );
        }
        catch( final ContextException ce )
        {
            final String message = "cannot contextualize default factory manager";
            throw new ConfigurationException( message, ce );
        }
        ContainerUtil.configure( targetFactoryManager, configuration );

        return targetFactoryManager;
    }
View Full Code Here

            ContainerUtil.contextualize( targetManager, m_context );
        }
        catch( final ContextException ce )
        {
            final String message = "cannot contextualize factory manager";
            throw new ConfigurationException( message, ce );
        }

        if( targetManager instanceof LogTargetFactoryManageable )
        {
            targetManager.setLogTargetFactoryManager( targetFactoryManager );
View Full Code Here

                        .newInstance( new Object[]{prefix} );
                }
            }
            catch( Exception e )
            {
                throw new ConfigurationException( "Unable to create new logger manager for class " + className, e );
            }

            // now test for some lifecycle interfaces
            ContainerUtil.enableLogging(m_loggermanager, m_logger );

            try
            {
                ContainerUtil.contextualize( m_loggermanager, m_context );
            }
            catch( ContextException ce )
            {
                throw new ConfigurationException( "Unable to contextualize new logger manager.", ce );
            }

            try
            {
                ContainerUtil.service( m_loggermanager, m_manager );
            }
            catch (ServiceException se )
            {           
                throw new ConfigurationException("Unable to service new logger manager.", se);
            }
           
            if( m_loggermanager instanceof Configurable )
            {
                ( (Configurable)m_loggermanager ).configure( configuration.getChildren()[ 0 ] );
            }
            else if( m_loggermanager instanceof Parameterizable )
            {
                try
                {
                    ( (Parameterizable)m_loggermanager ).parameterize( Parameters.fromConfiguration( configuration.getChildren()[ 0 ] ) );
                }
                catch( ParameterException pe )
                {
                    throw new ConfigurationException( "Unable to parameterize new logger manager.", pe );
                }
            }

            try
            {
                ContainerUtil.initialize( m_loggermanager );
            }
            catch (Exception e )
            {
                throw new ConfigurationException("Unable to initialize new logger manager.");
            }
        }
        else
        {
            // now test for role name
            final String roleName = configuration.getAttribute( "manager-role", null );
            if( null == roleName )
            {
                throw new ConfigurationException( "The LoggerManager needs either a manager-role or a manager-class" );
            }

            try
            {
                m_loggermanager = (LoggerManager)m_manager.lookup( roleName );
                m_disposeManager = true;
            }
            catch( ServiceException e )
            {
                throw new ConfigurationException( "Unable to lookup logger manager with role " + roleName );
            }
        }
    }
View Full Code Here

            }
            catch( final ClassNotFoundException cnfe )
            {
                final String message =
                    REZ.getString( "target-factory.error.find-class", factoryClass );
                throw new ConfigurationException( message, cnfe );
            }
            catch( final InstantiationException ie )
            {
                final String message =
                    REZ.getString( "target-factory.error.instantiate-class", factoryClass );
                throw new ConfigurationException( message, ie );
            }
            catch( final IllegalAccessException iae )
            {
                final String message =
                    REZ.getString( "target-factory.error.access-class", factoryClass );
                throw new ConfigurationException( message, iae );
            }

            ContainerUtil.enableLogging( logTargetFactory, getLogger() );
            try
            {
                ContainerUtil.contextualize( logTargetFactory, m_context );
            }
            catch( final ContextException ce )
            {
                final String message =
                    REZ.getString( "target-factory.error.contextualize", factoryClass );
                throw new ConfigurationException( message, ce );
            }
            ContainerUtil.configure( logTargetFactory, confs[ i ] );

            if( logTargetFactory instanceof LogTargetFactoryManageable )
            {
View Full Code Here

TOP

Related Classes of org.apache.avalon.framework.configuration.ConfigurationException

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.