1 2 Previous Next 20 Replies Latest reply: Oct 3, 2011 4:32 AM by Umer RSS

    JWS Beginner question

    Umer
      Hi

      I have studied JWS app development guidelines. Currently i am trying to run a sample application using JWS but when i clicks on the lunch button the browser prompt for either open it or save it when i click open then it opens the related .jnlp file and when clicks on save then browser saves it, instead of launching the application.

      Lunch button is a hyper link within web page.

      I am using:
      windows 7
      java 1.6

      Here are code:

      Test App.html:
      <HTML>
      <head>
      </head>
      <body>
           <a href="myJNLP.jnlp">Launch</a>
      </body>
      </HTML>
      myJNLP.jnlp:
      <?xml version="1.0" encoding="UTF-8"?>
      <jnlp spec="1.0+" 
          codebase="http://download.oracle.com/javase/tutorialJWS/deployment/webstart/ex6/webstart_ComponentArch_DynamicTreeDemo" 
          href="TableTest.jar">
          <information>
              <title>Table Rows delete</title>
              <vendor>Umer</vendor>
          </information>
          <resources>
              <!-- Application Resources -->
              <j2se version="1.6+"
                    href="http://java.sun.com/products/autodl/j2se"/>
              <jar href="TableTest.jar" main="true" />
      
          </resources>
          <application-desc
               name="Table rows deletion demo"
               main-class="NewJFrame"
               width="300"
               height="300">
           </application-desc>
           <update check="background"/>
      </jnlp>
      Table Test.jar is my jar file,which has some swing components like JTable.
      All the 3 files are in the same folder.

      Can anybody figure out what is wrong there ?

      I am new in this so i may be done a stupid mistake.

      Regards
      Umer
        • 1. Re: JWS Beginner question
          793415
          When the browser displays a JNLP file content rather than launching the app., it is usually because the server is returning the wrong content-type for the document. The content-type should be <tt>application/x-java-jnlp-file</tt>. I provide a small utility for checking the content-type, the Mime-Type checker. For more information see Setting Up the Web Site.

          Having said that, the JNLP file appears to be invalid. Check it using JaNeLA & correct anything reported in red.
          • 2. Re: JWS Beginner question
            Umer
            Andrew how to use this utility ?
            I mean my file is not on a web server. It is on my local machine.
            • 3. Re: JWS Beginner question
              793415
              Muhammad Umer wrote:
              Andrew how to use this utility ?
              I mean my file is not on a web server. It is on my local machine.
              I listed two utilities and a link to documentation. Which of the two utilities are you referring to?

              (This comes back to 'be explicit' as advised in your earlier thread.)
              • 4. Re: JWS Beginner question
                Umer
                You have written a "small utility" only before only one link.
                • 5. Re: JWS Beginner question
                  793415
                  Muhammad Umer wrote:
                  You have written a "small utility" only before only one link.
                  Good point. (But they are both small utilities. ;) )

                  OK. I am guessing you don't understand what to put for the <tt>URL</tt>. <tt>File</tt> objects can be converted to an <tt>URL</tt>. Something like (untested).
                  File jnlpFile = new File("the.jnlp");
                  File jnlpFileAbsolute = jnlpFile.getAbsoluteFile();
                  URL jnlpURL = jnlpFileAbsolute.toURI().toURL();
                  • 6. Re: JWS Beginner question
                    Umer
                    Thanks for the code and being easy on me this time :)
                    I have used the second utility(jar file) and test my file and fix few errors but still the same behavior....
                    I mean file is just opened as it is.

                    (There are also other warnings in yellow and green but i ignore them)
                    • 7. Re: JWS Beginner question
                      793415
                      Muhammad Umer wrote:
                      I have used the second utility(jar file) ..
                      I think the real problem is the content-type. Report what the first utility says (or if it fails completely, report that).
                      • 8. Re: JWS Beginner question
                        Umer
                        Andrew Thompson wrote:

                        I think the real problem is the content-type. Report what the first utility says (or if it fails completely, report that).
                        Yes i may be but i think JWS is not supproted in Windows 7. And thank you for suggesting me a good way to deployment.
                        Also, netbeans 7.0 is doing a good job for me, it prepares a complete jnlp file me while building.

                        Regards
                        Umer
                        • 9. Re: JWS Beginner question
                          EJP
                          I think JWS is not supproted in Windows 7.
                          There's no evidence for that unlikely conclusion.
                          • 10. Re: JWS Beginner question
                            Umer
                            EJP wrote:
                            I think JWS is not supproted in Windows 7.
                            There's no evidence for that unlikely conclusion.
                            I have read somewhere but i did not remember where and also same application is not running on my windows 7 but it is running on xp. I might be wrong but i said what i tested.
                            • 11. Re: JWS Beginner question
                              793415
                              Muhammad Umer wrote:
                              Andrew Thompson wrote:

                              I think the real problem is the content-type.
                              ..i think JWS is not supproted in Windows 7.
                              Complete and utter rubbish. I use Windows 7 & JWS works fine. So stop wasting your (and more importantly my) time and Report what the first utility says (or if it fails completely, report that).
                              Also, netbeans 7.0 is doing a good job for me, it prepares a complete jnlp file me while building.
                              The invalid JNLP files spewed out by NetBeans was one of the reasons I wrote JaNeLA.
                              • 12. Re: JWS Beginner question
                                EJP
                                I might be wrong but i said what i tested.
                                No, you drew an unwarranted conclusion from your test results.
                                • 13. Re: JWS Beginner question
                                  Umer
                                  Why you people think that i am equilvalent to you. ...!!!
                                  Ofcourse i am not. I am new in JWS and i tested the same program with same files on xp and 7 but it works on Xp. Instead of saying rubbish and other hard workds you can just say that "Umer you are wrong it is supproted on 7 too, you might missing something".
                                  And if someone is thinking i am wasting his/her time then I am sorry for his/her time and I request please do not waste your time as i am not as good as you are.
                                  • 14. Re: JWS Beginner question
                                    793415
                                    Muhammad Umer wrote:
                                    ..you can just say that "Umer you are wrong it is supproted on 7 too, you might missing something".
                                    You can just pay me. The more you pay me, the nicer I become (and the more useless the 'sugar coated' advice becomes).
                                    1 2 Previous Next