ZF2: unable to fetch or create an instance for partial - zend-framework2

I am trying to use partials in my layout on ZF2.
I tried few methods (including those that are described here, where a user has to include a partial to the rout in the module config). Every time I am getting the same error.
For example, I am following instructions from the ZF2 documentation: http://framework.zend.com/manual/2.2/en/modules/zend.view.helpers.partial.html#zend-view-helpers-initial-partial
partials.phtml is in the same folder as the layout.phtml. The server (and I tried both, apache and building PHP server) throws an error:
[Fri Jun 14 18:40:34 2013] 127.0.0.1:36616 [500]: / - Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message
'Zend\View\HelperPluginManager::get was unable to fetch or create an instance for partial' in /var/www/frameworks/ZF2/library/Zend/ServiceManager/ServiceManager.php:496
Stack trace:
#0 /var/www/frameworks/ZF2/library/Zend/ServiceManager/AbstractPluginManager.php(103): Zend\ServiceManager\ServiceManager->get('partial', true)
#1 /var/www/frameworks/ZF2/library/Zend/View/Renderer/PhpRenderer.php(378): Zend\ServiceManager\AbstractPluginManager->get('partial', NULL)
#2 /var/www/frameworks/ZF2/library/Zend/View/Renderer/PhpRenderer.php(397): Zend\View\Renderer\PhpRenderer->plugin('partial')
#3 /var/www/html/zf2.tutorial/module/Application/view/layout/layout.phtml(129): Zend\View\Renderer\PhpRenderer->__call('partial', Array)
#4 /var/www/html/zf2.tutorial/module/Application/view/layout/layout.phtml(129): Zend\View\Renderer\PhpRenderer->partial('partial.phtml', Array)
#5 /var/www/frameworks/ZF2/library/Zend/View/Renderer/PhpRenderer. in /var/www/frameworks/ZF2/library/Zend/ServiceManager/ServiceManager.php on line 496
I am using PHP5.5.0RC3, ZF2.2.1 and Apache 2.2.15
Any suggestions would be appreciated.

Related

DCDG Dart Diagrams: Unhandled exception: Bad state: Unable to find the context to foldername\env.dart

I have been trying to generate dart diagrams for my code but the below error:
C:\Users\Foldername\AppData\Local\Pub\Cache\bin>dart pub global run dcdg
C:\Users\Foldername\AppData\Local\Pub\Cache\bin\lib
Unhandled exception:
Bad state: Unable to find the context to C:\Users\Foldername\AppData\Local\Pub\Cache\bin\lib\.env.dart
#0 AnalysisContextCollectionImpl.contextFor (package:analyzer/src/dart/analysis/analysis_context_collection.dart:106:5)
#1 findClassElements (package:dcdg/src/find_class_elements.dart:46:39)
#2 main (file:///C:/Users/Foldername/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/dcdg-4.0.1/bin/dcdg.dart:35:25)
#3 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
1- I have activated the package.
2- I have updated it to the latest.
3- Environment variables are correctly set.
I still don't understand why does it not allow me to create class diagrams for my code. Anyone has any answers?
I think that probably in your project are dependencies that use code-generation (with build_runner) like: freezed, auto_route, localizely or hive. Package dcdg at the moment (ver. 4.1.0) have issues for generating PlantUML file for such projects. If you want to use dcdg you need to refactor your code and remove such dependencies.
Here is github issue related to your case.

Fatal error: Uncaught Error: "Presta vers. 1.6.1.18

My prestashop gives the following errors:
Fatal error: Uncaught Error: Call to a member function getProducts() on null in /var/www/html/minie.dk/public_html/modules/productsbundle/productsbundle.php:181 Stack trace: #0 /var/www/html/minie.dk/public_html/classes/Hook.php(591): ProductsBundle->hookActionCartSave(Array) #1 /var/www/html/minie.dk/public_html/classes/Hook.php(546): HookCore::coreCallHook(Object(ProductsBundle), 'hookactionCartS...', Array) #2 /var/www/html/minie.dk/public_html/classes/Cart.php(214): HookCore::exec('actionCartSave') #3 /var/www/html/minie.dk/public_html/classes/controller/FrontController.php(327): CartCore->update() #4 /var/www/html/minie.dk/public_html/classes/controller/Controller.php(170): FrontControllerCore->init() #5 /var/www/html/minie.dk/public_html/classes/Dispatcher.php(367): ControllerCore->run() #6 /var/www/html/minie.dk/public_html/index.php(28): DispatcherCore->dispatch() #7 {main} thrown in /var/www/html/minie.dk/public_html/modules/productsbundle/productsbundle.php on line 181
Can Anyone here see what the problem may be? And also, how to save it?
This problem is related to your 'productsbundle' module when a product is added to the customer's shopping cart.
I would suggest either to update this module to the latest version available or to disable it from your admin panel.

NServiceBus RavenDB exception

