RE: Adding a URL to the ClassPath
"Yemi D. Bedu" <yemi-DnQzskBZRmpWk0Htik3J/[email protected]> Mon, 2 May 2005 11:11:27 -0400
| Newsgroups | gmane.comp.java.beanshell.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I think that you need to make sure that this is the classpath
associated with baseURL of the applet. So if the applet loaded from
10.0.0.1/applets/, then all other classes are rooted from there and
10.0.0.1/applets2/ would not work.
-----Original Message-----
From: beanshell-developers-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:beanshell-developers-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of
Stephen Engwicht
Sent: Friday, April 29, 2005 5:52 PM
To: beanshell-developers
Subject: [Beanshell-dev] Adding a URL to the ClassPath
Hi,
I am new to BeanShell so I hope this is not a silly question but I don't
know where else to find info on my problem.
I have embedded the BeanShell interpreter into an applet using
interactive run mode with JConsole. What I am trying to
achieve is to access dynamically created and modified classes and jar
files on the server. As I am developing and testing
on the server, I have been able to add the files to the ClassPath
successfully using addClassPath() with an absolute path
to the files (ie "c:/ServerDirectory/subdirectory"). This works but will
not allow remote access to the new files.
I have tried to add the new files to the ClassPath using
addClassPath(new URL("http://10.1.1.4:8080/ELPv4/test"));
I have printed out the ClassPath and the new url is there;
bsh %> print(getClassPath());
java.net.URL []: {
file:/C:/Program Files/Java/jre1.5.0_01/classes,
file:/C:/Program%20Files/Java/jre1.5.0_01/lib/rt.jar,
http://10.1.1.4:8080/ELPv4/test,
}
but I am unable to access the class in that directory.
I can browse to the directory using my browser, so the file is definitly
accessable from the server. I tried reloadClasses()
and also import *; When BeanShell maps the ClassPath it produces the
following message in the java console;
Start ClassPath Mapping
Not a classpath component: /C:/Program Files/Java/jre1.5.0_01/classes
Mapping: Archive: file:/C:/Program%20Files/Java/jre1.5.0_01/lib/rt.jar
Not a classpath component: /ELPv4/test
End ClassPath Mapping
It seems to have truncated the url to "/ELPv4/test". I don't know what
else to try so any ideas would be appreciated.
Thanks Stephen Engwicht.
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events,
4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Beanshell-developers mailing list
Beanshell-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/beanshell-developers
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r