Laravel-swoole: When access the new laravel application after installed the package, it throw `Uncaught Error: Call to undefined method App\Http\Kernel::setApplication()`

Created on 4 May 2018  ·  5Comments  ·  Source: swooletw/laravel-swoole

Those are the error message stack.

❯ php artisan swoole:http start
Starting swoole http server...
Swoole http server started: <http://127.0.0.1:1215>
PHP Fatal error:  Uncaught Error: Call to undefined method App\Http\Kernel::setApplication() in /Users/yjh/Code/laravel56/vendor/swooletw/laravel-swoole/src/Server/Application.php:437
Stack trace:
#0 /Users/yjh/Code/laravel56/vendor/swooletw/laravel-swoole/src/Server/Sandbox.php(67): SwooleTW\Http\Server\Application->__clone()
#1 /Users/yjh/Code/laravel56/vendor/swooletw/laravel-swoole/src/Server/Manager.php(252): SwooleTW\Http\Server\Sandbox->getApplication()
#2 {main}
  thrown in /Users/yjh/Code/laravel56/vendor/swooletw/laravel-swoole/src/Server/Application.php on line 437
PHP Stack trace:
PHP   1. {main}() /Users/yjh/Code/laravel56/artisan:0
PHP   2. App\Console\Kernel->handle() /Users/yjh/Code/laravel56/artisan:37
PHP   3. Illuminate\Console\Application->run() /Users/yjh/Code/laravel56/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:122
PHP   4. Illuminate\Console\Application->run() /Users/yjh/Code/laravel56/vendor/laravel/framework/src/Illuminate/Console/Application.php:89
PHP   5. Illuminate\Console\Application->doRun() /Users/yjh/Code/laravel56/vendor/symfony/console/Application.php:143
PHP   6. Illuminate\Console\Application->doRunCommand() /Users/yjh/Code/laravel56/vendor/symfony/console/Application.php:241
PHP   7. SwooleTW\Http\Commands\HttpServerCommand->run() /Users/yjh/Code/laravel56/vendor/symfony/console/Application.php:865
PHP   8. SwooleTW\Http\Commands\HttpServerCommand->run() /Users/yjh/Code/laravel56/vendor/laravel/framework/src/Illuminate/Console/Command.php:170
PHP   9. SwooleTW\Http\Commands\HttpServerCommand->execute() /Users/yjh/Code/laravel56/vendor/symfony/console/Command/Command.php:252
PHP  10. Illuminate\Foundation\Application->call() /Users/yjh/Code/laravel56/vendor/laravel/framework/src/Illuminate/Console/Command.php:183
PHP  11. Illuminate\Container\BoundMethod::call() /Users/yjh/Code/laravel56/vendor/laravel/framework/src/Illuminate/Container/Container.php:564
PHP  12. Illuminate\Container\BoundMethod::callBoundMethod() /Users/yjh/Code/laravel56/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31
PHP  13. Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() /Users/yjh/Code/laravel56/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87
PHP  14. call_user_func_array:{/Users/yjh/Code/laravel56/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29}() /Users/yjh/Code/laravel56/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
PHP  15. SwooleTW\Http\Commands\HttpServerCommand->handle() /Users/yjh/Code/laravel56/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
PHP  16. SwooleTW\Http\Commands\HttpServerCommand->runAction() /Users/yjh/Code/laravel56/vendor/swooletw/laravel-swoole/src/Commands/HttpServerCommand.php:55
PHP  17. SwooleTW\Http\Commands\HttpServerCommand->start() /Users/yjh/Code/laravel56/vendor/swooletw/laravel-swoole/src/Commands/HttpServerCommand.php:71
PHP  18. SwooleTW\Http\Server\Manager->run() /Users/yjh/Code/laravel56/vendor/swooletw/laravel-swoole/src/Commands/HttpServerCommand.php:94
PHP  19. Swoole\Http\Server->start() /Users/yjh/Code/laravel56/vendor/swooletw/laravel-swoole/src/Server/Manager.php:99

Most helpful comment

The newest released version https://github.com/swooletw/laravel-swoole/releases/tag/v2.3.1 has fixed this bug. It should work now.

All 5 comments

I get same error

Uncaught Error: Call to undefined method App\Http\Kernel::setApplication() in /home/ubuntu/laravel/vendor/swooletw/laravel-swoole/src/Server/Application.php:439
Stack trace:
#0 /home/ubuntu/laravel/vendor/swooletw/laravel-swoole/src/Server/Sandbox.php(67): SwooleTW\Http\Server\Application->__clone()
#1 /home/ubuntu/laravel/vendor/swooletw/laravel-swoole/src/Server/Manager.php(252): SwooleTW\Http\Server\Sandbox->getApplication()
#2 {main}
thrown

If I delete this line - app working 0_o

And, this method (setApplication) not exists in Laravel HttpKernel. What is it?

Hi @yaojinhui1993 @romach3 ,

thanks for your bug report, I'm working on fixing it. Will release a hot fix patch soon.

The newest released version https://github.com/swooletw/laravel-swoole/releases/tag/v2.3.1 has fixed this bug. It should work now.

👌

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yl picture yl  ·  3Comments

caveman74 picture caveman74  ·  7Comments

junshenshi picture junshenshi  ·  11Comments

george-kar picture george-kar  ·  6Comments

Arkanius picture Arkanius  ·  7Comments