Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 使用webman的依赖自动注入报错 #11

Closed
fz39 opened this issue Oct 9, 2024 · 0 comments
Closed

[BUG] 使用webman的依赖自动注入报错 #11

fz39 opened this issue Oct 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fz39
Copy link

fz39 commented Oct 9, 2024

使用

composer require psr/container ^1.1.1 php-di/php-di ^6.3 doctrine/annotations ^1.14
修改配置config/container.php,其最终内容如下:

$builder = new \DI\ContainerBuilder();
$builder->addDefinitions(config('dependence', []));
$builder->useAutowiring(true);
$builder->useAnnotations(true);
return $builder->build();

会报以下错误

DI\Definition\Exception\InvalidDefinition: Entry "Workbunny\WebmanCoroutine\CoroutineWebServer" cannot be resolved: Parameter $requestClass of __construct() has no value defined or guessable
Full definition:
Object (
    class = Workbunny\WebmanCoroutine\CoroutineWebServer
    lazy = false
    __construct(
        $requestClass = #UNDEFINED#
        $logger = get(Monolog\Logger)
        $appPath = #UNDEFINED#
        $publicPath = #UNDEFINED#
    )
) in /paht/vendor/php-di/php-di/src/Definition/Exception/InvalidDefinition.php:19
Stack trace:
#0 /paht/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php(153): DI\Definition\Exception\InvalidDefinition::create(Object(DI\Definition\ObjectDefinition), 'Entry "Workbunn...')
#1 /paht/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php(71): DI\Definition\Resolver\ObjectCreator->createInstance(Object(DI\Definition\ObjectDefinition), Array)
#2 /paht/vendor/php-di/php-di/src/Definition/Resolver/ResolverDispatcher.php(71): DI\Definition\Resolver\ObjectCreator->resolve(Object(DI\Definition\ObjectDefinition), Array)
#3 /paht/vendor/php-di/php-di/src/Container.php(390): DI\Definition\Resolver\ResolverDispatcher->resolve(Object(DI\Definition\ObjectDefinition), Array)
#4 /paht/vendor/php-di/php-di/src/Container.php(199): DI\Container->resolveDefinition(Object(DI\Definition\ObjectDefinition), Array)
#5 /paht/vendor/workerman/webman-framework/src/support/Container.php(46): DI\Container->make('Workbunny\\Webma...', Array)
#6 /paht/support/helpers.php(476): support\Container::__callStatic('make', Array)
#7 /paht/vendor/workerman/workerman/Worker.php(2501): {closure}(Object(Workerman\Worker))
#8 /paht/vendor/workerman/workerman/Worker.php(1636): Workerman\Worker->run()
#9 /paht/vendor/workerman/workerman/Worker.php(1429): Workerman\Worker::forkOneWorkerForLinux(Object(Workerman\Worker))
#10 /paht/vendor/workerman/workerman/Worker.php(1403): Workerman\Worker::forkWorkersForLinux()
#11 /paht/vendor/workerman/workerman/Worker.php(560): Workerman\Worker::forkWorkers()
#12 /paht/vendor/workerman/webman-framework/src/support/App.php(131): Workerman\Worker::runAll()
#13 /paht/start.php(4): support\App::run()
#14 {main}
worker[plugin.workbunny.webman-coroutine.coroutine-web-server:97366] exit with status 64000
DI\Definition\Exception\InvalidDefinition: Entry "Workbunny\WebmanCoroutine\CoroutineWebServer" cannot be resolved: Parameter $requestClass of __construct() has no value defined or guessable
@fz39 fz39 changed the title 使用webman的依赖自动注入会 使用webman的依赖自动注入报错 Oct 9, 2024
@chaz6chez chaz6chez added the bug Something isn't working label Oct 11, 2024
@chaz6chez chaz6chez changed the title 使用webman的依赖自动注入报错 [BUG] 使用webman的依赖自动注入报错 Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants