I have a application war bundled with class files which we deploy into tomcat. I will be deploying the application at client location server where different people will have access to it.
I want the code to be safe so that nobody can view the class files using class decompiler. I am not much interested in obfuscation as it will make logging difficult and this will involve changing non-java resource files(as class names,variable and methods are updated). I have searched other options like making class files inside the war encrypted and then write a custom class loader which will decrypt the classes at rum time and load the classes.
I am able to write a custom classloader which will read a jar file and load the classes http://kalanir.blogspot.in/2010/01/how-to-write-custom-class-loader-to.html
But I am not able to find how this will work with tomcat. Also do we have any tutorial to explain how we can encrypt a class file, a custom class loader which will decrypt this class, configure the custom class loader so that when my application runs in tomcat it should be able to load the required classes.