Trouble with Dynamic Compilation in Tomcat
I have some code that is dynamically generating Java classes and compiling them based on reflection against existing, but arbitrary, classes.
My code is:
com.sun.tools.javac.Main.compile(new String[] { "-d", classDirectory, src.getAbsolutePath() });
And it works just fine under Orion.
Under Tomcat, however, it fails to find any of the classes in the web application's classpath.
While I know I can pass in the -classpath argument, I have no way in this library of knowing what the classpath should be since the classes I am operating on are arbitrary.
Any thoughts on how I get one of the following to happen:
a) the compiler leverage the classpath available to the web application
OR
b) identify what the current classpath is so I can pass it to the compiler
Solutions that rely on tomcat-specific calls won't work as the solution needs to be cross app server/
Thanks

