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

Didn't find a registered implementation for name exception #32

Open
huanghuangzym opened this issue Feb 7, 2022 · 1 comment
Open

Comments

@huanghuangzym
Copy link
Member

hello

i want to write a mysql codec use meta-protocol-proxy

MysqlCodec() {
ENVOY_LOG(debug, "mysql: begin to construct ");
transport_ =
MysqlProxy::NamedTransportConfigFactory::getFactory(MysqlProxy::TransportType::Auto)
.createTransport();

but MysqlProxy::NamedTransportConfigFactory::getFactory(MysqlProxy::TransportType::Auto)
.createTransport(); this line get exection

Thread 21 "wrk:worker_7" hit Breakpoint 1, Envoy::Extensions::NetworkFilters::MysqlProxy::NamedTransportConfigFactory::getFactory (type=Envoy::Extensions::NetworkFilters::MysqlProxy::TransportType::Auto)
at ./src/application_protocols/mysql/transport.h:104
104 const std::string& name = TransportNames::get().fromType(type);
(gdb) n
105 return Envoy::Config::Utility::getAndCheckFactoryByName(name);
(gdb) p name
$1 = (const std::string &) @0x5555617dbae0: {static npos = 18446744073709551615, _M_dataplus = {<std::allocator> = {<__gnu_cxx::new_allocator> = {}, },
_M_p = 0x5555617dbaf0 "auto"}, _M_string_length = 4, {_M_local_buf = "auto", '\000' <repeats 11 times>, _M_allocated_capacity = 1869903201}}
(gdb) s
Envoy::Config::Utility::getAndCheckFactoryByNameEnvoy::Extensions::NetworkFilters::MysqlProxy::NamedTransportConfigFactory (name=...)
at bazel-out/k8-dbg/bin/external/envoy/source/common/config/_virtual_includes/utility_lib/common/config/utility.h:255
255 if (name.empty()) {
(gdb) n
259 Factory* factory = Registry::FactoryRegistry::getFactory(name);
(gdb) p name
$2 = (const std::string &) @0x5555617dbae0: {static npos = 18446744073709551615, _M_dataplus = {<std::allocator> = {<__gnu_cxx::new_allocator> = {}, },
_M_p = 0x5555617dbaf0 "auto"}, _M_string_length = 4, {_M_local_buf = "auto", '\000' <repeats 11 times>, _M_allocated_capacity = 1869903201}}
(gdb) n
261 if (factory == nullptr) {
(gdb) n
263 fmt::format("Didn't find a registered implementation for name: '{}'", name));

then gdb ,i find it is a nullptr exception, can any one tell me how to resolve?

@huanghuangzym
Copy link
Member Author

REGISTER_FACTORY(MysqlCodecConfig, MetaProtocolProxy::NamedCodecConfigFactory);
this has already exists

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

No branches or pull requests

1 participant