0

I was trying to explore how the JWS works end to end, was following this blog. JWS tutorial link

initially got "unsigned jar error" stackoverflow post- may be fixed now, but now its throwing class not found, tried multiple things like creating a class without package etc etc, but still its not working. A new class with the steps etc.

I am not sure if its some version compatibility issue or not.

Apache tomcat - 8.0.23 Java -1.8.0_40-b26


JNLP file details

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/" href="JNLPExample.jnlp">

     <information>
          <title>JNLP Example</title>
          <vendor>Java Code Geeks</vendor>
          <homepage href="http://localhost:8080/" />
          <description>JNLP Testing</description>
     </information>

     <security>
          <all-permissions/>
     </security>

     <resources>
          <j2se version="1.6+" />
          <jar href="JNLPExample.jar" />
     </resources>

     <application-desc main-class="main.javacodegeeks.JNLPExample" />
</jnlp>

Class details

package main.javacodegeeks;

import javax.swing.JFrame;
import javax.swing.JLabel;

public class JNLPExample extends JFrame {

     private static final long serialVersionUID = 4968624166243565348L;

     private JLabel label = new JLabel("Hello from Java Code Geeks!");

     public JNLPExample() {
          super("Jave Web Start Example");
          this.setSize(350, 200);
          this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          this.setLayout(null);
     }

     public void addButtons() {
          label.setSize(200, 30);
          label.setLocation(80, 50);
          this.getContentPane().add(label);
     }

     public static void main(String[] args) {
          JNLPExample exp = new JNLPExample();
          exp.addButtons();
          exp.setVisible(true);
     }
}

JaNeLA- Output

Error 1 Error 2 Error 3

Community
  • 1
  • 1
Pallab
  • 687
  • 1
  • 7
  • 15
  • What is your question, exactly? And how do you expect anyone to debug a CNFE when you provide no detail on the package structure and class name, nor the content of the JNLP? Sometimes I think people asking questions believe that the people who provide answers do so by magic. Another tip: Be sure to check the JNLP using JaNeLA, available at my [share drive](https://drive.google.com/drive/#folders/0B5B9wDXIGw9lUnJaUjA2cmlVRE0). – Andrew Thompson Jul 07 '15 at 07:38
  • sorry for not being clear, added the jnlp file and class details – Pallab Jul 07 '15 at 07:51
  • added the output snap from JaNeLA as well – Pallab Jul 07 '15 at 08:02
  • *"added the output snap from JaNeLA as well"* `` Don't post images of textual information! JaNeLA can produce a text report. – Andrew Thompson Jul 07 '15 at 09:01
  • BTW - when the server is running and you click [this link to the Jar](http://localhost:8080/JNLPExample.jar), what is the result? Does the browser offer the Jar for download? – Andrew Thompson Jul 07 '15 at 09:04
  • Yes, it gets downloaded, added the error snaps in my original post – Pallab Jul 07 '15 at 09:51
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/82579/discussion-between-pallab-and-andrew-thompson). – Pallab Jul 07 '15 at 10:15
  • When i added a manifest file while creating the jar its working. Is it mandatory to create the manifest file ? can't it be pulled from the jnlp description ? – Pallab Jul 07 '15 at 12:39
  • *"can't it be pulled from the jnlp description"* As long as the JNLP specifies a main class it can be left out of the manifest. – Andrew Thompson Jul 07 '15 at 22:26

1 Answers1

0

JWS needs the external jars to b in the \lib\ext directory.

Mikes
  • 1