Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

[dev-develop] using zend-servicemanager v3 got error: ": Unable to resolve service "application" to a factory" #78

Closed
samsonasik opened this issue Feb 29, 2016 · 6 comments
Assignees
Labels
Milestone

Comments

@samsonasik
Copy link
Contributor

This is the error:

( ! ) Fatal error: Uncaught Zend\ServiceManager\Exception\ServiceNotFoundException: Unable to resolve service "application" to a factory; are you certain you provided it during configuration? in /Users/samsonasik/www/zfskeleton25+/vendor/zendframework/zend-servicemanager/src/ServiceManager.php on line 623
( ! ) Zend\ServiceManager\Exception\ServiceNotFoundException: Unable to resolve service "application" to a factory; are you certain you provided it during configuration? in /Users/samsonasik/www/zfskeleton25+/vendor/zendframework/zend-servicemanager/src/ServiceManager.php on line 623
Call Stack
#   Time    Memory  Function    Location
1   0.0002  364392  {main}( )   .../index.php:0
2   0.1271  4606072 Zend\Mvc\Application->run( )    .../index.php:21
3   0.1343  5130872 Zend\Mvc\Application->completeRequest( )    .../Application.php:356
4   0.1343  5130872 Zend\EventManager\EventManager->triggerEvent( ) .../Application.php:384
5   0.1343  5130872 Zend\EventManager\EventManager->triggerListeners( ) .../EventManager.php:143
6   0.1343  5131448 Zend\Mvc\View\Http\DefaultRenderingStrategy->render( )  .../EventManager.php:271
7   0.1506  5831240 Zend\EventManager\EventManager->triggerEvent( ) .../DefaultRenderingStrategy.php:115
8   0.1506  5831240 Zend\EventManager\EventManager->triggerListeners( ) .../EventManager.php:143
9   0.1507  5832464 Zend\Mvc\View\Http\DefaultRenderingStrategy->render( )  .../EventManager.php:271

My composer.json:

        "zendframework/zendframework": "~2.5",
        "zendframework/zend-mvc": "dev-develop",
        "zendframework/zend-servicemanager": "dev-develop as 2.5",
        "zendframework/zend-eventmanager": "dev-develop as 2.5",
@weierophinney
Copy link
Member

I'll look into this first thing today!

One note: you don't need to add the entries for zend-servicemanager and zend-eventmanager; the develop branch of zend-mvc pins to stable versions of all components. I'd instead use this:

"zendframework/zend-mvc": "dev-develop as 2.7.0"

which will bring it in as a stable version, and use the latest stable version of any dependencies it has.

If you want to force usage of zend-servicemanager v3 and/or zend-eventmanager v3, add the following as well:

"zendframework/zend-stdlib": "^3.0",
"zendframework/zend-eventmanager": "^3.0",
"zendframework/zend-servicemanager": "^3.0.3",
"zendframework/zend-hydrator": "^2.1",

With regards to your issue, I'm pretty sure it's just a missing alias, which should be something I can resolve easily; thanks for the report!

@weierophinney weierophinney added this to the 2.7.0 milestone Feb 29, 2016
@weierophinney weierophinney self-assigned this Feb 29, 2016
@weierophinney
Copy link
Member

@samsonasik I've done the following

  • Created a new skeleton application via composer create-project -n -sdev zendframework/skeleton-application
  • Within the project, edited composer.json to add: "zendframework/zend-mvc": "dev-develop as 2.7.0"
  • Ran composer update
  • Ran php -S 0:8080 -t public/ public/index.php

From there, I browsed to localhost:8080... and all worked fine.

Packages installed (minus dev stuff from PHPunit) are:

Package Version
container-interop/container-interop 1.1.0
doctrine/instantiator 1.0.5
psr/http-message 1.0
psr/log 1.0.0
zendframework/zend-authentication 2.5.3
zendframework/zend-barcode 2.6.0
zendframework/zend-cache 2.6.1
zendframework/zend-captcha 2.5.4
zendframework/zend-code 2.6.2
zendframework/zend-config 2.6.0
zendframework/zend-console 2.6.0
zendframework/zend-crypt 2.6.0
zendframework/zend-db 2.7.0
zendframework/zend-debug 2.5.1
zendframework/zend-di 2.6.0
zendframework/zend-diactoros 1.3.3
zendframework/zend-dom 2.6.0
zendframework/zend-escaper 2.5.1
zendframework/zend-eventmanager 2.6.3
zendframework/zend-feed 2.7.0
zendframework/zend-file 2.6.0
zendframework/zend-filter 2.6.1
zendframework/zend-form 2.7.0
zendframework/zend-http 2.5.4
zendframework/zend-hydrator 1.1.0
zendframework/zend-i18n 2.6.0
zendframework/zend-i18n-resources 2.5.2
zendframework/zend-inputfilter 2.6.0
zendframework/zend-json 2.6.1
zendframework/zend-loader 2.5.1
zendframework/zend-log 2.7.1
zendframework/zend-mail 2.6.1
zendframework/zend-math 2.6.0
zendframework/zend-memory 2.5.1
zendframework/zend-mime 2.5.1
zendframework/zend-modulemanager 2.7.1
zendframework/zend-mvc 2.7.x-dev 45d259c
zendframework/zend-navigation 2.6.0
zendframework/zend-paginator 2.6.0
zendframework/zend-permissions-acl 2.6.0
zendframework/zend-permissions-rbac 2.5.1
zendframework/zend-progressbar 2.5.1
zendframework/zend-psr7bridge 0.2.1
zendframework/zend-serializer 2.6.1
zendframework/zend-server 2.6.1
zendframework/zend-servicemanager 2.7.5
zendframework/zend-session 2.6.2
zendframework/zend-soap 2.5.1
zendframework/zend-stdlib 2.7.6
zendframework/zend-tag 2.6.1
zendframework/zend-test 2.5.2
zendframework/zend-text 2.6.0
zendframework/zend-uri 2.5.2
zendframework/zend-validator 2.6.0
zendframework/zend-version 2.5.1
zendframework/zend-view 2.6.3
zendframework/zend-xmlrpc 2.5.1
zendframework/zendframework 2.5.3
zendframework/zendxml 1.0.2

Can you give more details on how to recreate the issue you observed?

@samsonasik
Copy link
Contributor Author

It is working fine by just use zend-mvc:dev-develop, The issue is raised when I added zend-servicemanager ^3.0 and Zend-eventmanager ^3.0

Warm regards,

Abdul Malik Ikhsan

Pada 29 Feb 2016, pukul 21.45, weierophinney notifications@github.com menulis:

@samsonasik I've done the following

Created a new skeleton application via composer create-project -n -sdev zendframework/skeleton-application
Within the project, edited composer.json to add: "zendframework/zend-mvc": "dev-develop as 2.7.0"
Ran composer update
Ran php -S 0:8080 -t public/ public/index.php
From there, I browsed to localhost:8080... and all worked fine.

Packages installed (minus dev stuff from PHPunit) are:

Package Version
container-interop/container-interop 1.1.0
doctrine/instantiator 1.0.5
psr/http-message 1.0
psr/log 1.0.0
zendframework/zend-authentication 2.5.3
zendframework/zend-barcode 2.6.0
zendframework/zend-cache 2.6.1
zendframework/zend-captcha 2.5.4
zendframework/zend-code 2.6.2
zendframework/zend-config 2.6.0
zendframework/zend-console 2.6.0
zendframework/zend-crypt 2.6.0
zendframework/zend-db 2.7.0
zendframework/zend-debug 2.5.1
zendframework/zend-di 2.6.0
zendframework/zend-diactoros 1.3.3
zendframework/zend-dom 2.6.0
zendframework/zend-escaper 2.5.1
zendframework/zend-eventmanager 2.6.3
zendframework/zend-feed 2.7.0
zendframework/zend-file 2.6.0
zendframework/zend-filter 2.6.1
zendframework/zend-form 2.7.0
zendframework/zend-http 2.5.4
zendframework/zend-hydrator 1.1.0
zendframework/zend-i18n 2.6.0
zendframework/zend-i18n-resources 2.5.2
zendframework/zend-inputfilter 2.6.0
zendframework/zend-json 2.6.1
zendframework/zend-loader 2.5.1
zendframework/zend-log 2.7.1
zendframework/zend-mail 2.6.1
zendframework/zend-math 2.6.0
zendframework/zend-memory 2.5.1
zendframework/zend-mime 2.5.1
zendframework/zend-modulemanager 2.7.1
zendframework/zend-mvc 2.7.x-dev 45d259c
zendframework/zend-navigation 2.6.0
zendframework/zend-paginator 2.6.0
zendframework/zend-permissions-acl 2.6.0
zendframework/zend-permissions-rbac 2.5.1
zendframework/zend-progressbar 2.5.1
zendframework/zend-psr7bridge 0.2.1
zendframework/zend-serializer 2.6.1
zendframework/zend-server 2.6.1
zendframework/zend-servicemanager 2.7.5
zendframework/zend-session 2.6.2
zendframework/zend-soap 2.5.1
zendframework/zend-stdlib 2.7.6
zendframework/zend-tag 2.6.1
zendframework/zend-test 2.5.2
zendframework/zend-text 2.6.0
zendframework/zend-uri 2.5.2
zendframework/zend-validator 2.6.0
zendframework/zend-version 2.5.1
zendframework/zend-view 2.6.3
zendframework/zend-xmlrpc 2.5.1
zendframework/zendframework 2.5.3
zendframework/zendxml 1.0.2
Can you give more details on how to recreate the issue you observed?


Reply to this email directly or view it on GitHub.

@weierophinney
Copy link
Member

Okay, will try that as well; thanks for the clarification, @samsonasik !

@samsonasik
Copy link
Contributor Author

@weierophinney I've created PR for it #80

weierophinney added a commit to weierophinney/zend-mvc that referenced this issue Feb 29, 2016
Fixes zendframework#78 : using uppercase for 'Application' service
weierophinney added a commit that referenced this issue Feb 29, 2016
@weierophinney
Copy link
Member

Fixed with #80 / #82.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants