Results 1 to 16 of 16
  1. #1
    wanda is offline Member
    Join Date
    Feb 2013
    Posts
    9
    Rep Power
    0

    Default JNLP for using Java web start

    Hi i have developed a swing application and have packaged it into a jar called test.jar. I have created a jnlp file
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="file:///homes/rm3710/SelfAssessment" href="selfAssessment.jnlp">
    <information>
    <title>My app</title>

    <offline-allowed/>
    </information>
    <resources>
    <!-- Application Resources -->
    <j2se version="1.6+" href=
    "http://java.sun.com/products/autodl/j2se"/>
    <jar href="test.jar"/>

    </resources>
    <application-desc
    name="My Application"
    main-class="MyApplication">
    </application-desc>

    </jnlp>
    However when i try to launch it by runnig the jnlp file i get an error saying
    Caused by:
    java.lang.ClassNotFoundException: logic.MyApplication
    at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadC lass(JNLPClassLoader.java:1401)
    at net.sourceforge.jnlp.Launcher.launchApplication(La uncher.java:574)
    at net.sourceforge.jnlp.Launcher$TgThread.run(Launche r.java:889)

    Please help what to do

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default Re: JNLP for using Java web start

    Does that class exist in test.jar, in the correct place?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    wanda is offline Member
    Join Date
    Feb 2013
    Posts
    9
    Rep Power
    0

    Default Re: JNLP for using Java web start

    The class MyApplication exists in the jar file test.jar which i created by using the command jar cf test.jar [input file names]. However when i developed this application in eclipse i had placed all classes under the package logic. The test.jar has only the classes. Should it have a folder logic within which all the classes should be present?

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default Re: JNLP for using Java web start

    You need to jar up the class structure, which includes their package directories.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    wanda is offline Member
    Join Date
    Feb 2013
    Posts
    9
    Rep Power
    0

    Default Re: JNLP for using Java web start

    Hi, Thank you for your response. I have been able to launch the application now. However in my application. There is a ceratin interaction with a database. I do not see the database interaction working properly. Could using jnlp have an effect with this?

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default Re: JNLP for using Java web start

    What error are you getting?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    wanda is offline Member
    Join Date
    Feb 2013
    Posts
    9
    Rep Power
    0

    Default Re: JNLP for using Java web start

    I dont get errors, it is just that i have a log in page, where the username once entered will be looked up in the database. The application launched through Java web start never finds the user. Hence i concluded that it is not using the database. I developed the project in eclipse where i had used a postgresql referenced library. I ahve exported it into the jar as well. But it does not work.

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default Re: JNLP for using Java web start

    You'll need to stick some logging in it to see what's going on.
    Does postgres work embedded?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    wanda is offline Member
    Join Date
    Feb 2013
    Posts
    9
    Rep Power
    0

    Default Re: JNLP for using Java web start

    in eclipse i just had the postgresql jar in the referenced library. and i had code in the classes to set up a connection with the database and retrieve the information.

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default Re: JNLP for using Java web start

    What database though?
    Where is the physical database?

    The logging thing still applies, though.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  11. #11
    wanda is offline Member
    Join Date
    Feb 2013
    Posts
    9
    Rep Power
    0

    Default Re: JNLP for using Java web start

    This is the database provided to me by my university. i access it within the university network. its a postgresql database.

  12. #12
    wanda is offline Member
    Join Date
    Feb 2013
    Posts
    9
    Rep Power
    0

    Default Re: JNLP for using Java web start

    DO i need to add some code to the jnlp to specify the use of the PostgreSQL JDBC driver that is packaged as a jar into the test.jar?

  13. #13
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,240
    Rep Power
    19

    Default Re: JNLP for using Java web start

    Quote Originally Posted by wanda View Post
    ... packaged as a jar into the test.jar?
    Java doesn't support nested jars.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  14. #14
    wanda is offline Member
    Join Date
    Feb 2013
    Posts
    9
    Rep Power
    0

    Default Re: JNLP for using Java web start

    I have generated the test.jar from eclipse using export as runnable jar. and it includes a folder called org within which the postgresql JDBC Driver package is placed. When i run this jar from the terminal using java -jar test.jar it works fine. But it does not work using Java web start.

  15. #15
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default Re: JNLP for using Java web start

    I suspect you need to list it in your <resources> tag in the jnlp.
    That tells the client PC that it needs to download the jar file as well.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  16. #16
    wanda is offline Member
    Join Date
    Feb 2013
    Posts
    9
    Rep Power
    0

    Default Re: JNLP for using Java web start

    Thank you very much . i will try this.

Similar Threads

  1. JNLP(Java Network Launching Protocol)
    By mitra in forum Networking
    Replies: 0
    Last Post: 07-28-2011, 01:48 PM
  2. Replies: 1
    Last Post: 01-18-2011, 06:27 PM
  3. Replies: 0
    Last Post: 04-28-2010, 03:33 PM
  4. Replies: 5
    Last Post: 03-20-2009, 10:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •