微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何找到jetty 400错误的原因?

如何解决如何找到jetty 400错误的原因?

我有一个 jetty 服务器(版本 9.4.11。它与 org.restlet-2.4.3 结合使用)。客户端正在向我的服务器上的 api 发送 POST 消息(路由“/pos/v1/purchasable_items”)并且码头以 400 代码响应。我无法弄清楚原因。我真的很感激一些帮助。

这是码头的完整日志:

12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Queued change org.eclipse.jetty.io.ManagedSelector$Accept@616b6a22 on org.eclipse.jetty.io.ManagedSelector@79c26be5 id=1 keys=0 selected=0 updates=0
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - wakeup on submit org.eclipse.jetty.io.ManagedSelector@79c26be5 id=1 keys=0 selected=0 updates=1
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Selector sun.nio.ch.WindowsSelectorImpl@5c1f2b6e woken with none selected
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Selector sun.nio.ch.WindowsSelectorImpl@5c1f2b6e woken up from select,0/0/0 selected
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Selector sun.nio.ch.WindowsSelectorImpl@5c1f2b6e processing 0 keys,1 updates
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - updateable 1
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - update org.eclipse.jetty.io.ManagedSelector$Accept@616b6a22
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.util.thread.QueuedThreadPool     - queue org.eclipse.jetty.io.ManagedSelector$Accept@616b6a22
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - updates 0
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Selector sun.nio.ch.WindowsSelectorImpl@5c1f2b6e waiting with 1 keys
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.util.thread.QueuedThreadPool     - run org.eclipse.jetty.io.ManagedSelector$Accept@616b6a22
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.IdleTimeout                   - SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,OPEN,fill=-,flush=-,to=8/100000}{io=0/0,kio=0,kro=0}-><null> idle timeout check,elapsed: 7 ms,remaining: 99993 ms
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.PreEncodedHttpField         - HttpField encoders loaded: [org.eclipse.jetty.http.Http1FieldPreEncoder@1525e6cb]
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.HttpChannel               - new HttpChanneloverHttp@3b503229{r=0,c=false,a=IDLE,uri=null,age=0} -> SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,to=72/100000}{io=0/0,kro=0}-><null>,null,HttpChannelState@7ae84ea1{s=IDLE a=NOT_ASYNC i=true r=IDLE w=false}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.httpconnection            - New HTTP Connection httpconnection@30023a7c[p=HttpParser{s=START,0 of -1},g=HttpGenerator@7f9bfe40{s=START}]=>HttpChanneloverHttp@3b503229{r=0,age=0}<-SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,to=80/100000}{io=0/0,kro=0}-><null>
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.AbstractEndPoint              - onopen SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,to=81/100000}{io=0/0,kro=0}->httpconnection@30023a7c[p=HttpParser{s=START,age=0}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.AbstractConnection            - onopen httpconnection@30023a7c[p=HttpParser{s=START,age=0}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.AbstractConnection            - fillInterested httpconnection@30023a7c[p=HttpParser{s=START,age=0}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.FillInterest                  - interested FillInterest@72454313{AC.ReadCB@30023a7c{httpconnection@30023a7c[p=HttpParser{s=START,fill=FI,to=0/100000}{io=0/0,age=0}}}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ChannelEndPoint               - changeInterests p=false 0->1 for SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,to=0/100000}{io=0/1,age=0}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Queued change org.eclipse.jetty.io.ChannelEndPoint$1@528ccae5 on org.eclipse.jetty.io.ManagedSelector@79c26be5 id=1 keys=1 selected=0 updates=0
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - wakeup on submit org.eclipse.jetty.io.ManagedSelector@79c26be5 id=1 keys=1 selected=0 updates=1
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Selector sun.nio.ch.WindowsSelectorImpl@5c1f2b6e woken with none selected
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Selector sun.nio.ch.WindowsSelectorImpl@5c1f2b6e woken up from select,0/0/1 selected
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Selector sun.nio.ch.WindowsSelectorImpl@5c1f2b6e processing 0 keys,1 updates
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - updateable 1
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - update org.eclipse.jetty.io.ChannelEndPoint$1@528ccae5
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Created SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,age=0}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.util.thread.QueuedThreadPool     - ran org.eclipse.jetty.io.ManagedSelector$Accept@616b6a22
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ChannelEndPoint               - Key interests updated 0 -> 1 on SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,to=1/100000}{io=1/1,kio=1,age=0}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - updates 0
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Selector sun.nio.ch.WindowsSelectorImpl@5c1f2b6e waiting with 1 keys
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Selector sun.nio.ch.WindowsSelectorImpl@5c1f2b6e woken up from select,1/1/1 selected
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Selector sun.nio.ch.WindowsSelectorImpl@5c1f2b6e processing 1 keys,0 updates
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - selected 1 channel=java.nio.channels.socketChannel[connected local=/127.0.0.1:8182 remote=/127.0.0.1:50589],selector=sun.nio.ch.WindowsSelectorImpl@5c1f2b6e,interestOps=1,readyOps=1 SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,kro=1}->httpconnection@30023a7c[p=HttpParser{s=START,age=0} 
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ChannelEndPoint               - onSelected 1->0 r=true w=false for SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,to=1/100000}{io=1/0,age=0}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ChannelEndPoint               - task CEP:SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,age=0}:runFillable:BLOCKING
12:56:05 [36mDEBUG[0;39m o.eclipse.jetty.util.thread.ReservedThreadExecutor - ReservedThreadExecutor@77a9ea73{s=0/8,p=0} tryExecute EatWhatYouKill@218cf600/SelectorProducer@4aecb548/PRODUCING/p=false/QueuedThreadPool[qtp103099676]@6252d1c{STARTED,8<=8<=300,i=3,q=0}[ReservedThreadExecutor@77a9ea73{s=0/8,p=0}][pc=0,pic=0,pec=0,epc=0]@2021-06-17T12:56:05.8701778+02:00
12:56:05 [36mDEBUG[0;39m o.eclipse.jetty.util.thread.ReservedThreadExecutor - ReservedThreadExecutor@77a9ea73{s=0/8,p=1} startReservedThread p=1
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.util.thread.QueuedThreadPool     - queue ReservedThreadExecutor@77a9ea73{s=0/8,p=1}@73ca3be9
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.util.thread.QueuedThreadPool     - run ReservedThreadExecutor@77a9ea73{s=0/8,p=1}@73ca3be9
12:56:05 [36mDEBUG[0;39m o.eclipse.jetty.util.thread.ReservedThreadExecutor - ReservedThreadExecutor@77a9ea73{s=1/8,p=1}@73ca3be9 started
12:56:05 [36mDEBUG[0;39m o.e.jetty.util.thread.strategy.EatWhatYouKill      - EatWhatYouKill@218cf600/SelectorProducer@4aecb548/PRODUCING/p=false/QueuedThreadPool[qtp103099676]@6252d1c{STARTED,i=2,p=1}][pc=0,epc=0]@2021-06-17T12:56:05.8721778+02:00 m=PRODUCE_EXECUTE_CONSUME t=CEP:SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,to=3/100000}{io=1/0,age=0}:runFillable:BLOCKING/BLOCKING
12:56:05 [36mDEBUG[0;39m o.eclipse.jetty.util.thread.ReservedThreadExecutor - ReservedThreadExecutor@77a9ea73{s=1/8,p=0}@73ca3be9 waiting
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.util.thread.QueuedThreadPool     - queue CEP:SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,age=0}:runFillable:BLOCKING
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - updateable 0
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - updates 0
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ChannelEndPoint               - Key interests updated 1 -> 0 on SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,to=3/100000}{io=0/0,age=0}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ManagedSelector               - Selector sun.nio.ch.WindowsSelectorImpl@5c1f2b6e waiting with 1 keys
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.util.thread.QueuedThreadPool     - run CEP:SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,age=0}:runFillable:BLOCKING
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.FillInterest                  - fillable FillInterest@72454313{AC.ReadCB@30023a7c{httpconnection@30023a7c[p=HttpParser{s=START,to=4/100000}{io=0/0,age=0}}}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.httpconnection            - httpconnection@30023a7c[p=HttpParser{s=START,age=0} onFillable enter HttpChannelState@7ae84ea1{s=IDLE a=NOT_ASYNC i=true r=IDLE w=false} null
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ChannelEndPoint               - filled 181 SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,to=6/100000}{io=0/0,age=0}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.httpconnection            - httpconnection@30023a7c[p=HttpParser{s=START,age=0} filled 181 HeapByteBuffer@25fdf14c[p=0,l=181,c=8192,r=181]={<<<POST /pos/v1/purc...00-continue\r\n\r\n>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.httpconnection            - httpconnection@30023a7c[p=HttpParser{s=START,age=0} parse HeapByteBuffer@25fdf14c[p=0,r=181]={<<<POST /pos/v1/purc...00-continue\r\n\r\n>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00} {}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - parseNext s=START HeapByteBuffer@25fdf14c[p=0,r=181]={<<<POST /pos/v1/purc...00-continue\r\n\r\n>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - START --> SPACE1
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - SPACE1 --> URI
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - URI --> SPACE2
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - SPACE2 --> REQUEST_VERSION
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - REQUEST_VERSION --> HEADER
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - HEADER:Content-Type: application/x-www-form-urlencoded --> IN_VALUE
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - HEADER:Content-Type: application/x-www-form-urlencoded --> FIELD
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - HEADER:Host --> VALUE
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - HEADER:Host --> IN_VALUE
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - HEADER:Host --> FIELD
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - HEADER:Content-Length --> VALUE
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - HEADER:Content-Length --> IN_VALUE
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - HEADER:Content-Length --> FIELD
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - HEADER:Expect --> VALUE
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - HEADER:Expect --> IN_VALUE
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - HEADER:Expect --> FIELD
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - HEADER --> CONTENT
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.HttpChannel               - REQUEST for //127.0.0.1:8182/pos/v1/purchasable_items?d=17.06.2021%2012:56:05 on HttpChanneloverHttp@3b503229{r=1,uri=//127.0.0.1:8182/pos/v1/purchasable_items?d=17.06.2021%2012:56:05,age=1}
POST //127.0.0.1:8182/pos/v1/purchasable_items?d=17.06.2021%2012:56:05 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: 127.0.0.1:8182
Content-Length: 228
Expect: 100-continue


12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.httpconnection            - httpconnection@30023a7c[p=HttpParser{s=CONTENT,0 of 228},g=HttpGenerator@7f9bfe40{s=START}]=>HttpChanneloverHttp@3b503229{r=1,age=2}<-SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,to=13/100000}{io=0/0,kro=1}->httpconnection@30023a7c[p=HttpParser{s=CONTENT,age=2} parsed true HttpParser{s=CONTENT,0 of 228}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.httpconnection            - releaseRequestBuffer httpconnection@30023a7c[p=HttpParser{s=CONTENT,age=2}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.HttpChannel               - HttpChanneloverHttp@3b503229{r=1,age=3} handle //127.0.0.1:8182/pos/v1/purchasable_items?d=17.06.2021%2012:56:05 
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.HttpChannelState          - handling HttpChannelState@7ae84ea1{s=IDLE a=NOT_ASYNC i=true r=IDLE w=false}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.HttpChannel               - HttpChanneloverHttp@3b503229{r=1,a=disPATCHED,age=4} action disPATCH
12:56:05 [36mTRACE[0;39m org.restlet.Component.ServerRouter                 - Call score for the "org.restlet.routing.VirtualHost@24386839" host: 1.0
12:56:05 [36mDEBUG[0;39m org.restlet.Component.ServerRouter                 - Default virtual host selected
12:56:05 [36mDEBUG[0;39m org.restlet.Component.ServerRouter                 - Base URI: "http://127.0.0.1:8182". Remaining part: "/pos/v1/purchasable_items?d=17.06.2021%2012:56:05"
12:56:05 [36mTRACE[0;39m org.restlet.VirtualHost                            - Call score for the "" URI pattern: 0.5
12:56:05 [36mDEBUG[0;39m org.restlet.VirtualHost                            - Selected route: "" -> de.sage.scheduler.access.server.AccessServerImpl@440e3ce6
12:56:05 [36mTRACE[0;39m org.restlet.VirtualHost                            - No characters were matched
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ChannelEndPoint               - filled 0 SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,to=47/100000}{io=0/0,age=36}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ChannelEndPoint               - filled 0 SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,age=36}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.httpconnection            - httpconnection@30023a7c[p=HttpParser{s=CONTENT,age=36}<-SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,age=36} filled 0 HeapByteBuffer@25fdf14c[p=0,l=0,r=0]={<<<>>>POST /pos/v1/purc...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.httpconnection            - httpconnection@30023a7c[p=HttpParser{s=CONTENT,to=48/100000}{io=0/0,age=37} parse HeapByteBuffer@25fdf14c[p=0,r=0]={<<<>>>POST /pos/v1/purc...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00} {}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.http.HttpParser                  - parseNext s=CONTENT HeapByteBuffer@25fdf14c[p=0,age=37}<-SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,age=37} parsed false HttpParser{s=CONTENT,age=37}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.HttpChannel               - sendResponse info=HTTP/1.1{s=100,h=-1,cl=-1} content=null complete=false committing=true callback=Blocker@5a2856fc{null}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.HttpChannel               - COMMIT for /pos/v1/purchasable_items on HttpChanneloverHttp@3b503229{r=1,c=true,age=37}
100 null HTTP/1.1
null
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.httpconnection            - org.eclipse.jetty.server.httpconnection$SendCallback@364501c7[PROCESSING][i=HTTP/1.1{s=100,cl=-1},cb=org.eclipse.jetty.server.HttpChannel$Commit100Callback@d25f545] generate: NEED_HEADER (null,false)@START
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.httpconnection            - org.eclipse.jetty.server.httpconnection$SendCallback@364501c7[PROCESSING][i=HTTP/1.1{s=100,cb=org.eclipse.jetty.server.HttpChannel$Commit100Callback@d25f545] generate: FLUSH ([p=0,l=25,r=25],false)@COMPLETING_1XX
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.WriteFlusher                  - write: WriteFlusher@786527a2{IDLE}->null [HeapByteBuffer@25fdf14c[p=0,r=25]={<<<HTTP/1.1 100 Continue\r\n\r\n>>>items?d=17.06.202...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}]
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.WriteFlusher                  - update WriteFlusher@786527a2{WRITING}->null:IDLE-->WRITING
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.ChannelEndPoint               - flushed 25 SocketChannelEndPoint@54fedde4{/127.0.0.1:50589<->/127.0.0.1:8182,flush=W,to=55/100000}{io=0/0,g=HttpGenerator@7f9bfe40{s=COMPLETING_1XX}]=>HttpChanneloverHttp@3b503229{r=1,age=44}
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.WriteFlusher                  - Flushed=true written=25 remaining=0 WriteFlusher@786527a2{WRITING}->null
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.io.WriteFlusher                  - update WriteFlusher@786527a2{IDLE}->null:WRITING-->IDLE
12:56:05 [36mDEBUG[0;39m org.eclipse.jetty.server.httpconnection            - org.eclipse.jetty.server.httpconnection$SendCallback@364501c7[PROCESSING][i=HTTP/1.1{s=100,cb=org.eclipse.jetty.server.HttpChannel$Commit100Callback@d25f545] generate: DONE ([p=25,r=0],false)@START
12:56:09 [36mDEBUG[0;39m org.eclipse.jetty.server.HttpChannel               - sendResponse info=null content=DirectByteBuffer@3b173fda[p=0,l=84,c=32768,r=84]={<<<{"DESC":"The requ...formed Syntax"}>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00} complete=false committing=true callback=Blocker@5a2856fc{null}
12:56:09 [36mDEBUG[0;39m org.eclipse.jetty.server.HttpChannel               - COMMIT for /pos/v1/purchasable_items on HttpChanneloverHttp@3b503229{r=1,age=3888}
400 null HTTP/1.1
Content-Type: application/json;charset=utf-8
Date: Thu,17 Jun 2021 10:56:09 GMT
Accept-Ranges: bytes
Server: Restlet-Framework/2.4.3
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Authorization,Content-Type
Access-Control-Allow-Methods: DELETE,POST,GET,OPTIONS,PUT

我也尝试用 Wireshark 调试它,但没有成功。这是通信的概述(服务器的 8182 端口):

enter image description here

这是来自 Wireshark 的 POST 请求的详细信息:

enter image description here

如果有人给我提示,我会很高兴。

解决方法

您的客户正在发送带有 POST 标头的 Expect: 100-Continue(一个足够正常的概念)。

从您的wireshark 有点难以判断,但您的客户端似乎没有正确处理 HTTP/1.1 100 Continue 响应。

您的客户端应等待发送请求正文,直到收到 HTTP/1.1 100 Continue 响应。

并且当它发送请求正文时,它应该只包含请求正文,不应再次发送请求头。 (您在码头上的日志和您的wireshark 似乎都显示了)。

这些标头不符合 Content-Type: application/x-www-form-urlencoded 并导致 400 Bad Request 响应。

建议,升级您的 Restlet 版本和 Jetty 版本。

根据请求发送的标头判断,您有一个非常旧版本的 restlet(我希望看到一些标头,但没有看到)。

您的 Jetty 版本 9.4.11 已经很旧了,并且缺少许多 important fixes(其中之一是关于 400 Bad Request 的更清晰的错误消息,它可以帮助您自己解决这个问题)。您比版本 9.4.42.v20210604 落后 3,081 个更新(是的,381 个更新)。

,

问题原来是一个用户代理黑名单,它阻止了请求,因为它没有用户代理。它与码头无关。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。