How can I add external jars to an applet project so they can be used witihin the applet on a webpage. (MYSQL java driver in an applet)
Printable View
How can I add external jars to an applet project so they can be used witihin the applet on a webpage. (MYSQL java driver in an applet)
Guys I get this
HELP ME OUTCode:java.lang.reflect.InvocationTargetException
at java.awt.EventQueue.invokeAndWait(Unknown Source)
at javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
at applet.appletMain.init(appletMain.java:53)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:286)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at applet.standardDB.main(standardDB.java:18)
at applet.appletMain$1.run(appletMain.java:56)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.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.security.AccessControlException: access denied (java.util.PropertyPermission file.encoding read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at com.mysql.jdbc.StringUtils.<clinit>(StringUtils.java:70)
... 19 more
Your applet needs permission to read properties. You can give it permission by signing the jar file or by making changes to the local JRE's .java.policy file.Quote:
access denied (java.util.PropertyPermission file.encoding read
Signed the jar ( i get a prompt do i want to trust this program cuz it signiture could not be verified) and still get this
Files on server are read/execute chmod 755 (+write for admin)Code:Exception in thread "Thread-11" java.lang.ExceptionInInitializerError
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:286)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at applet.standardDB.run(standardDB.java:25)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "file.encoding" "read")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at com.mysql.jdbc.StringUtils.<clinit>(StringUtils.java:70)
... 5 more
I keep the classes on the server in folders - when i try to connect by clicking on a button there is a prompt ( something about that soe components are not signed) if i click yes i get some loading problem (Class.forName Exception) and if i click no then it is loaded but i get an exception about the acces reading. How to add that jar in a good way ? IM tearing my hair out .... I tried adding a lib katalog and copying the jar into it and addigng is as a refference to an internal jar ... But still nothing :/.
For testing you could change the local .java.policy file to give all codebases permission to read properties.Quote:
access denied ("java.util.PropertyPermission" "file.encoding" "read")
Use the policytool program and make any entry something like this:
permission java.util.PropertyPermission "*", "read";