java - Cannot access my applet on browser because of a security exception -
i've been working on java applet connecting mysql database. i've put url on whitelist, i've signed applet , connects , runs fine in appletviewer. in internet explorer applet doesn't work , following message:
java.net.socketexception message: java.security.accesscontrolexception: access denied ("java.net.socketpermission" "[0:0:0:0:0:0:0:1]:3306" "connect,resolve")
stacktrace:
java.net.socketexception: java.security.accesscontrolexception: access denied ("java.net.socketpermission" "[0:0:0:0:0:0:0:1]:3306" "connect,resolve") @ com.mysql.jdbc.standardsocketfactory.unwrapexceptiontoproperclassandthrowit(standardsocketfactory.java:407) @ com.mysql.jdbc.standardsocketfactory.connect(standardsocketfactory.java:268) @ com.mysql.jdbc.mysqlio.<init>(mysqlio.java:271) @ com.mysql.jdbc.connection.createnewio(connection.java:2771) @ com.mysql.jdbc.connection.<init>(connection.java:1555) @ com.mysql.jdbc.nonregisteringdriver.connect(nonregisteringdriver.java:285) @ java.sql.drivermanager.getconnection(unknown source) @ java.sql.drivermanager.getconnection(unknown source) @ tablefrommysqldatabase.<init>(tablefrommysqldatabase.java:43) @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(unknown source) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(unknown source) @ java.lang.reflect.constructor.newinstance(unknown source) @ java.lang.class.newinstance(unknown source) @ com.sun.deploy.uitoolkit.impl.awt.awtappletadapter$1.run(unknown source) @ java.awt.event.invocationevent.dispatch(unknown source) @ java.awt.eventqueue.dispatcheventimpl(unknown source) @ java.awt.eventqueue.access$400(unknown source) @ java.awt.eventqueue$3.run(unknown source) @ java.awt.eventqueue$3.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.security.protectiondomain$1.dointersectionprivilege(unknown source) @ java.security.protectiondomain$1.dointersectionprivilege(unknown source) @ java.awt.eventqueue$4.run(unknown source) @ java.awt.eventqueue$4.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.security.protectiondomain$1.dointersectionprivilege(unknown source) @ java.awt.eventqueue.dispatchevent(unknown source) @ java.awt.eventdispatchthread.pumponeeventforfilters(unknown source) @ java.awt.eventdispatchthread.pumpeventsforfilter(unknown source) @ java.awt.eventdispatchthread.pumpeventsforhierarchy(unknown source) @ java.awt.eventdispatchthread.pumpevents(unknown source) @ java.awt.eventdispatchthread.pumpevents(unknown source) @ java.awt.eventdispatchthread.run(unknown source)
last packet sent server 1 ms ago.
add following lines /etc/tomcat6/policy.d/webapps.policy file:
permission java.net.socketpermission "127.0.0.1:3306", "connect,resolve"; permission java.util.propertypermission "file.encoding", "read";
also comment out in /etc/mysql/my.cnf
#bind-address = 127.0.0.1
this guess.
Comments
Post a Comment