Closed sebastianblum closed 6 years ago
Which symfony version are you using? can you tell me if the
debug.stopwatch
is defined ?
On 30 May 2018 at 09:31, Sebastian Blum notifications@github.com wrote:
Hello!
I got this stack trace with symfony 4 since upgrading to 2.4.
Error : Call to a member function start() on string /vendor/jms/serializer-bundle/Serializer/StopwatchEventSubscriber.php:48 /vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/ EventDispatcher.php:88 /vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php:172 /vendor/jms/serializer/src/JMS/Serializer/JsonSerializationVisitor.php:97 /vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php:137 /vendor/jms/serializer/src/JMS/Serializer/Serializer.php:177 /vendor/jms/serializer/src/JMS/Serializer/Serializer.php:96 /vendor/phpoption/phpoption/src/PhpOption/Some.php:89 /vendor/jms/serializer/src/JMS/Serializer/Serializer.php:99 /vendor/friendsofsymfony/rest-bundle/Serializer/ JMSSerializerAdapter.php:60 /vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php:453 /vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php:416 /vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php:300 /vendor/friendsofsymfony/rest-bundle/Controller/ControllerTrait.php:116 /src/Controller/AccomplishmentController.php:209 /vendor/symfony/http-kernel/HttpKernel.php:149 /vendor/symfony/http-kernel/HttpKernel.php:66 /vendor/symfony/http-kernel/Kernel.php:190 /vendor/symfony/http-kernel/Client.php:68 /vendor/symfony/framework-bundle/Client.php:131 /vendor/symfony/browser-kit/Client.php:312 /tests/Controller/AccomplishmentControllerTest.php:176
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/schmittjoh/JMSSerializerBundle/issues/660, or mute the thread https://github.com/notifications/unsubscribe-auth/AAvaJ3SJ4czkDskObywikD78fUQm2zNoks5t3kq4gaJpZM4USve_ .
here the list of composer licenses
symfony/asset v4.0.11 MIT
symfony/browser-kit v4.0.11 MIT
symfony/cache v4.0.11 MIT
symfony/config v4.0.11 MIT
symfony/console v4.0.11 MIT
symfony/css-selector v4.0.11 MIT
symfony/debug v4.0.11 MIT
symfony/debug-bundle v4.0.11 MIT
symfony/dependency-injection v4.0.11 MIT
symfony/doctrine-bridge v4.0.11 MIT
symfony/dom-crawler v4.0.11 MIT
symfony/dotenv v4.0.11 MIT
symfony/event-dispatcher v4.0.11 MIT
symfony/expression-language v4.0.11 MIT
symfony/filesystem v4.0.11 MIT
symfony/finder v4.0.11 MIT
symfony/flex v1.0.80 MIT
symfony/form v4.0.11 MIT
symfony/framework-bundle v4.0.11 MIT
symfony/http-foundation v4.0.11 MIT
symfony/http-kernel v4.0.11 MIT
symfony/inflector v4.0.11 MIT
symfony/intl v4.0.11 MIT
symfony/monolog-bridge v4.0.11 MIT
symfony/monolog-bundle v3.2.0 MIT
symfony/options-resolver v4.0.11 MIT
symfony/orm-pack v1.0.5 MIT
symfony/phpunit-bridge v3.4.11 MIT
symfony/polyfill-ctype v1.8.0 MIT
symfony/polyfill-intl-icu v1.8.0 MIT
symfony/polyfill-mbstring v1.8.0 MIT
symfony/polyfill-php70 v1.8.0 MIT
symfony/polyfill-php72 v1.8.0 MIT
symfony/process v4.0.11 MIT
symfony/profiler-pack v1.0.3 MIT
symfony/property-access v4.0.11 MIT
symfony/routing v4.0.11 MIT
symfony/security v4.0.11 MIT
symfony/security-bundle v4.0.11 MIT
symfony/serializer v4.0.11 MIT
symfony/stopwatch v4.0.11 MIT
symfony/swiftmailer-bundle v3.2.2 MIT
symfony/templating v4.0.11 MIT
symfony/translation v4.0.11 MIT
symfony/twig-bridge v4.0.11 MIT
symfony/twig-bundle v4.0.11 MIT
symfony/validator v4.0.11 MIT
symfony/var-dumper v4.0.11 MIT
symfony/web-link v4.0.11 MIT
symfony/web-profiler-bundle v4.0.11 MIT
symfony/web-server-bundle v4.0.11 MIT
symfony/workflow v4.0.11 MIT
symfony/yaml v4.0.11 MIT
here the output of console
bin/console debug:container debug.stopwatch
Information for Service "debug.stopwatch"
=========================================
---------------- ---------------------------------------
Option Value
---------------- ---------------------------------------
Service ID debug.stopwatch
Class Symfony\Component\Stopwatch\Stopwatch
Tags kernel.reset (method: reset)
Public no
Synthetic no
Lazy no
Shared yes
Abstract no
Autowired no
Autoconfigured no
---------------- ---------------------------------------
Do you mind finding how
JMS\SerializerBundle\Serializer\StopwatchEventSubscriber
is instantiated
in the container?
the service definition is simple enough...
<service id="jms_serializer.stopwatch_subscriber"
class="JMS\SerializerBundle\Serializer\StopwatchEventSubscriber"
public="true">
<tag name="jms_serializer.event_subscriber" />
<argument type="service" id="debug.stopwatch" />
</service>
It looks debug.stopwatch
is null.... that does not make sense, if
debug.stopwatch
gets removed, jms_serializer.stopwatch_subscriber
should throw an error,
not silently use null
thank you very much @goetas - I will debug it and create a demo app to reproduce.
Hello!
I got this stack trace with symfony 4 since upgrading to 2.4.
Error : Call to a member function start() on string /vendor/jms/serializer-bundle/Serializer/StopwatchEventSubscriber.php:48 /vendor/jms/serializer/src/JMS/Serializer/EventDispatcher/EventDispatcher.php:88 /vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php:172 /vendor/jms/serializer/src/JMS/Serializer/JsonSerializationVisitor.php:97 /vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php:137 /vendor/jms/serializer/src/JMS/Serializer/Serializer.php:177 /vendor/jms/serializer/src/JMS/Serializer/Serializer.php:96 /vendor/phpoption/phpoption/src/PhpOption/Some.php:89 /vendor/jms/serializer/src/JMS/Serializer/Serializer.php:99 /vendor/friendsofsymfony/rest-bundle/Serializer/JMSSerializerAdapter.php:60 /vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php:453 /vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php:416 /vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php:300 /vendor/friendsofsymfony/rest-bundle/Controller/ControllerTrait.php:116 /src/Controller/AccomplishmentController.php:209 /vendor/symfony/http-kernel/HttpKernel.php:149 /vendor/symfony/http-kernel/HttpKernel.php:66 /vendor/symfony/http-kernel/Kernel.php:190 /vendor/symfony/http-kernel/Client.php:68 /vendor/symfony/framework-bundle/Client.php:131 /vendor/symfony/browser-kit/Client.php:312 /tests/Controller/AccomplishmentControllerTest.php:176