I have a Strange Isuue while using yguard obfuscator... I have some Jsp Files and some Normal Class Files in my code. I want to obfuscate the class files but because of a lot of these classes are imported and used in My jsp I had to precompile teh Jsps.
After Precompilation i tried to obfuscate the class files using the following kind of statement my ant file :-
<target depends="jar" name="yguard"> <taskdef name="yguard" classname="com.yworks.yguard.YGuardTask" classpath="yguard.jar"/> <!-- the following can be adjusted to your needs --> <yguard>
Assume that these paths are correct. When I try to run the above target i get teh following Stack Trace:-
Caused by: java.lang.ClassNotFoundException: com.wm.net.URLStreamHandlerFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:580) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at com.yworks.yguard.ObfuscatorTask$_g.resolve(Unknown Source) at com.yworks.yguard.obf.Cl.scanExtSupers(Unknown Source) at com.yworks.yguard.obf.Cl.scanNameSpaceExcept(Unknown Source) at com.yworks.yguard.obf.Cl.resolveOptimally(Unknown Source) at com.yworks.yguard.obf.ClassTree$4.classAction(Unknown Source) at com.yworks.yguard.obf.ClassTree.walkTree(Unknown Source) at com.yworks.yguard.obf.ClassTree.walkTree(Unknown Source) at com.yworks.yguard.obf.ClassTree.walkTree(Unknown Source) at com.yworks.yguard.obf.ClassTree.walkTree(Unknown Source) at com.yworks.yguard.obf.ClassTree.walkTree(Unknown Source) at com.yworks.yguard.obf.ClassTree.walkTree(Unknown Source) at com.yworks.yguard.obf.ClassTree.walkTree(Unknown Source) at com.yworks.yguard.obf.ClassTree.resolveClasses(Unknown Source) at com.yworks.yguard.obf.GuardDB.createMap(Unknown Source) at com.yworks.yguard.obf.GuardDB.remapTo(Unknown Source)
Please help me regarding the above.. As i tried finding the above class all over the places in google but was unable to do it.
Which JAR contains the missing class (com.wm.net.URLStreamHandlerFactory)? This is a complete guess because I have never used yguard, but I think you will have to add that JAR to the list of JARS in the <externalclasses> entry for the <yguard> task. [ July 07, 2008: Message edited by: Peter Johnson ]
So, the jsps were obfuscated as well and the war file worked?
Because I am using yGuard as well and I have major problems using it. I mean all the obfuscation of the class, configuration, and jsp files were good ,but when deploying on tomcat it shows: HTTP Status 404 : The requested resource (/myProject/login) is not available.
which means there is a big trouble, where the original war file without yguard thing works great in tomcat.
CAN YOU PLEASE ADVISE?