mirror of https://github.com/alibaba/arthas.git
add Troubleshooting HTTP request returns 404 case scenario. (#1340)
parent
5e3d8711ff
commit
e297f11209
@ -0,0 +1,45 @@
|
||||
{
|
||||
"title": "Arthas 排查HTTP请求返回404 案例",
|
||||
"description": "Arthas 排查HTTP请求返回404 案例",
|
||||
"difficulty": "高级使用者",
|
||||
"time": "10分钟",
|
||||
"details": {
|
||||
"steps": [
|
||||
{
|
||||
"title": "Start demo",
|
||||
"text": "start-demo.md"
|
||||
},
|
||||
{
|
||||
"title": "Start arthas-boot",
|
||||
"text": "arthas-boot.md"
|
||||
},
|
||||
{
|
||||
"title": "排查HTTP请求返回404",
|
||||
"text": "case-http-404.md"
|
||||
}
|
||||
],
|
||||
"intro": {
|
||||
"text": "intro.md"
|
||||
},
|
||||
"finish": {
|
||||
"text": "finish.md"
|
||||
},
|
||||
"assets": {
|
||||
"host01": []
|
||||
}
|
||||
},
|
||||
"environment": {
|
||||
"uilayout": "terminal",
|
||||
"showdashboard": true,
|
||||
"dashboards": [
|
||||
{
|
||||
"name": "Web Port 80",
|
||||
"port": 80
|
||||
}
|
||||
]
|
||||
},
|
||||
"backend": {
|
||||
"imageid": "java",
|
||||
"environmentsprotocol": "http"
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
|
||||
|
||||
In this case, the user will resolve the HTTP 404 issue.
|
||||
|
||||
Visit: https://[[HOST_SUBDOMAIN]]-80-[[KATACODA_HOST]].environments.katacoda.com/a.txt
|
||||
|
||||
The result is:
|
||||
|
||||
```
|
||||
Something went wrong: 404 Not Found
|
||||
```
|
||||
|
||||
So which servlet is handle this request and returning 404?
|
||||
|
||||
### Trace all the Servlet methods
|
||||
|
||||
Start trace:
|
||||
|
||||
`trace javax.servlet.Servlet * > /tmp/servlet.txt`{{execute T2}}
|
||||
|
||||
Visit: https://[[HOST_SUBDOMAIN]]-80-[[KATACODA_HOST]].environments.katacoda.com/a.txt
|
||||
|
||||
In `Terminal 3`, view the contents of `/tmp/servlet.txt`:
|
||||
|
||||
`less /tmp/servlet.txt`{{execute T3}}
|
||||
|
||||
The contents of `/tmp/servlet.txt` will be more, and you need to be patient to find the longest level in the call tree.
|
||||
|
||||
It can be found that the request is handled by `freemarker`:
|
||||
|
||||
```
|
||||
`---[13.974188ms] org.springframework.web.servlet.ViewResolver:resolveViewName()
|
||||
+---[0.045561ms] javax.servlet.GenericServlet:<init>()
|
||||
+---[min=0.045545ms,max=0.074342ms,total=0.119887ms,count=2] org.springframework.web.servlet.view.freemarker.FreeMarkerView$GenericServletAdapter:<init>()
|
||||
+---[0.170895ms] javax.servlet.GenericServlet:init()
|
||||
| `---[0.068578ms] javax.servlet.GenericServlet:init()
|
||||
| `---[0.021793ms] javax.servlet.GenericServlet:init()
|
||||
`---[0.164035ms] javax.servlet.GenericServlet:getServletContext()
|
||||
```
|
@ -0,0 +1,6 @@
|
||||
|
||||
Through this tutorial, you can know how to Troubleshooting HTTP request returns 404. More advanced features can be found in the Advanced Guide below.
|
||||
|
||||
* [Arthas Advanced](https://arthas.aliyun.com/doc/arthas-tutorials?language=en&id=arthas-advanced)
|
||||
* [Arthas Github](https://github.com/alibaba/arthas)
|
||||
* [Arthas Documentation](https://arthas.aliyun.com/doc/en)
|
@ -0,0 +1,45 @@
|
||||
{
|
||||
"title": "Arthas Troubleshooting HTTP request returns 404",
|
||||
"description": "Arthas Troubleshooting HTTP request returns 404",
|
||||
"difficulty": "expert",
|
||||
"time": "10 minutes",
|
||||
"details": {
|
||||
"steps": [
|
||||
{
|
||||
"title": "Start demo",
|
||||
"text": "start-demo.md"
|
||||
},
|
||||
{
|
||||
"title": "Start arthas-boot",
|
||||
"text": "arthas-boot.md"
|
||||
},
|
||||
{
|
||||
"title": "Troubleshooting HTTP request returns 404",
|
||||
"text": "case-http-404.md"
|
||||
}
|
||||
],
|
||||
"intro": {
|
||||
"text": "intro.md"
|
||||
},
|
||||
"finish": {
|
||||
"text": "finish.md"
|
||||
},
|
||||
"assets": {
|
||||
"host01": []
|
||||
}
|
||||
},
|
||||
"environment": {
|
||||
"uilayout": "terminal",
|
||||
"showdashboard": true,
|
||||
"dashboards": [
|
||||
{
|
||||
"name": "Web Port 80",
|
||||
"port": 80
|
||||
}
|
||||
]
|
||||
},
|
||||
"backend": {
|
||||
"imageid": "java",
|
||||
"environmentsprotocol": "http"
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
|
||||
![Arthas](https://arthas.aliyun.com/doc/_images/arthas.png)
|
||||
|
||||
`Arthas` is a Java diagnostic tool open-sourced by Alibaba middleware team. Arthas helps developers in trouble-shooting issues in production environment for Java based applications without modifying code or restarting servers.
|
||||
|
||||
`Arthas` supports JDK 6+, supports Linux/Mac/Windows.
|
||||
|
||||
* Github: https://github.com/alibaba/arthas
|
||||
* Documentation: https://arthas.aliyun.com/doc/en
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
|
||||
|
||||
Download `demo-arthas-spring-boot.jar`, and start with `java -jar` command:
|
||||
|
||||
`wget https://github.com/hengyunabc/spring-boot-inside/raw/master/demo-arthas-spring-boot/demo-arthas-spring-boot.jar
|
||||
java -jar demo-arthas-spring-boot.jar`{{execute T1}}
|
||||
|
||||
`demo-arthas-spring-boot` is a simple Spring Boot demo, the source code here: [View](https://github.com/hengyunabc/spring-boot-inside/tree/master/demo-arthas-spring-boot)
|
||||
|
||||
After booting, access port 80: https://[[HOST_SUBDOMAIN]]-80-[[KATACODA_HOST]].environments.katacoda.com
|
||||
|
||||
![Demo Web](/arthas/scenarios/common-resources/assets/demo-web.png)
|
Loading…
Reference in New Issue