Commit ca19ab0
committed
fix(agent): Support running agent on bootstrap classpath
- Update `Agent.java` to use `Agent.class.getResource()` instead of
`Agent.class.getClassLoader().getResource()` when locating the agent JAR.
This prevents a `NullPointerException` when the agent is loaded by the
bootstrap class loader (where `getClassLoader()` returns null).
- Modify `Properties.java` to automatically default `appmap.debug.disableGit`
to `true` if the agent is running on the bootstrap classpath. This avoids
crashes in JGit initialization, which relies on `ResourceBundle` loading
that is problematic in the bootstrap context.
- Add a warning log in `Agent.premain` when running on the bootstrap
classpath, advising that this configuration is for troubleshooting only.1 parent 5efd73f commit ca19ab0
File tree
2 files changed
+20
-5
lines changed- agent/src/main/java/com/appland/appmap
- config
2 files changed
+20
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| |||
162 | 166 | | |
163 | 167 | | |
164 | 168 | | |
165 | | - | |
166 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
167 | 176 | | |
168 | 177 | | |
169 | | - | |
170 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
171 | 181 | | |
172 | 182 | | |
173 | 183 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
0 commit comments