Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 9254 invoked from network); 14 Sep 2000 23:11:09 -0000 Received: from mercury.sun.com (192.9.25.1) by locus.apache.org with SMTP; 14 Sep 2000 23:11:09 -0000 Received: from taller.eng.sun.com ([129.144.174.34]) by mercury.Sun.COM (8.9.3+Sun/8.9.3) with ESMTP id QAA03474 for ; Thu, 14 Sep 2000 16:11:09 -0700 (PDT) Received: from eng.sun.com (d-ucup02-124-239 [129.144.124.239]) by taller.eng.sun.com (8.9.3+Sun/8.9.3/ENSMAIL,v1.7) with ESMTP id QAA19672 for ; Thu, 14 Sep 2000 16:11:08 -0700 (PDT) Message-ID: <39C15B85.ED5289D0@eng.sun.com> Date: Thu, 14 Sep 2000 16:13:09 -0700 From: "Pier P. Fumagalli" Reply-To: pier.fumagalli@eng.sun.com Organization: Sun Microsystems, Inc. X-Mailer: Mozilla 4.73 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: cocoon-dev@xml.apache.org Subject: Re: WEB-INF classloading and on the fly compilation References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Vadim Gritsenko wrote: > > Sources are available at www.sun.com; and even if they would be unavailable > there are tools like JAD. > > You just need to inherit ( or re-write ) from sun.tools.javac.Main and > replace call > > // Create our Environment. > BatchEnvironment env = BatchEnvironment.create(out, > sourcePathArg, > classPathArg, > sysClassPathArg, > extDirsArg); > > with something like this: > > BatchEnvironment env = new BatchEnvironment(out, srcClassPath, > binClassPath); > > where srcClassPahth and binClassPath - instances of your class which > inherits from ClassPath, > and this new ClassPath should load classes from where you want - from file > system, RDBMS, network, ... BUT... From my WEB-APP I don't know where the JARs I place in WEB-INF/lib are... They cannot even be on the filesystems... The problem when compiling is basically resolving "import ...;" statements in java code of classes included WITHIN the WEB-APP... There's no portable way of doing that... The only solution would be to have a compiler that, instead of relying on files, could rely on Class object instances as loaded by the classloader... Pier