Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem to set classpath

 
sitansu dey
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I want to create a downloadable application using Java Web Start. The application needs some third party jar to be set in the classpath. How can I do it? What should I write in the jnlp file to set the classpath?
Please help.
Sitansu
 
Bill Liteplo
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you include the third party jar with your webstart download, you use

for example. If you don't include the third party jar but expect users to already have it, then I'm not sure, sorry.
Bill
 
sitansu dey
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is the code what I have written in my jnlp file.
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://www.ePeers.com/" href="test.jnlp">
<information>
<title>ePeers Application</title>
<vendor>Tata Consultancy Services</vendor>
<homepage href="http://www.ePeers.com/test.html"/>
<description>ePeers Application</description>
<description kind="short">A Peer to Peer Application.</description>
<icon href="images/icon.gif"/>
<offline-allowed/>
</information>
<resources>
<j2se version="1.3"/>
<jar href="test.jar" main="true" download="eager"/>
<jar href="lib/jxta.jar" main="false" download="eager"/>
</resources>
<application-desc main-class="com.Test"/>
</jnlp>
I am using Apache server. I have placed jxta.jar inside Apache Group\Apache\htdocs\lib directory and test.jar inside Apache Group\Apache\htdocs directory.
Now when I am trying to launch the application using java web start, the files RTtest.jar, RCtest.jar, RMtest.jar, ALtest.jnlp, ATtest.jnlp, AMtest.jnlp are copied in C:\Documents and settings\Administrator\.javaw\cache\http\Dwww.ePeers.com\P80 directory and the files RCjxta.jar, RMjxta.jar, RTjxta.jar are copied inside C:\Documents and settings\Administrator\.javaw\cache\http\Dwww.ePeers.com\P80\DMlib directory.
After that it is showing unable to launch the application with the following informations.
General:
An error occurred while launching/running the application.
Title: ePeers Application
Vendor: Tata Consultancy Services
Category: Unexpected Error
Environment incorrectly intialized.
Exception:
java.lang.IllegalStateException: Environment incorrectly intialized.
at net.jxta.peergroup.NetPeerGroupID.getURL(PeerGroupID.java:169)
at net.jxta.id.ID.toString(ID.java:146)
at com.Test.main(Test.java:8)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Thread.java:484)

This is my java code.
package com;
import net.jxta.impl.id.UUID.PeerGroupID;
public class Test
{
public static void main(String args[])
{
System.out.println("This is a test program.");
System.out.println("TEST ID:"+PeerGroupID.defaultNetPeerGroupID.toString());
}
}
In the java console I am getting output from the first line. But it is giving exception at the second line. The program is running successfully from the command prompt.
It seems that it is not loading jxta.jar
please help.
sitansu
 
Bill Liteplo
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, my understanding of JXTA only runs wafer deep.
It looks like the defaultNetPeerGroupID member of PeerGroupID is not being intialized. Perhaps this is a bug in their code, but maybe you need to properly constuct the PeerGroupID object. I don't know if these things are static or not.
Good luck,
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic