zrlw commented on PR #14924:
URL: https://github.com/apache/dubbo/pull/14924#issuecomment-2661909083
if enable tri without openapi, NPE will be thrown at
org.apache.dubbo.rpc.protocol.tri.servlet.HttpMetadataAdapter because
```request.getHeader(HttpHeaderNames.HOST.getName())``` will return null.
```
@Override
public HttpHeaders headers() {
headers.add(PseudoHeaderName.METHOD.value(), method());
headers.add(PseudoHeaderName.SCHEME.value(),
request.getScheme());
headers.add(PseudoHeaderName.AUTHORITY.value(),
request.getHeader(HttpHeaderNames.HOST.getName()));
headers.add(PseudoHeaderName.PROTOCOL.value(),
request.getProtocol());
this.headers = headers;
```
https://github.com/apache/dubbo-samples/tree/master/2-advanced/dubbo-samples-triple-servlet
NPE:
```
[DUBBO] Initialize executor failed., dubbo version: 3.3.4-SNAPSHOT, current
host: 172.27.0.3, error code: 0-18. This may be caused by , go to
https://dubbo.apache.org/faq/0/18 to find instructions.
2025-02-16T08:06:02.1996318Z java.lang.NullPointerException: value
2025-02-16T08:06:02.1997279Z at
io.netty.util.internal.ObjectUtil.checkNotNull(ObjectUtil.java:39)
~[netty-common-4.1.107.Final.jar:4.1.107.Final]
2025-02-16T08:06:02.1998664Z at
io.netty.handler.codec.DefaultHeaders.add(DefaultHeaders.java:331)
~[netty-codec-4.1.107.Final.jar:4.1.107.Final]
2025-02-16T08:06:02.2000554Z at
org.apache.dubbo.remoting.http12.netty4.NettyHttpHeaders.add(NettyHttpHeaders.java:82)
~[dubbo-3.3.4-SNAPSHOT.jar:3.3.4-SNAPSHOT]
2025-02-16T08:06:02.2002451Z at
org.apache.dubbo.rpc.protocol.tri.servlet.jakarta.HttpMetadataAdapter.headers(HttpMetadataAdapter.java:58)
~[dubbo-3.3.4-SNAPSHOT.jar:3.3.4-SNAPSHOT]
2025-02-16T08:06:02.2004703Z at
org.apache.dubbo.rpc.protocol.tri.transport.TripleIsolationExecutorSupport.getServiceKey(TripleIsolationExecutorSupport.java:46)
~[dubbo-3.3.4-SNAPSHOT.jar:3.3.4-SNAPSHOT]
2025-02-16T08:06:02.2007068Z at
org.apache.dubbo.rpc.executor.AbstractIsolationExecutorSupport.getProviderModel(AbstractIsolationExecutorSupport.java:64)
~[dubbo-3.3.4-SNAPSHOT.jar:3.3.4-SNAPSHOT]
2025-02-16T08:06:02.2009377Z at
org.apache.dubbo.rpc.executor.AbstractIsolationExecutorSupport.getExecutor(AbstractIsolationExecutorSupport.java:41)
~[dubbo-3.3.4-SNAPSHOT.jar:3.3.4-SNAPSHOT]
2025-02-16T08:06:02.2011790Z at
org.apache.dubbo.rpc.protocol.tri.h12.AbstractServerTransportListener.getExecutor(AbstractServerTransportListener.java:137)
~[dubbo-3.3.4-SNAPSHOT.jar:3.3.4-SNAPSHOT]
2025-02-16T08:06:02.2014200Z at
org.apache.dubbo.rpc.protocol.tri.h12.grpc.GrpcHttp2ServerTransportListener.initializeExecutor(GrpcHttp2ServerTransportListener.java:64)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]