title: Zend\ServiceManager\Exception\ServiceNotCreatedException in Zend php
body: <p>I have a web tool and it's running on the server but i got a bug so i tried to have a local copy of it to debug.
  the problem is that when i tried to run the tool locally it works fine but some functions are not.</p>
  
  <p>when i click an add button to be redirected on the form, this is the function call</p>
  
  <pre><code> public function addAction()
  {
      $pdpFormId = $this-&gt;params()-&gt;fromRoute('id', null);
      $category = $this-&gt;params()-&gt;fromRoute('category', self::CATEGORY70);
  
      if (empty($pdpFormId)) {
          return $this-&gt;redirect()-&gt;toRoute('pdp');
      }
  
      $form = $this-&gt;getObjectiveForm();
      $form-&gt;get('fsPdpObjective')-&gt;get('pdp_form_id')-&gt;setValue($pdpFormId);
      $form-&gt;get('fsPdpObjective')-&gt;get('category')-&gt;setValue($category);
      $form-&gt;get('cancel')-&gt;setAttribute('formaction', $this-&gt;url()-&gt;fromRoute('pdp'));
  
      $request = $this-&gt;getRequest();
      if ($request-&gt;isPost()) {
          $objective = new Objective();
          $form-&gt;setData($request-&gt;getPost());
  
          if ($form-&gt;isValid()) {
              $data = $form-&gt;getData();
              $objective-&gt;exchangeArray($data["fsPdpObjective"]);
  
              $objectiveTable = $this-&gt;getObjectiveTable();
              $objectiveTable-&gt;saveObjective($objective);
  
              return $this-&gt;redirect()-&gt;toRoute('pdp');
          }
      }
  </code></pre>
  
  <p>when it tried to call this function:</p>
  
  <pre><code>public function getObjectiveForm()
  {
      if (!$this-&gt;objectiveForm) {
          $this-&gt;setObjectiveForm($this-&gt;getServiceLocator()-&gt;get('PdpObjectiveForm'));
      }
      return $this-&gt;objectiveForm;
  }
  </code></pre>
  
  <p><strong>Updated I include the whole stack trace and exceptions</strong>
  it returns this error</p>
  
  <blockquote>
    <p></p>
  </blockquote>
  
  <pre><code>#0 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\ServiceManager.php(985): Zend\ServiceManager\ServiceManager-&gt;createServiceViaCallback(Object(Closure), 'pdpobjectivefor...', 'PdpObjectiveFor...')
  #1 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\ServiceManager.php(598): Zend\ServiceManager\ServiceManager-&gt;createFromFactory('pdpobjectivefor...', 'PdpObjectiveFor...')
  #2 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\ServiceManager.php(557): Zend\ServiceManager\ServiceManager-&gt;doCreate('PdpObjectiveFor...', 'pdpobjectivefor...')
  #3 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\ServiceManager.php(481): Zend\ServiceManager\ServiceManager-&gt;create(Array)
  #4 C:\Xampp\htdocs\atp\module\Pdp\src\Pdp\Controller\PdpController.php(259): Zend\ServiceManager\ServiceManager-&gt;get('PdpObjectiveFor...')
  #5 C:\Xampp\htdocs\atp\module\Pdp\src\Pdp\Controller\PdpController.php(132): Pdp\Controller\PdpController-&gt;getObjectiveForm()
  #6 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\Mvc\Controller\AbstractActionController.php(83): Pdp\Controller\PdpController-&gt;addAction()
  #7 [internal function]: Zend\Mvc\Controller\AbstractActionController-&gt;onDispatch(Object(Zend\Mvc\MvcEvent))
  #8 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\EventManager\EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
  #9 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\EventManager\EventManager.php(207): Zend\EventManager\EventManager-&gt;triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
  #10 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\Mvc\Controller\AbstractController.php(117): Zend\EventManager\EventManager-&gt;trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
  #11 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\Mvc\DispatchListener.php(114): Zend\Mvc\Controller\AbstractController-&gt;dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
  #12 [internal function]: Zend\Mvc\DispatchListener-&gt;onDispatch(Object(Zend\Mvc\MvcEvent))
  #13 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\EventManager\EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
  #14 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\EventManager\EventManager.php(207): Zend\EventManager\EventManager-&gt;triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
  #15 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\Mvc\Application.php(309): Zend\EventManager\EventManager-&gt;trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
  #16 C:\Xampp\htdocs\atp\public\index.php(15): Zend\Mvc\Application-&gt;run()
  #17 {main}
  </code></pre>
  
  <p>Previous exceptions:</p>
  
  <pre><code>Zend\I18n\Exception\ExtensionNotLoadedException
  
  File:
  
      C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\I18n\Validator\Float.php:49
  
  Message:
  
      Zend\I18n\Validator component requires the intl PHP extension
  
  Stack trace:
  
      #0 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\AbstractPluginManager.php(170): Zend\I18n\Validator\Float-&gt;__construct()
      #1 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\ServiceManager.php(602): Zend\ServiceManager\AbstractPluginManager-&gt;createFromInvokable('float', 'Float')
      #2 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\ServiceManager.php(557): Zend\ServiceManager\ServiceManager-&gt;doCreate('Float', 'float')
      #3 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\ServiceManager.php(481): Zend\ServiceManager\ServiceManager-&gt;create(Array)
      #4 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\AbstractPluginManager.php(103): Zend\ServiceManager\ServiceManager-&gt;get('Float', true)
      #5 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\Validator\ValidatorChain.php(82): Zend\ServiceManager\AbstractPluginManager-&gt;get('Float', Array)
      #6 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\Validator\ValidatorChain.php(149): Zend\Validator\ValidatorChain-&gt;plugin('Float', Array)
      #7 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\InputFilter\Factory.php(374): Zend\Validator\ValidatorChain-&gt;attachByName('Float', Array, false)
      #8 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\InputFilter\Factory.php(244): Zend\InputFilter\Factory-&gt;populateValidators(Object(Zend\Validator\ValidatorChain), Array)
      #9 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\InputFilter\InputFilter.php(61): Zend\InputFilter\Factory-&gt;createInput(Array)
      #10 C:\Xampp\htdocs\atp\module\Pdp\src\Pdp\Form\ObjectiveFilter.php(41): Zend\InputFilter\InputFilter-&gt;add(Array)
      #11 C:\Xampp\htdocs\atp\module\Pdp\Module.php(48): Pdp\Form\ObjectiveFilter-&gt;__construct()
      #12 [internal function]: Pdp\Module-&gt;Pdp\{closure}(Object(Zend\ServiceManager\ServiceManager), 'pdpobjectivefor...', 'PdpObjectiveFor...')
      #13 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\ServiceManager.php(853): call_user_func(Object(Closure), Object(Zend\ServiceManager\ServiceManager), 'pdpobjectivefor...', 'PdpObjectiveFor...')
      #14 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\ServiceManager.php(985): Zend\ServiceManager\ServiceManager-&gt;createServiceViaCallback(Object(Closure), 'pdpobjectivefor...', 'PdpObjectiveFor...')
      #15 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\ServiceManager.php(598): Zend\ServiceManager\ServiceManager-&gt;createFromFactory('pdpobjectivefor...', 'PdpObjectiveFor...')
      #16 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\ServiceManager.php(557): Zend\ServiceManager\ServiceManager-&gt;doCreate('PdpObjectiveFor...', 'pdpobjectivefor...')
      #17 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\ServiceManager\ServiceManager.php(481): Zend\ServiceManager\ServiceManager-&gt;create(Array)
      #18 C:\Xampp\htdocs\atp\module\Pdp\src\Pdp\Controller\PdpController.php(259): Zend\ServiceManager\ServiceManager-&gt;get('PdpObjectiveFor...')
      #19 C:\Xampp\htdocs\atp\module\Pdp\src\Pdp\Controller\PdpController.php(132): Pdp\Controller\PdpController-&gt;getObjectiveForm()
      #20 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\Mvc\Controller\AbstractActionController.php(83): Pdp\Controller\PdpController-&gt;addAction()
      #21 [internal function]: Zend\Mvc\Controller\AbstractActionController-&gt;onDispatch(Object(Zend\Mvc\MvcEvent))
      #22 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\EventManager\EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
      #23 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\EventManager\EventManager.php(207): Zend\EventManager\EventManager-&gt;triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
      #24 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\Mvc\Controller\AbstractController.php(117): Zend\EventManager\EventManager-&gt;trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
      #25 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\Mvc\DispatchListener.php(114): Zend\Mvc\Controller\AbstractController-&gt;dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
      #26 [internal function]: Zend\Mvc\DispatchListener-&gt;onDispatch(Object(Zend\Mvc\MvcEvent))
      #27 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\EventManager\EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
      #28 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\EventManager\EventManager.php(207): Zend\EventManager\EventManager-&gt;triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
      #29 C:\Xampp\htdocs\atp\vendor\ZF2\library\Zend\Mvc\Application.php(309): Zend\EventManager\EventManager-&gt;trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
      #30 C:\Xampp\htdocs\atp\public\index.php(15): Zend\Mvc\Application-&gt;run()
      #31 {main}
  </code></pre>
  
  <p>here is the objectiveform</p>
  
  <pre><code>class Objective extends Form
  {
      public function __construct()
      {
          parent::__construct('pdpObjective');
  
          $this-&gt;setName('pdpObjectiveForm');
          $this-&gt;setAttribute('method', 'post');
  
          $this-&gt;add(array(
              'name' =&gt; 'fsPdpObjective',
              'type' =&gt; 'Zend\Form\Fieldset',
              'options' =&gt; array(
                  'legend' =&gt; 'PDP Objective Details'
              ),
              'elements' =&gt; array(
                  // ID
                  array(
                      'spec' =&gt; array(
                          'type' =&gt; 'Zend\Form\Element\Hidden',
                          'name' =&gt; 'id',
                      ),
                  ),
                  array(
                      'spec' =&gt; array(
                          'type' =&gt; 'Zend\Form\Element\Hidden',
                          'name' =&gt; 'pdp_form_id',
                      ),
                  ),
                  // Category
                  array(
                      'spec' =&gt; array(
                          'type' =&gt; 'Zend\Form\Element\Select',
                          'name' =&gt; 'category',
                          'options' =&gt; array(
                              'label' =&gt; 'Category',
                              'value_options' =&gt; array(
                                  '1' =&gt; '70 - On The Job Training',
                                  '2' =&gt; '20 - Coaching/Mentoring',
                                  '3' =&gt; '10 - Formal Training'
                              ),
                          ),
                      ),
                  ),
                  // Development Activity
                  array(
                      'spec' =&gt; array(
                          'type' =&gt; 'Zend\Form\Element\Text',
                          'name' =&gt; 'activity',
                          'options' =&gt; array(
                              'label' =&gt; 'Development Activity'
                          ),
                      ),
                  ),
                  // Description
                  array(
                      'spec' =&gt; array(
                          'type' =&gt; 'Zend\Form\Element\Textarea',
                          'name' =&gt; 'description',
                          'options' =&gt; array(
                              'label' =&gt; 'Description'
                          ),
                      ),
                  ),
                  // Estimated Cost
                  array(
                      'spec' =&gt; array(
                          'type' =&gt; 'Zend\Form\Element\Text',
                          'name' =&gt; 'cost',
                          'options' =&gt; array(
                              'label' =&gt; 'Estimated Cost'
                          ),
                      ),
                  ),
                  // Start Date
                  array(
                      'spec' =&gt; array(
                          'type' =&gt; 'Zend\Form\Element\Text',
                          'name' =&gt; 'start',
                          'options' =&gt; array(
                              'label' =&gt; 'Start Date',
                              'readonly' =&gt; true,
                              'hint' =&gt; '(yyyy-mm-dd)',
                          ),
                      ),
                  ),
                  // Due Date
                  array(
                      'spec' =&gt; array(
                          'type' =&gt; 'Zend\Form\Element\Text',
                          'name' =&gt; 'due',
                          'options' =&gt; array(
                              'label' =&gt; 'Due Date',
                              'hint' =&gt; '(yyyy-mm-dd)',
                          ),
                      ),
                  ),
                  // Priority
                  array(
                      'spec' =&gt; array(
                          'type' =&gt; 'Zend\Form\Element\Select',
                          'name' =&gt; 'priority',
                          'options' =&gt; array(
                              'label' =&gt; 'Priority',
                              'value_options' =&gt; array(
                                  '1' =&gt; 'Critical (in present position)',
                                  '2' =&gt; 'Important for the Growth (in present position)',
                                  '3' =&gt; 'Helpful for Career Growth (3-5 years)'),
                          ),
                      ),
                  ),
                  // Status
                  array(
                      'spec' =&gt; array(
                          'type' =&gt; 'Zend\Form\Element\Select',
                          'name' =&gt; 'status',
                          'options' =&gt; array(
                              'label' =&gt; 'Status',
                              'value_options' =&gt; array(
                                  '1' =&gt; 'Not Started',
                                  '2' =&gt; 'Ongoing',
                                  '3' =&gt; 'Completed',
                                  '4' =&gt; 'No Longer Applicable'
                              ),
                          ),
                      ),
                  ),
              ),
          ));
  
          $this-&gt;add(array(
              'type' =&gt; 'Zend\Form\Element\Csrf',
              'name' =&gt; 'csrf'
          ));
  
          $this-&gt;add(array(
              'type' =&gt; 'Zend\Form\Element\Submit',
              'name' =&gt; 'submit',
              'attributes' =&gt; array(
                  'value' =&gt; 'Save Changes',
                  'class' =&gt; 'btn-primary btn-large',
              ),
          ));
  
          $this-&gt;add(array(
              'type' =&gt; 'Zend\Form\Element\Submit',
              'name' =&gt; 'cancel',
              'attributes' =&gt; array(
                  'value' =&gt; 'Cancel'
              ),
          ));
      }
  }
  </code></pre>
  
  <p>Hope somebody can help me. thanks in advance!</p>
  
  <p><strong>UPDATED</strong></p>
  
  <p>here is the whole module.config of pdp module</p>
  
  <pre><code>class Module implements AutoloaderProviderInterface, ServiceProviderInterface
  {
      public function getAutoloaderConfig()
      {
          return array(
              'Zend\Loader\ClassMapAutoloader' =&gt; array(
                  __DIR__ . '/autoload_classmap.php',
              ),
              'Zend\Loader\StandardAutoloader' =&gt; array(
                  'namespaces' =&gt; array(
              // if we're in a namespace deeper than one level we need to fix the \ in the path
                      __NAMESPACE__ =&gt; __DIR__ . '/src/' . str_replace('\\', '/' , __NAMESPACE__),
                  ),
              ),
          );
      }
  
      public function getConfig()
      {
          return include __DIR__ . '/config/module.config.php';
      }
  
      /* (non-PHPdoc)
       * @see \Zend\ModuleManager\Feature\ServiceProviderInterface::getServiceConfig()
       */
      public function getServiceConfig()
      {
          return array(
              'factories' =&gt; array(
                  'PdpObjectiveForm' =&gt; function($sm) {
                      $form = new Form\Objective();
                      $form-&gt;setInputFilter(new Form\ObjectiveFilter());
                      return $form;
                  },
  
                  'Pdp\Model\PdpTable' =&gt; function ($sm) {
                      $tableGateway = $sm-&gt;get('PdpTableGateway');
                      $table = new \Pdp\Model\PdpTable($tableGateway);
                      return $table;
                  },
  
                  'PdpTableGateway' =&gt; function($sm) {
                      $dbAdapter = $sm-&gt;get('Zend\Db\Adapter\Adapter');
                      $resultSetPrototype = new ResultSet();
                      $resultSetPrototype-&gt;setArrayObjectPrototype(new \Pdp\Entity\Pdp());
                      return new TableGateway('pdp_form', $dbAdapter, null, $resultSetPrototype);
                  },
  
                  'Pdp\Model\ObjectiveTable' =&gt; function($sm) {
                      $tableGateway = $sm-&gt;get('PdpObjectiveTableGateway');
                      $table = new \Pdp\Model\ObjectiveTable($tableGateway);
                      return $table;
                  },
  
                  'PdpObjectiveTableGateway' =&gt; function($sm) {
                      $dbAdapter = $sm-&gt;get('Zend\Db\Adapter\Adapter');
                      $resultSetPrototype = new ResultSet();
                      $resultSetPrototype-&gt;setArrayObjectPrototype(new \Pdp\Entity\Objective());
                      return new TableGateway('pdp_form_objective', $dbAdapter, null, $resultSetPrototype);
                  },
              ),
          );
      }
  
  }
  </code></pre>