Re: Problems with addClassPath() and access control permissions

Helio Perroni Filho <xperroni-/[email protected]> Sun, 30 Apr 2006 17:00:59 +0000 (GMT)
Newsgroups gmane.comp.java.beanshell.devel
Message-ID <[email protected]>
--- Helio Perroni Filho <xperroni-/[email protected]> escreveu:

> > Not sure here. Sounds like a bug the way you
> > describe it. Just to aid someone else as I don't
> > know:
> > 
> > Do you mean you are calling like:
> > addClassPath("somejar.jar");
> > addClassPath("anotherjar.jar");
> > 
> > and only somejar.jar is being added?
> 
> Yes. I've been doing some debugging already, and so
> far it seems that BshClassLoader.addURL() is called
> only for the first JAR file -- even though, at the
> script level, addClassPath() does get called for the
> following ones.

My fault actually. Contrary to what I said,
BshClassLoader.addURL() does get called for all
script-level addClassPath() invokations. The real
problem lies elsewhere.

You see, I am using BeanShell to write build scripts
for a small project of mine. So I was doing something
like:

addClassPath("path_to/tools.jar");
addClassPath("path_to/project_depends1.jar");
addClassPath("path_to/project_depends2.jar");

com.sun.tools.javac.Main.compile(buildArgs);

Which resulted in a lot of "class not found" errors
for the classes contained in the dependency JAR files.
It took me a while to realize that addClassPath()
feeds BeanShell's Base Loader, and that javac never
touches that. Passing the paths to the JAR files as
arguments to javac solved the problem.

Sorry folks, and thanks for your time.

-- 
Ja mata ne.
Helio



		
_______________________________________________________ 
Abra sua conta no Yahoo! Mail: 1GB de espaço, alertas de e-mail no celular e anti-spam realmente eficaz. 
http://br.info.mail.yahoo.com/


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642