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 4393 invoked from network); 14 Sep 2000 23:03:52 -0000 Received: from hnssysa.hns.com (139.85.76.100) by locus.apache.org with SMTP; 14 Sep 2000 23:03:52 -0000 Received: from hzhaopc7 (HZHAOPC7-1.md.hns.com [139.85.161.163]) by hnssysa.hns.com (8.9.0/8.8.7) with SMTP id TAA03693; Thu, 14 Sep 2000 19:03:25 -0400 (EDT) From: "Vadim Gritsenko" To: , Subject: RE: WEB-INF classloading and on the fly compilation Date: Thu, 14 Sep 2000 19:02:48 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <39C155BF.8CD72AED@eng.sun.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N 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 - I don't know where to get sources for OS - sorry! :) Vadim > -----Original Message----- > From: Pier P. Fumagalli [mailto:pier.fumagalli@eng.sun.com] > Sent: Thursday, September 14, 2000 6:49 PM > To: tomcat-dev@jakarta.apache.org > Cc: Stefano Mazzocchi; cmanolache@yahoo.com; > pier@betaversion.org; cocoon-dev@xml.apache.org > Subject: Re: WEB-INF classloading and on the fly compilation > > > cmanolache@yahoo.com wrote: > > > > On Thu, 14 Sep 2000, Stefano Mazzocchi wrote: > > > > > cmanolache@yahoo.com wrote: > > > > > > > > :-) > > > > > > > > You could also find the webapp root ( getRealPath("/") ) > and compute the > > > > classpath yourself - but I would say this is worse, since > you'll rely on a > > > > run-time directory structure that may not exist ( again, > war file format > > > > is a deployment format, not a run-time format ). > > > > > This works _ONLY_ if classloading is performed thru files... what > > > happens if I have a NetworkClassLoader a JDBCClassLoader or a > > > OnTheFlyAssembledClassLoader? no compiler existing today (I > just checked > > > ALL the existing java compiler I could find!) would be able to compile > > > against classes loaded thru a classloader. > > > > One would argue that compilation should happen at deployment, not at > > runtime. > > Let's get real... More and more we're using on the fly compilation > because it has been proven to be an effective techniques... Now you're > saying that I can't do it within a servlet? And just because the > compiler works in a different way? > > > > everything, ranging from a database to a compiler... so you don't go > > > shopping for tons of jar, but you just drop the WAR on the webapp > > > folder and you're done. Period. > > > > > > The WAR packages were created for that right? Good, but this idea is > > > broken by the fact that all existing java compilers assume > that classes > > > are loaded from disk. > > > > You may have additional problems - even if you include a javac > compiler in > > your WAR, the sandbox will not allow you to use it too much. > Some servers > > may care about security ( well, I'm dreaming, nobody cares about that > > today :-). > > What Cocoon does today is to write the JAVA files in the servlet work > directory (and I believe that's given in the specs), and perform a bunch > of security-legal operations (like constructing a ClassLoader with the > WEB-APP classloader as a parent... blablabla)... > The only "security constraint" such a WEB-APP would require is to be > able to construct a classloader, and work in the work directory (even > if this last one can be avoided, doing basically everything in > memory)... > > > > Damn, now I need to write a java compiler :( > > > > Maybe an OS too - all those existing OSes that are using this bad > > filesystem concept ... :-) > > We can hack them, though... If we have the sources.... :) :) :) > > Pier