From times to times I receive an exception that looks to be appearing when my NServiceBus console shows the following message:
NServiceBus.Timeout.Hosting.Windows.TimeoutPersisterReceiver [(null)] <(null)> - Polling next retrieval is at 11/19/2015 11:20:49.
.
Exception:
A first chance exception of type 'System.Net.WebException' occurred in System.dll
Additional information: The remote server returned an error: (404) Not Found.
Callstack:
[External Code]
Raven.Client.Lightweight!Raven.Client.Connection.HttpJsonRequest.ReadJsonInternal(System.Func<System.Net.WebResponse> getResponse) Line 332 C#
Raven.Client.Lightweight!Raven.Client.Connection.HttpJsonRequest.ReadResponseJson() Line 225 C#
Raven.Client.Lightweight!Raven.Client.Connection.ServerClient.DirectGet(string serverUrl, string key) Line 203 C#
Raven.Client.Lightweight!Raven.Client.Connection.ReplicationInformer.RefreshReplicationInformation(Raven.Client.Connection.ServerClient commands) Line 351 C#
Raven.Client.Lightweight!Raven.Client.Connection.ReplicationInformer.UpdateReplicationInformationIfNeeded.AnonymousMethod__6() Line 134 C#
[External Code]
It's an exception that it's thrown and caught inside RavenDB code it self, so I suspect this doesn't interfere with my own code. But I might be hiding a problem.
So I'm wondering why is this exception happening and how can I avoid it?
That is fine, 404 error is raised when you are trying to load a non existant document.
This is expected and part of how this works.

bindSecure() with InternetAddress.ANY_IP_V4 as dynamic address argument

I'm playing around a little with these examples. I get a proper response from the server from a tablet using:
HttpServer.bind(InternetAddress.ANY_IP_V4, 4040)
Then I wanted to try the secure sockets example. For localhost it is working a expected.
HttpServer.bindSecure('localhost', 4047...
But then it will not repond to requests from other computers. So I tried this:
HttpServer.bindSecure(InternetAddress.ANY_IP_V4, 4047,
And gets compile error:
Breaking on exception: object of type TypeError
Unhandled exception:
type '_InternetAddress' is not a subtype of type 'String' of 'address'.
#0 RawSecureServerSocket.bind (secure_server_socket.dart:182)
#1 SecureServerSocket.bind (secure_server_socket.dart:70)
#2 _HttpServer.bindSecure (http_impl.dart:2025)
#3 HttpServer.bindSecure (http.dart:179)
#4 main (file:///D:/Documents/dart/dart-tutorials-samples-master/httpserver/bin/hello_world_server_secure.dart:16:24)
#5 _startIsolate.isolateStartHandler (dart:isolate-patch/isolate_patch.dart:216)
#6 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:115)
I tried printing 'InternetAddress.ANY_IP_V4' and got '0.0.0.0'. So I tried:
HttpServer.bindSecure('0.0.0.0', 4047,
And it worked.
Why does 'InternetAddress.ANY_IP_V4' as first argument to bindSecure fail? I don't understand the error message.
Edit: See comments, this was a bug/inconsistency in an old version of the Dart VM!
This looks like a bug. According to the docs bindSecure should take either a String or an InternetAddress, and InternetAddress.ANY_IP_V4 is even given as a sample!
The address can either be a String or an InternetAddress. If address
is a String, bind will perform a lookup and use the first value in the
list. To listen on the loopback adapter, which will allow only
incoming connections from the local host, use the value
[InternetAddress.LOOPBACK_IP_V4] or [InternetAddress.LOOPBACK_IP_V6].
To allow for incoming connection from the network use either one of
the values [InternetAddress.ANY_IP_V4] or [InternetAddress.ANY_IP_V6]
to bind to all interfaces or the IP address of a specific interface.
I've had a look through the source of these files; but can't figure out what the bug is; the code looks good at first glance :(

Zend 2.2.5 error 'initializer should be callable'

I work on share host and I can choose between PHP version: 5.4.23 or 5.3.28.
I would like to use latest Zend 2.2.5 but on PHP version 5.4.23 I get error:
Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\InvalidArgumentException' with message '$initializer should be callable.'
in /home/rr197664/public_html/domain.com/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:366 Stack trace:
...
...
When I swich to PHP 5.3.28 page open but all redirection ( $this->redirect()->toRoute()) stop work.
I tested it on ZendSkeletonApplication.
Any idea what can be done ?
Thanks
edit (replaced server path with ...):
Current PHP version: 5.4.23
Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\InvalidArgumentException' with message '$initializer should be callable.' in .../Zend/ServiceManager/ServiceManager.php:366 Stack trace:
0 .../Zend/Mvc/Service/ServiceManagerConfig.php(142): Zend\ServiceManager\ServiceManager->addInitializer(NULL)
1 /.../Zend/ServiceManager/ServiceManager.php(128): Zend\Mvc\Service\ServiceManagerConfig->configureServiceManager(Object(Zend\ServiceManager\ServiceManager))
2 /.../Zend/Mvc/Application.php(251): Zend\ServiceManager\ServiceManager->__construct(Object(Zend\Mvc\Service\ServiceManagerConfig))
3 /.../public/index.php(19): Zend\Mvc\Application::init( in /.../Zend/ServiceManager/ServiceManager.php on line 366
Go to the last module you edited. Open Module.php
in your function
public function getServiceConfig()
or in
public function getViewHelperConfig()
You have a reference to a factory that cannot be found, or a inline a function that is not properly formed

Resources