Changes for page Debugging
Last modified by Simon Urli on 2023/10/10 11:46
From version 37.2
edited by Vincent Massol
on 2018/01/23 17:44
on 2018/01/23 17:44
Change comment:
There is no comment for this version
To version 38.1
edited by Vincent Massol
on 2019/03/23 19:28
on 2019/03/23 19:28
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -254,6 +254,35 @@ 254 254 ... 255 255 {{/code}} 256 256 257 +=== Troubleshooting === 258 + 259 +==== NoClassDefFoundError: com/sun/tools/attach/AttachNotSupportedException ==== 260 + 261 +If you get the following exception, it can mean that you're on Mac and that your ##tools.jar## is not added to the classpath. Apparently ##bminstall.sh## thinks that if you're on Mac then you don't need ##tools.jar## which is apparently wrong nowadays. 262 + 263 +{{code language='none'}} 264 +Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/attach/AttachNotSupportedException 265 + at java.lang.Class.getDeclaredMethods0(Native Method) 266 + at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) 267 + at java.lang.Class.privateGetMethodRecursive(Class.java:3048) 268 + at java.lang.Class.getMethod0(Class.java:3018) 269 + at java.lang.Class.getMethod(Class.java:1784) 270 + at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544) 271 + at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526) 272 +Caused by: java.lang.ClassNotFoundException: com.sun.tools.attach.AttachNotSupportedException 273 + at java.net.URLClassLoader.findClass(URLClassLoader.java:382) 274 + at java.lang.ClassLoader.loadClass(ClassLoader.java:424) 275 + at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) 276 + at java.lang.ClassLoader.loadClass(ClassLoader.java:357) 277 + ... 7 more 278 +{{/code}} 279 + 280 +In this case, edit ##bminstall.sh## and add the following line below the ##OS=`uname`## line in order to override it: 281 + 282 +{{code language='none'}} 283 +OS=whatever 284 +{{/code}} 285 + 257 257 = Debugging JavaScript = 258 258 259 259 The solution is to use a Browser add-on for inspecting JavaScript and putting breakpoints in it. The issue is that by default the XWiki build will minify and aggregate JavaScript files for performance reasons.