Java Web Start Console closes unexpectedly / Reading in data

Discussion in 'Java' started by ChrisC, Feb 2, 2007.

  1. ChrisC

    ChrisC Guest

    Hello,

    I'm trying to figure out a problem with deploying my Java Web Start
    application, but the console, that I have set to "Show" in the Java
    Control Panel, closes during the application start up (along with the
    application). There is something happening (I see something get
    printed to the console) but I can't read it.

    Any idea why the console would close? Can I force it to stay open or
    log it somehow?

    Further, I have an feeling my application cannot access some data
    files it's trying to read -- I put them in the JAR in the same
    (relative) folder they are in on my machine. The file reference in
    the program is relative... but now I'm thinking that the Web Start
    application is not actually looking in the JAR for the data files, but
    perhaps rather on the user's computer.

    How should I supply and read in a data file using Web Start?

    Thanks for any advice!

    Christopher
     
    ChrisC, Feb 2, 2007
    #1
    1. Advertising

  2. On Feb 2, 4:35 pm, "ChrisC" <> wrote:
    ...
    > I'm trying to figure out a problem with deploying my Java Web Start
    > application, but the console, that I have set to "Show" in the Java
    > Control Panel, ..


    (Good move, just as an aside. I have had some
    'many response' threads with people recently on
    the Sun web start forum, where I cold not even be
    sure they understood what a console was, let alone
    had it auto-show for any web start app. on their
    development machine.)

    >..closes during the application start up (along with the
    > application).


    Yes. I have expereinced web start applications
    crashing with no obvious console at all, but that
    was a deployment that involved an installer, which
    complicated matters.

    > There is something happening (I see something get
    > printed to the console) but I can't read it.


    ....hmmm. Try printing something big/distinct, like
    *************************************
    at the very beginning of the main() of the application,
    I suspect this deployment is not even getting that far.

    > Any idea why the console would close?


    Sh*t happens?

    >...Can I force it to stay open or
    > log it somehow?


    I think you can log it, or it automatically gets
    logged, but I have never had much involvement
    with logging.

    > Further, I have an feeling my application cannot access some data
    > files it's trying to read -- I put them in the JAR in the same
    > (relative) folder they are in on my machine. The file reference in
    > the program is relative... but now I'm thinking that the Web Start
    > application is not actually looking in the JAR for the data files, but
    > perhaps rather on the user's computer.


    As mentioned, I doubt it is even getting that far.
    It is rare that faults within the application
    will cause web start itself, to fail.

    My experience is that 90%+ of web start
    problems begin within the JNLP file.

    The JNLP for this application is?
    (paste content, or preferably URL to live version)

    Andrew T.
     
    Andrew Thompson, Feb 2, 2007
    #2
    1. Advertising

  3. ChrisC

    ChrisC Guest

    > As mentioned, I doubt it is even getting that far.
    > It is rare that faults within the application
    > will cause web start itself, to fail.


    I'm definitely seeing some of my debugging output appear and what
    looks like a stack trace before it disappears. I had some other
    problems before but they didn't cause the console to close so I was
    able to fix them.

    > The JNLP for this application is?
    > (paste content, or preferably URL to live version)


    .... I'm a bit embarrassed because this is my first Web Start attempt
    so it might be all wrong, but here it is:

    http://www.cs.utoronto.ca/~ccollins/projects/wne/wne.jnlp

    Thanks for looking into it and your comments.

    Chris
     
    ChrisC, Feb 2, 2007
    #3
  4. ChrisC

    ChrisC Guest

    Hi Andrew and whoever is reading,

    Off topic a bit, but I've seen in your other posts that you suggest
    always validating the JNLP against the DTD. I've also seen this
    elsewhere. I got the JDK 6 DTD from Sun, but for the next step I'm a
    bit lost. I searched "validate jnlp against dtd" and found nothing
    useful. I understand the concept of validation but is there some
    common tool to do it? Just looking up "validate XML" seems to reveal
    a bunch of software of doubtful quality.

    Chris
     
    ChrisC, Feb 2, 2007
    #4
  5. On Feb 2, 6:21 pm, "ChrisC" <> wrote:
    ...
    > > The JNLP for this application is?

    ...
    > http://www.cs.utoronto.ca/~ccollins/projects/wne/wne.jnlp


    I suggest this, in place of all the
    separate 'resources' elements.

    <!-- resources elements are commonly split up
    to provide specific resources to particular
    OS's, or for localisation data. Only one
    J2SE element will be parsed. 'onclick' is
    not a valid attribute for any JNLP element.
    -->
    <resources>
    <j2se
    href="http://java.sun.com/products/autodl/j2se"
    version="1.4+"
    initial-heap-size="256m"
    max-heap-size="1024m" />
    <jar href="wordnetexplorer.jar"/>
    <jar href="prefuse.jar"/>
    <jar href="jwnl.jar"/>
    <jar href="uio.jar"/>
    <jar href="utilities.jar"/>
    <jar href="commons-logging.jar"/>
    <jar href="tests.jar"/>
    </resources>

    Given it is an application that requests extended
    privileges, I take it that all your Jar's are signed?

    Also noting that no jar element has a
    main="true"
    attribute defined, the main() is in
    the first jar, with a manifest?
    (At 13.3 Meg, I am not about to download it!)

    Andrew T.
     
    Andrew Thompson, Feb 2, 2007
    #5
  6. ChrisC schrieb:

    >>As mentioned, I doubt it is even getting that far.
    >>It is rare that faults within the application
    >>will cause web start itself, to fail.

    >
    >
    > I'm definitely seeing some of my debugging output appear and what
    > looks like a stack trace before it disappears. I had some other
    > problems before but they didn't cause the console to close so I was
    > able to fix them.
    >
    >
    >>The JNLP for this application is?
    >>(paste content, or preferably URL to live version)

    >
    >
    > ... I'm a bit embarrassed because this is my first Web Start attempt
    > so it might be all wrong, but here it is:
    >
    > http://www.cs.utoronto.ca/~ccollins/projects/wne/wne.jnlp
    >
    > Thanks for looking into it and your comments.
    >

    When starting your JNLP-link I get the following console-output
    (and BTW: my console stays open after that).
    Does my stack trace look similar to yours?
    I have Java 1.5.0 installed and selected in the JNLP-runtime-settings of
    the Java Control Panel.

    Requesting URL: http://www.cs.utoronto.ca/~ccollins/projects/wne/wne.gif
    Exception in thread "javawsApplicationMain"
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at com.sun.jnlp.JNLPClassLoader.defineClass(Unknown Source)
    at com.sun.jnlp.JNLPClassLoader.access$100(Unknown Source)
    at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.sun.jnlp.JNLPClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getMethod0(Unknown Source)
    at java.lang.Class.getMethod(Unknown Source)
    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(Unknown Source)


    --
    Thomas
     
    Thomas Fritsch, Feb 2, 2007
    #6
  7. On Feb 2, 9:53 pm, Thomas Fritsch <>
    wrote:
    > ChrisC schrieb:


    > >http://www.cs.utoronto.ca/~ccollins/projects/wne/wne.jnlp

    ...
    > When starting your JNLP-link I get the following console-output

    ....
    > Requesting URL:http://www.cs.utoronto.ca/~ccollins/projects/wne/wne.gif
    > Exception in thread "javawsApplicationMain"
    > java.lang.UnsupportedClassVersionError: Bad version number in .class file


    Why would web start(/the JVM) be checking
    the 'class version number' for a gif? Is that
    what is happening? That seems very odd.

    Andrew T.
     
    Andrew Thompson, Feb 2, 2007
    #7
  8. On Feb 2, 6:53 pm, "ChrisC" <> wrote:
    > Hi Andrew and whoever is reading,
    >
    > Off topic a bit, but I've seen in your other posts that you suggest
    > always validating the JNLP against the DTD. I've also seen this
    > elsewhere. I got the JDK 6 DTD from Sun, but for the next step I'm a
    > bit lost. I searched "validate jnlp against dtd" and found nothing
    > useful. I understand the concept of validation but is there some
    > common tool to do it? Just looking up "validate XML" seems to reveal
    > a bunch of software of doubtful quality.


    I understand your quandry, I usually use an
    ant based task to do it, but have been meaning
    to look into making a little 'validate this against
    that' type application..

    Do you run ant?
    What IDE are you using (if any)?

    Andrew T.
     
    Andrew Thompson, Feb 2, 2007
    #8
  9. ChrisC wrote:
    > I'm definitely seeing some of my debugging output appear and what
    > looks like a stack trace before it disappears. I had some other
    > problems before but they didn't cause the console to close so I was
    > able to fix them.
    >
    >
    >>The JNLP for this application is?
    >>(paste content, or preferably URL to live version)

    >
    >
    > ... I'm a bit embarrassed because this is my first Web Start attempt
    > so it might be all wrong, but here it is:
    >
    > http://www.cs.utoronto.ca/~ccollins/projects/wne/wne.jnlp

    Your "wordnetexplorer.jar" ("RMwordnetexplorer.jar" in my javaws cache)
    seems to have a corrupted "manifest.mf". All long lines are wrapped
    after ~70 characters, for example:

    Name: ca/utoronto/cs/wordnetexplorer/prefuse/layout/WordNetRadialTreeL
    ayout.class
    SHA1-Digest: YsTJqsboxr7FLlqrxYKtTa7Ep0Q=

    I don't know whether this may be the cause of your posted problem or yet
    another problem.

    --
    Thomas
     
    Thomas Fritsch, Feb 2, 2007
    #9
  10. Andrew Thompson wrote:
    > On Feb 2, 9:53 pm, Thomas Fritsch <>
    > wrote:
    >
    >>ChrisC schrieb:

    >
    >
    >>>http://www.cs.utoronto.ca/~ccollins/projects/wne/wne.jnlp

    >
    > ..
    >
    >>When starting your JNLP-link I get the following console-output

    >
    > ...
    >
    >>Requesting URL:http://www.cs.utoronto.ca/~ccollins/projects/wne/wne.gif
    >>Exception in thread "javawsApplicationMain"
    >>java.lang.UnsupportedClassVersionError: Bad version number in .class file

    >
    >
    > Why would web start(/the JVM) be checking
    > the 'class version number' for a gif? Is that
    > what is happening? That seems very odd.

    I don't think these 2 lines (requesting gif, Exception) are related in
    any way.
    (1) JavaWS just logs the request for the gif (the icon specified in the
    JNLP, btw). JavaWS always does so, even when no error occurs.
    (2) Later, when loading a .class file, an UnsupportedClassVersionError
    happens. Unfortunately the name of the causing .class file is not reported.

    --
    Thomas
     
    Thomas Fritsch, Feb 2, 2007
    #10
  11. Thomas Fritsch wrote:
    > Your "wordnetexplorer.jar" ("RMwordnetexplorer.jar" in my javaws cache)
    > seems to have a corrupted "manifest.mf". All long lines are wrapped
    > after ~70 characters, for example:
    >
    > Name: ca/utoronto/cs/wordnetexplorer/prefuse/layout/WordNetRadialTreeL
    > ayout.class
    > SHA1-Digest: YsTJqsboxr7FLlqrxYKtTa7Ep0Q=
    >

    Forget my post! The wrapped lines are OK according to the JAR file spec.

    <quote>
    No line may be longer than 72 bytes (not characters), in its
    UTF8-encoded form. If a value would make the initial line longer than
    this, it should be continued on extra lines (each starting with a single
    SPACE).
    </quote>

    --
    Thomas
     
    Thomas Fritsch, Feb 2, 2007
    #11
  12. ChrisC

    ChrisC Guest

    Hello,

    sorry for the slow response -- I still didn't figure out my Web Start
    woes yet, but regarding validation:

    > Do you run ant?


    No, not right now I don't.

    > What IDE are you using (if any)?


    Eclipse 3.2.1.

    Chris
     
    ChrisC, Feb 7, 2007
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    518
    Patrice
    Feb 22, 2007
  2. James
    Replies:
    5
    Views:
    1,764
    Maett
    Oct 13, 2005
  3. Replies:
    4
    Views:
    507
    Jim Langston
    Feb 25, 2008
  4. Johnson

    Visual Studio Closes Unexpectedly

    Johnson, Nov 4, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    1,868
    David Wang
    Nov 6, 2008
  5. Gonzalo Rubio

    reading binary data stops unexpectedly

    Gonzalo Rubio, Mar 5, 2006, in forum: Ruby
    Replies:
    2
    Views:
    98
    Gonzalo Rubio
    Mar 5, 2006
Loading...

Share This Page