Package org.codehaus.plexus.personality.plexus.lifecycle.phase

Examples of org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException


                createProjectScmRootForProjectGroup( group );
            }
        }
        catch ( ContinuumException e )
        {
            throw new InitializationException( "Error while creating project scm root for the project group", e );
        }

        log.info( "Showing all projects: " );

        for ( Project project : projectDao.getAllProjectsByNameWithBuildDetails() )
        {
            for ( ProjectNotifier notifier : (List<ProjectNotifier>) project.getNotifiers() )
            {
                if ( StringUtils.isEmpty( notifier.getType() ) )
                {
                    try
                    {
                        removeNotifier( project.getId(), notifier.getId() );
                    }
                    catch ( ContinuumException e )
                    {
                        throw new InitializationException( "Database is corrupted.", e );
                    }
                }
            }

            if ( project.getState() != ContinuumProjectState.NEW &&
                project.getState() != ContinuumProjectState.CHECKEDOUT &&
                project.getState() != ContinuumProjectState.OK && project.getState() != ContinuumProjectState.FAILED &&
                project.getState() != ContinuumProjectState.ERROR )
            {
                int state = project.getState();

                project.setState( project.getOldState() );

                project.setOldState( 0 );

                try
                {
                    log.info( "Fix project state for project " + project.getId() + ":" + project.getName() + ":" +
                        project.getVersion() );

                    projectDao.updateProject( project );

                    Project p = projectDao.getProject( project.getId() );

                    if ( state == p.getState() )
                    {
                        log.info( "Can't fix the project state." );
                    }
                }
                catch ( ContinuumStoreException e )
                {
                    throw new InitializationException( "Database is corrupted.", e );
                }
            }

            log.info( " " + project.getId() + ":" + project.getName() + ":" + project.getVersion() + ":" +
                project.getExecutorId() );
        }

        for ( ProjectScmRoot projectScmRoot : projectScmRootDao.getAllProjectScmRoots() )
        {
            if ( projectScmRoot.getState() == ContinuumProjectState.UPDATING )
            {
                projectScmRoot.setState( projectScmRoot.getOldState() );

                projectScmRoot.setOldState( 0 );

                try
                {
                    log.info( "Fix state for projectScmRoot " + projectScmRoot.getScmRootAddress() );

                    projectScmRootDao.updateProjectScmRoot( projectScmRoot );
                }
                catch ( ContinuumStoreException e )
                {
                    throw new InitializationException( "Database is corrupted.", e );
                }
            }
        }
    }
View Full Code Here


        {
            initializeDefaultContinuumBuildDefintions();
        }
        catch ( BuildDefinitionServiceException e )
        {
            throw new InitializationException( e.getMessage(), e );
        }
    }
View Full Code Here

                createProjectScmRootForProjectGroup( group );
            }
        }
        catch ( ContinuumException e )
        {
            throw new InitializationException( "Error while creating project scm root for the project group", e );
        }

        log.info( "Showing all projects: " );

        for ( Project project : projectDao.getAllProjectsByNameWithBuildDetails() )
        {
            for ( ProjectNotifier notifier : (List<ProjectNotifier>) project.getNotifiers() )
            {
                if ( StringUtils.isEmpty( notifier.getType() ) )
                {
                    try
                    {
                        removeNotifier( project.getId(), notifier.getId() );
                    }
                    catch ( ContinuumException e )
                    {
                        throw new InitializationException( "Database is corrupted.", e );
                    }
                }
            }

            if ( project.getState() != ContinuumProjectState.NEW &&
                project.getState() != ContinuumProjectState.CHECKEDOUT &&
                project.getState() != ContinuumProjectState.OK && project.getState() != ContinuumProjectState.FAILED &&
                project.getState() != ContinuumProjectState.ERROR )
            {
                int state = project.getState();

                project.setState( project.getOldState() );

                project.setOldState( 0 );

                try
                {
                    log.info( "Fix project state for project " + project.getId() + ":" + project.getName() + ":" +
                        project.getVersion() );

                    projectDao.updateProject( project );

                    Project p = projectDao.getProject( project.getId() );

                    if ( state == p.getState() )
                    {
                        log.info( "Can't fix the project state." );
                    }
                }
                catch ( ContinuumStoreException e )
                {
                    throw new InitializationException( "Database is corrupted.", e );
                }
            }

            log.info( " " + project.getId() + ":" + project.getName() + ":" + project.getVersion() + ":" +
                project.getExecutorId() );
        }

        for ( ProjectScmRoot projectScmRoot : projectScmRootDao.getAllProjectScmRoots() )
        {
            if ( projectScmRoot.getState() == ContinuumProjectState.UPDATING )
            {
                projectScmRoot.setState( projectScmRoot.getOldState() );

                projectScmRoot.setOldState( 0 );

                try
                {
                    log.info( "Fix state for projectScmRoot " + projectScmRoot.getScmRootAddress() );

                    projectScmRootDao.updateProjectScmRoot( projectScmRoot );
                }
                catch ( ContinuumStoreException e )
                {
                    throw new InitializationException( "Database is corrupted.", e );
                }
            }
        }
    }
View Full Code Here

                        // do not throw exception, just log it
                        log.info( "Invalid build agent URL " + agent.getUrl() + ", not creating task queue executor" );
                    }
                    catch ( ContinuumException e )
                    {
                        throw new InitializationException(
                            "Error while initializing distributed build task queue executors", e );
                    }
                    catch ( Exception e )
                    {
                        agent.setEnabled( false );
View Full Code Here

            resolveParameters( settings );
        }
        catch ( Exception e )
        {
            throw new InitializationException( "Can't initialize '" + getClass().getName() + "'", e );
        }
    }
View Full Code Here

        {
            settingsRepository = SettingsUtil.getOrPopulateSettingsRepository( repositoryRegistry );
        }
        catch ( SettingsException e )
        {
            throw new InitializationException( "NPANDAY-102-007: Could not get settings." , e);
        }

        VendorInfoTransitionRuleFactory factory = new VendorInfoTransitionRuleFactory();

        try
        {
            factory.init( repositoryRegistry, vendorInfoRepository, logger );
        }
        catch ( npanday.InitializationException e )
        {
            throw new InitializationException( "NPANDAY-102-008: Initializing rule factory failed." , e);
        }

        transitionRules = new HashMap<VendorInfoState, VendorInfoTransitionRule>();
        transitionRules.put( VendorInfoState.MTT, factory.createVendorInfoSetterForMTT() );
        transitionRules.put( VendorInfoState.MTF, factory.createVendorInfoSetterForMTF() );
View Full Code Here

            resolveParameters( settings );
        }
        catch ( Exception e )
        {
            throw new InitializationException( "Can't initialize '" + getClass().getName() + "'", e );
        }
    }
View Full Code Here

        {
            loadFromResource( "/META-INF/npanday/registry-config.xml", this.getClass() );
        }
        catch ( IOException e )
        {
            throw new InitializationException( "NPANDAY-082-000: Message = ", e );
        }
        catch ( NPandayRepositoryException e )
        {
            throw new InitializationException( "NPANDAY-082-010: Message = ", e );
        }
    }
View Full Code Here

        if ( wdFile.exists() )
        {
            if ( !wdFile.isDirectory() )
            {
                throw new InitializationException(
                    "The specified working directory isn't a directory: " + "'" + wdFile.getAbsolutePath() + "'." );
            }
        }
        else
        {
            if ( !wdFile.mkdirs() )
            {
                throw new InitializationException(
                    "Could not making the working directory: " + "'" + wdFile.getAbsolutePath() + "'." );
            }
        }

        log.info( "Showing all groups:" );
        try
        {
            for ( ProjectGroup group : projectGroupDao.getAllProjectGroups() )
            {
                createProjectScmRootForProjectGroup( group );
            }
        }
        catch ( ContinuumException e )
        {
            throw new InitializationException( "Error while creating project scm root for the project group", e );
        }

        log.info( "Showing all projects: " );

        for ( Project project : projectDao.getAllProjectsByNameWithBuildDetails() )
        {
            for ( ProjectNotifier notifier : (List<ProjectNotifier>) project.getNotifiers() )
            {
                if ( StringUtils.isEmpty( notifier.getType() ) )
                {
                    try
                    {
                        removeNotifier( project.getId(), notifier.getId() );
                    }
                    catch ( ContinuumException e )
                    {
                        throw new InitializationException( "Database is corrupted.", e );
                    }
                }
            }

            if ( project.getState() != ContinuumProjectState.NEW &&
                project.getState() != ContinuumProjectState.CHECKEDOUT &&
                project.getState() != ContinuumProjectState.OK && project.getState() != ContinuumProjectState.FAILED &&
                project.getState() != ContinuumProjectState.ERROR )
            {
                int state = project.getState();

                project.setState( project.getOldState() );

                project.setOldState( 0 );

                try
                {
                    log.info( "Fix project state for project " + project.getId() + ":" + project.getName() + ":" +
                        project.getVersion() );

                    projectDao.updateProject( project );

                    Project p = projectDao.getProject( project.getId() );

                    if ( state == p.getState() )
                    {
                        log.info( "Can't fix the project state." );
                    }
                }
                catch ( ContinuumStoreException e )
                {
                    throw new InitializationException( "Database is corrupted.", e );
                }
            }

            log.info( " " + project.getId() + ":" + project.getName() + ":" + project.getVersion() + ":" +
                project.getExecutorId() );
        }

        for ( ProjectScmRoot projectScmRoot : projectScmRootDao.getAllProjectScmRoots() )
        {
            if ( projectScmRoot.getState() == ContinuumProjectState.UPDATING )
            {
                projectScmRoot.setState( projectScmRoot.getOldState() );

                projectScmRoot.setOldState( 0 );

                try
                {
                    log.info( "Fix state for projectScmRoot " + projectScmRoot.getScmRootAddress() );

                    projectScmRootDao.updateProjectScmRoot( projectScmRoot );
                }
                catch ( ContinuumStoreException e )
                {
                    throw new InitializationException( "Database is corrupted.", e );
                }
            }
        }
    }
View Full Code Here

  public void initialize() throws InitializationException {
    try {
      this.scheduler.submit(getAction(), this);
    } catch (Exception e) {
      throw new InitializationException(
          "Couldn't calculate artifact usage while initializing server",
          e);
    }
  }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.personality.plexus.lifecycle.phase.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.