puniverse / comsat

Fibers and actors for web development
docs.paralleluniverse.co/comsat
Other
598 stars 103 forks source link

Standalone Tomcat's instrumenting fails to load at obfuscated classes #44

Closed Altaflux closed 8 years ago

Altaflux commented 8 years ago

Without exact information about the reasons it looks like some obfuscated classes when being loaded by the QuasarWebAppClassLoader fail to be parsed, not because Quasar cannot instrument them, but because their names are not parse-able correctly and fail with StringIndexOutOfBoundsException which fully stops the web application from starting.

On line 72 of QuasarWebAppClassLoader : if (entry != null && path.endsWith(".class") && entry.binaryContent != null) { String className = name.substring(0, name.length() - ".class".length());

This are the parameters used. name=d.a path=d/a.class manifestRequiere=true

The condition checks if the path contains the ".class" word but the name does not contains it. As this condition is outside the try catch block it stops the startup of the application as the exception propagates.

circlespainter commented 8 years ago

Sorry for the delay, thanks, I'll have a look at it soon.

Altaflux commented 8 years ago

Thanks for taking a look, unluckily I cannot send you the library we are using that triggers the problem as it is third party proprietary but I can help testing it to see if it resolves the issue.

circlespainter commented 8 years ago

Can you check if it still happens with the tip of the fix-44 branch? There's also a 0.7.0-SNAPSHOT published on SonaType that includes this robustnesess (tentative) fix.

Altaflux commented 8 years ago

@circlespainter Hi, Snaphot 0.7.0-Snapshot did the trick and now it can load the obfuscated classes correctly.

Thanks a lot!