html - Getting an error java.lang.reflect.InvocationTargetException in Java -


I am working in an applet, when I use Netbeans to run it, I have no problem, But when I try to load an applet on my Firefox browser, it gives me this error:

  java.lang.reflect.InvocationTargetException   

this My Java code is

  package com.org.login; Import java.awt.event.ActionEvent; Import java.awt.event.ActionListener; Import java.util.logging.Level; Import java.util.logging.Logger; Import javax.swing. *; Import java.awt. *; Import java.sql *; Public Class LoginApplet extends JApplet {Fixed JTextField name, pass; Stable JButton submit; Implementation of Private Static Class Handler Action Allison {@ Override Public Voed Action Perffered (Action Event E) {String User = Name. Gate Text}; String straps = pass.getText (); Try {class.forName ("sun.jdbc.odbc.JdbcOdbcDriver"); } Catch (Klassnotfound exception before) {LoggerGetlogger (login.class.gateName ()) .log (level SESEE, ANNEL, X); } Try {Connection con = DriverManager.getConnection ("jdbc: mysql: // localhost / login", "root", ""); Description st = con.createStatement (); String query = "select information from near where the user name =" "+ user +"; Println (query); Results set rs = st.executeQuery (query); If (rsnext ()) {string dbpass = rs.getString (1); If (dbpass.equals (strpass)) {JOptionPane.showMessageDialog (empty, "login successful!", "Success", joppenpan.plin_message); } And {YellowPen. Show Message Diagnosis (empty, "login failed!", "Error", 1); }} And {YellowPen. Show message dialect (blank, "username not found", "error", 1); }} Hold (SQLException pre) {Logger.getLogger (LoginApplet.class.getName ()). Log (Level.SEVERE, null, ex); }}} Login () {jeffrey main = new jefframe ("login form"); Main.setBounds (350,150,500,500); main.setVisible (true); main.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); Name = new JTextField (10); Pass = new JTextField (10); Main.setLayout (new grid layout (0,1)); JPpenal pallet = new zpn (); Main.add (panel); Pane.add (new JLabel ("username:")); Pane.add (name); Pane.add (new JLabel ("password:")); Pane.add (passed); Submit = new pocket ("submit"); Pane.add (submitted); Submit.addActionListener (new handler ()); } Public static zero main (string [] args) {// TODO code application logic here New login (); }}   

My applet tag is HTML code

    

I get an error when trying to run in the browser below

 Enter image details here

Extension error

  Java plug-in 10.55.2.14 JRE version 1.7.0_55-b14 Java hotspot Using (TM) Client VM User Home Directory = C: \ Users \ Dinesharth -------------------------------- ---- ---------------- C: Clear Console Window F: Finalize the object on the digitizing queue: Trash G: Show this help message: Dump classloader list m: print memory usage o: trigger logging q: console r: reload policy configuration: dump system and deployment properties t: dump thread list v: dump thread stack x: clear Classloader Cash 0-5: Set trace level & lt; n & gt; -------------------------------------------------- - Trace is set to level 5: all ... complete. Clear classloader cache ... completed Original: PluginMain.unregisterApplet: 1 mananger from sun.plugin2.applet.Applet2Manager@11f74aa   

How to eliminate this error?

1) After creating the jar file. The jar is signed before the deployment of jars on the browser, if there is no link to sign the jar.

2) Clear all the cheats on the browser. Temporary Internet Files from Java Parameter Panel

Hope it helps.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -