Downloaded JARs location

In order to put a webstart enabled release of Jext 3.0 (www.jext.org), I need to make Jython (www.jython.jar) be able to load the classes from jext.jar. But Jython cannot load'em since it cannot find jext.jar in the classpath when started by Java WebStart.

How can I programmatically determine the download jext.jar full path ?

[348 byte] By [jext] at [2007-9-26 4:18:37]
# 1

I assume you're planning on distributing both jext and jython? If so, create a JNLP file for jython with the <component-desc/> tag and then reference that resource from jext's JNLP file with an <extension> tag. For example:

<resources>

<j2se version="1.3+"/>

<jar href="jext.jar"/>

<extension name="Jython" href="jython.jnlp">

</extension>

</resources>

jkallay at 2007-6-29 17:20:40 > top of Java-index,Desktop,Deploying...
# 2
Thanks a lot for this tip. I'll give it a try and tell you if it works :)
jext at 2007-6-29 17:20:40 > top of Java-index,Desktop,Deploying...
# 3

It does not work. The problem remains the same: jython.jar and jext.jar are downloaded but when jython gets inited by Jext, it cannot load Jext classes since it cannot find jext.jar in classpath. I know I could force Jext loading within jython but the jython methods which achieve this need the full path to jext.jar...

jext at 2007-6-29 17:20:40 > top of Java-index,Desktop,Deploying...
# 4

> It does not work. The problem remains the same:

> jython.jar and jext.jar are downloaded but when jython

> gets inited by Jext, it cannot load Jext classes since

> it cannot find jext.jar in classpath.

classpath has no real meaning for execution under Web Start. Access to resources and classes is not file centric anymore, but web centric. No more path - URLs!

Some pitfalls I stumbled over, while making our application Web Start runnable:

- executing a java program from a .jar file is already different from executing from the raw .class files: on a Win32 box, a getResource("About.gif")

was issued, but the file was named "about.gif" on the disk. The class loader used by direct execution on the .class files did not complain, obviously it was case insensitive, but when I rolled a .jar and executed the program from the .jar, the classloader involved here

was not able to find the resource, so it is case sensitive.

A "..\menus.dtd" in some property was also slipping through under Win32 but caused trouble under Linux.

- executing a java programm from Web Start means not only executing from the .jar, but also additional trouble with setting the appropriate class loader. Web Start must take in classes that reside in some system location on the disk (e.g. awt classes) but on the other hand must take in classes from the .jars it just beamed over the wire into its cache locations. The usual cure here is to determine the class loader, and to use it explicitly when taking in some resource.

- sometimes one has to tell certain parts to use a different class loader too, like the UIManager:

http://forum.java.sun.com/thread.jsp?forum=38&thread=71561

There is certainly more. At the moment I'm struggling with beaming java3d (thus native libs too) over Web Start. The example that worked perfectly last week suddenly did not run anymore. I have not found what this causes, yet.

Regards,

Marc

van.woerkom at 2007-6-29 17:20:41 > top of Java-index,Desktop,Deploying...
# 5
I do not have this kind of problems with my own Jext since I always used lower case resource files, called using getResourceAsStream() stuff. I guess i'll have to get deep in Jython source code :)
jext at 2007-6-29 17:20:41 > top of Java-index,Desktop,Deploying...
# 6

> I do not have this kind of problems with my own Jext

> since I always used lower case resource files, called

> using getResourceAsStream() stuff.

Did you change all

getResourceAsStream()

calls into

cl.getResourceAsStream()

calls?

Regards,

Marc

van.woerkom at 2007-6-29 17:20:41 > top of Java-index,Desktop,Deploying...
# 7
Those calls work. It is only jython which cannot find the Jext classes :(
jext at 2007-6-29 17:20:41 > top of Java-index,Desktop,Deploying...
# 8
What JRE do you use?I just found out that the 1.3.0_02 JRE is buggy (not able to load the native Java3D libs I fed it with),JRE 1.3.1 works fine.Regards,Marc
van.woerkom at 2007-6-29 17:20:41 > top of Java-index,Desktop,Deploying...
# 9
I use JRE 1.3.1.
jext at 2007-6-29 17:20:41 > top of Java-index,Desktop,Deploying...
# 10
What OS? (I used Win32)Regards,Marc
van.woerkom at 2007-6-29 17:20:41 > top of Java-index,Desktop,Deploying...
# 11
Windows 2000 SP2
jext at 2007-6-29 17:20:41 > top of Java-index,Desktop,Deploying...
# 12
I would like to understand that kind of problem better. Can you provide me with your source? Regards,Marc
van.woerkom at 2007-6-29 17:20:41 > top of Java-index,Desktop,Deploying...
# 13
Yup, go on www.jext.org/dev.html and download the sources package, they're time stamped from yesterday. Concerning the JNLP file, just go to www.jext.org/webstart.html
jext at 2007-6-29 17:20:41 > top of Java-index,Desktop,Deploying...
# 14
I didn't understand before what you were trying to do, since I didn't realize what Jython was. I take it you're using Jython to allow the user to script Jext's behavior? Does it require the CLASSPATH environment variable to be set?
jkallay at 2007-6-29 17:20:41 > top of Java-index,Desktop,Deploying...
# 15
It looks for JARs into classpath. Moreover, Jython is used in Jext core !!
jext at 2007-7-1 10:50:58 > top of Java-index,Desktop,Deploying...