Results 1 to 7 of 7
  1. #1
    chaucer345 is offline Member
    Join Date
    Dec 2012
    Posts
    44
    Rep Power
    0

    Default Request for help understanding an applet deployment error message

    Hello all.

    So I've been trying to deploy an applet so I can test it out (I freely admit, I'm not even sure if it works) and I've tried it both directly and with a JNLP file, but either way I do it, when I try to embed it in an HTML file like so:

    XML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
    <html>
    <head>
    <title>Wounded Web Page</title>
    </head>
    <!-- Written to deploy the text adventure Wounded -->
    <body>
    <h1><b>Wounded</b></h1>
    <h2>Disclaimer:</h2>
    My little pony is the property of Hasbro, Lauren Faust, and
    the rest of its creative team. Please support the official release.
    <p>
    <p>
    This text adventure is associated with the Equestria daily 
    fan-fiction "The First Prince" and many of the events that 
    occur here are relevant to what happens there.
    <p>
    <p>
    <script src="http://www.java.com/js/deployJava.js"></script>
        <script> 
            var attributes = {
                code:'GUI',  width:1309, height:683} ; 
            var parameters = {jnlp_href: 'wounded.jnlp'} ; 
            deployJava.runApplet(attributes, parameters, '1.6'); 
        </script>
    </body>
    </html>
    It refuses to run and when I ask for details as to why I get the following error message:

    Java Code:
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
    	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
    	at java.lang.Class.getDeclaredConstructors0(Native Method)
    	at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    	at java.lang.Class.getConstructor0(Unknown Source)
    	at java.lang.Class.newInstance0(Unknown Source)
    	at java.lang.Class.newInstance(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$400(Unknown Source)
    	at java.awt.EventQueue$2.run(Unknown Source)
    	at java.awt.EventQueue$2.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: org.jdesktop.layout.GroupLayout$Group
    	at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
    	at sun.plugin2.applet.JNLP2ClassLoader.findClass(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	... 20 more
    Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
    I honestly have no clue what this means and would really appreciate it if anyone would be able to help me figure it out. Thank you all for reading.
    Last edited by chaucer345; 12-30-2012 at 02:48 PM.

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

    Default Re: Request for help understanding an applet deployment error message

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

  3. #3
    chaucer345 is offline Member
    Join Date
    Dec 2012
    Posts
    44
    Rep Power
    0

    Default Re: Request for help understanding an applet deployment error message

    Okay, I've added code tags as best as I can, though honestly I'm not even sure what the second code type is, it's just the error explanation I got when I tried to display the HTML page.

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

    Default Re: Request for help understanding an applet deployment error message

    Quote Originally Posted by chaucer345 View Post
    It refuses to run and when I ask for details as to why I get the following error message:

    Java Code:
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
    An error message can't get much clearer than that. The code evidently makes use of org.jdesktop.layout.GroupLayout.Group, and that class can't be found on the classpath.

    Either migrate the Applet to use javax.swing.GroupLayout which is a part of the JDK since Java 1.6, or make the org...GroupLayout available on the classpath. I would recommend the former.

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

  5. #5
    chaucer345 is offline Member
    Join Date
    Dec 2012
    Posts
    44
    Rep Power
    0

    Default Re: Request for help understanding an applet deployment error message

    Quote Originally Posted by DarrylBurke View Post
    An error message can't get much clearer than that. The code evidently makes use of org.jdesktop.layout.GroupLayout.Group, and that class can't be found on the classpath.

    Either migrate the Applet to use javax.swing.GroupLayout which is a part of the JDK since Java 1.6, or make the org...GroupLayout available on the classpath. I would recommend the former.

    db
    Okay, I'm very new so the terminology is somewhat strange to me. I was using the form provided by the NetBeans IDE to create the applet code, and I see what you were talking about in the method below:

    Java Code:
    private void initComponents() {
    
            jScrollPane1 = new javax.swing.JScrollPane();
            output = new javax.swing.JTextArea();
            choiceButton = new javax.swing.JButton();
            input = new javax.swing.JTextField();
            choiceLabel = new javax.swing.JLabel();
    
            output.setColumns(20);
            output.setRows(5);
            jScrollPane1.setViewportView(output);
    
            choiceButton.setText("Choose");
            choiceButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    choiceButtonActionPerformed(evt);
                }
            });
    
            input.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    inputActionPerformed(evt);
                }
            });
    
            choiceLabel.setText("Choice:");
    
            org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                        .add(layout.createSequentialGroup()
                            .add(150, 150, 150)
                            .add(choiceLabel)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                            .add(input, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 676, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                            .add(choiceButton))
                        .add(layout.createSequentialGroup()
                            .add(47, 47, 47)
                            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1060, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap(202, Short.MAX_VALUE))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .add(26, 26, 26)
                    .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 546, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 47, Short.MAX_VALUE)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                        .add(input, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(choiceLabel)
                        .add(choiceButton))
                    .add(39, 39, 39))
            );
        }// </editor-fold>
    The IDE won't let me modify that code, but I can definitely see what you're saying as the applet class extends javax.swing.JApplet, so using methods from a javax.swing class would work perfectly.

    Is there someway I can gain access to org.jdesktop.layout.GroupLayout methods without modifying the method above, possibly with an import?

    Thank you so much for your help.

    Edit: When I try to do that, it just says the import is unused

    Edit2: When I try making a new jar file from that and open the html page, there's no outlined space with an error message. Side note: when I attempt to just run the .jar file I compiled I get an error message from the java virtual machine that reads:
    Could not find the main class: GUI ((the name of the main class of my applet)). Program will exit.
    Last edited by chaucer345; 12-30-2012 at 05:42 PM.

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

    Default Re: Request for help understanding an applet deployment error message

    A visual designer is not a begiinners' tool. And a jar'ed Applet is not run outside of a browser by the Java executable but by the AppletViewer executable.

    Frankly, you've bitten off more than you can chew. You need to get a better foundation in Java before you start dabbling in GUIs and Applets. Here's a good learning resource: The Java™ Tutorials

    Also, you're probably using a hugely outdated version of NetBeans.

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

  7. #7
    chaucer345 is offline Member
    Join Date
    Dec 2012
    Posts
    44
    Rep Power
    0

    Default Re: Request for help understanding an applet deployment error message

    Quote Originally Posted by DarrylBurke View Post
    A visual designer is not a begiinners' tool. And a jar'ed Applet is not run outside of a browser by the Java executable but by the AppletViewer executable.

    Frankly, you've bitten off more than you can chew. You need to get a better foundation in Java before you start dabbling in GUIs and Applets. Here's a good learning resource: The Java™ Tutorials

    Also, you're probably using a hugely outdated version of NetBeans.

    db
    So, if I came back later with a GUI I built from scratch would you be willing to help?

Similar Threads

  1. EJB Deployment Error
    By renjithsharma in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 06-21-2011, 01:26 PM
  2. Replies: 1
    Last Post: 05-10-2011, 08:10 AM
  3. Java Applet in Netbeans -- Deployment
    By crystalbass17 in forum Java Applets
    Replies: 0
    Last Post: 02-19-2011, 01:24 AM
  4. Deployment error
    By selvatheneo in forum Java Servlet
    Replies: 0
    Last Post: 11-18-2010, 04:48 PM
  5. Replies: 0
    Last Post: 06-30-2008, 09:42 PM

Posting Permissions

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