Results 1 to 7 of 7
- 12-30-2012, 06:05 AM #1
Member
- Join Date
- Dec 2012
- Posts
- 23
- Rep Power
- 0
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:
It refuses to run and when I ask for details as to why I get the following error message: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>
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.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
Last edited by chaucer345; 12-30-2012 at 02:48 PM.
- 12-30-2012, 01:36 PM #2
Re: Request for help understanding an applet deployment error message
Why do they call it rush hour when nothing moves? - Robin Williams
- 12-30-2012, 02:50 PM #3
Member
- Join Date
- Dec 2012
- Posts
- 23
- Rep Power
- 0
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.
- 12-30-2012, 03:53 PM #4
Re: Request for help understanding an applet deployment error message
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.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 12-30-2012, 05:12 PM #5
Member
- Join Date
- Dec 2012
- Posts
- 23
- Rep Power
- 0
Re: Request for help understanding an applet deployment error message
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:
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.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>
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.
- 12-30-2012, 05:51 PM #6
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.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 12-30-2012, 06:39 PM #7
Member
- Join Date
- Dec 2012
- Posts
- 23
- Rep Power
- 0
Similar Threads
-
EJB Deployment Error
By renjithsharma in forum Enterprise JavaBeans (EJB)Replies: 0Last Post: 06-21-2011, 01:26 PM -
problem in understanding request.setAttribute() method
By jnjh in forum New To JavaReplies: 1Last Post: 05-10-2011, 08:10 AM -
Java Applet in Netbeans -- Deployment
By crystalbass17 in forum Java AppletsReplies: 0Last Post: 02-19-2011, 01:24 AM -
Deployment error
By selvatheneo in forum Java ServletReplies: 0Last Post: 11-18-2010, 04:48 PM -
SOAP Message Factory response error in an Applet
By Buglish in forum XMLReplies: 0Last Post: 06-30-2008, 09:42 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks