could not initialize class com.mysql.jdbc.driver Caused by: java.security.AccessControlException: access denied -
am new hibernate, created project(google web application project) of eclips , hibernate config file ..
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory name=""> <property name="hibernate.connection.driver_class">com.mysql.jdbc.driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/test</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.dialect">org.hibernate.dialect.mysqldialect</property> <property name="hibernate.hbm2ddl.auto">create</property> <property name="hibernate.show_sql">true</property> <mapping class="com.model.userdetails" /> </session-factory> </hibernate-configuration>
and hibernate code access data
system.out.print("servlet class"); sessionfactory sessionfactory=new annotationconfiguration().configure().buildsessionfactory(); system.out.println("session factory"); session hibernate_session = sessionfactory.opensession(); system.out.println("session"); hibernate_session.begintransaction(); system.out.println("transation begin"); userdetails user=new userdetails(); user.setusername("ramesh@stellentsoft.com"); user.setuseremail("ramesh@stellentsoft.com"); user.setuserpassword("password"); hibernate_session.save(user); hibernate_session.gettransaction().commit(); system.out.println("user saved");
when run code got error in console this..
com.google.apphosting.utils.jetty.jettylogger warn warning: error /home java.lang.exceptionininitializererror @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:169) @ org.hibernate.connection.drivermanagerconnectionprovider.configure(drivermanagerconnectionprovider.java:57) @ org.hibernate.connection.connectionproviderfactory.newconnectionprovider(connectionproviderfactory.java:124) @ org.hibernate.connection.connectionproviderfactory.newconnectionprovider(connectionproviderfactory.java:56) @ org.hibernate.cfg.settingsfactory.createconnectionprovider(settingsfactory.java:397) @ org.hibernate.cfg.settingsfactory.buildsettings(settingsfactory.java:62) @ org.hibernate.cfg.configuration.buildsettings(configuration.java:2006) @ org.hibernate.cfg.configuration.buildsessionfactory(configuration.java:1289) @ com.controller.trackerlogin.service(trackerlogin.java:55) @ javax.servlet.http.httpservlet.service(httpservlet.java:717) @ org.mortbay.jetty.servlet.servletholder.handle(servletholder.java:511) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1166) @ com.google.appengine.api.socket.dev.devsocketfilter.dofilter(devsocketfilter.java:74) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.appengine.tools.development.responserewriterfilter.dofilter(responserewriterfilter.java:123) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.appengine.tools.development.headerverificationfilter.dofilter(headerverificationfilter.java:34) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.appengine.api.blobstore.dev.serveblobfilter.dofilter(serveblobfilter.java:63) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.apphosting.utils.servlet.transactioncleanupfilter.dofilter(transactioncleanupfilter.java:43) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.appengine.tools.development.staticfilefilter.dofilter(staticfilefilter.java:125) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.appengine.tools.development.devappserverserversfilter.dodirectrequest(devappserverserversfilter.java:369) @ com.google.appengine.tools.development.devappserverserversfilter.dodirectserverrequest(devappserverserversfilter.java:352) @ com.google.appengine.tools.development.devappserverserversfilter.dofilter(devappserverserversfilter.java:115) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ org.mortbay.jetty.servlet.servlethandler.handle(servlethandler.java:388) @ org.mortbay.jetty.security.securityhandler.handle(securityhandler.java:216) @ org.mortbay.jetty.servlet.sessionhandler.handle(sessionhandler.java:182) @ org.mortbay.jetty.handler.contexthandler.handle(contexthandler.java:765) @ org.mortbay.jetty.webapp.webappcontext.handle(webappcontext.java:418) @ com.google.appengine.tools.development.devappenginewebappcontext.handle(devappenginewebappcontext.java:94) @ org.mortbay.jetty.handler.handlerwrapper.handle(handlerwrapper.java:152) @ com.google.appengine.tools.development.jettycontainerservice$apiproxyhandler.handle(jettycontainerservice.java:421) @ org.mortbay.jetty.handler.handlerwrapper.handle(handlerwrapper.java:152) @ org.mortbay.jetty.server.handle(server.java:326) @ org.mortbay.jetty.httpconnection.handlerequest(httpconnection.java:542) @ org.mortbay.jetty.httpconnection$requesthandler.content(httpconnection.java:938) @ org.mortbay.jetty.httpparser.parsenext(httpparser.java:755) @ org.mortbay.jetty.httpparser.parseavailable(httpparser.java:218) @ org.mortbay.jetty.httpconnection.handle(httpconnection.java:404) @ org.mortbay.io.nio.selectchannelendpoint.run(selectchannelendpoint.java:409) @ org.mortbay.thread.queuedthreadpool$poolthread.run(queuedthreadpool.java:582) caused by: java.security.accesscontrolexception: access denied (java.lang.runtimepermission modifythreadgroup) @ java.security.accesscontrolcontext.checkpermission(accesscontrolcontext.java:323) @ java.security.accesscontroller.checkpermission(accesscontroller.java:546) @ java.lang.securitymanager.checkpermission(securitymanager.java:532) @ com.google.appengine.tools.development.devappserverfactory$customsecuritymanager.checkpermission(devappserverfactory.java:289) @ com.google.appengine.tools.development.devappserverfactory$customsecuritymanager.checkaccess(devappserverfactory.java:314) @ java.lang.threadgroup.checkaccess(threadgroup.java:288) @ java.lang.thread.init(thread.java:332) @ java.lang.thread.<init>(thread.java:419) @ com.mysql.jdbc.abandonedconnectioncleanupthread.<init>(abandonedconnectioncleanupthread.java:33) @ com.mysql.jdbc.nonregisteringdriver.<clinit>(nonregisteringdriver.java:88) ... 46 more apr 25, 2013 2:41:22 pm com.google.apphosting.utils.jetty.jettylogger warn warning: nested in java.lang.exceptionininitializererror: java.security.accesscontrolexception: access denied (java.lang.runtimepermission modifythreadgroup) @ java.security.accesscontrolcontext.checkpermission(accesscontrolcontext.java:323) @ java.security.accesscontroller.checkpermission(accesscontroller.java:546) @ java.lang.securitymanager.checkpermission(securitymanager.java:532) @ com.google.appengine.tools.development.devappserverfactory$customsecuritymanager.checkpermission(devappserverfactory.java:289) @ com.google.appengine.tools.development.devappserverfactory$customsecuritymanager.checkaccess(devappserverfactory.java:314) @ java.lang.threadgroup.checkaccess(threadgroup.java:288) @ java.lang.thread.init(thread.java:332) @ java.lang.thread.<init>(thread.java:419) @ com.mysql.jdbc.abandonedconnectioncleanupthread.<init>(abandonedconnectioncleanupthread.java:33) @ com.mysql.jdbc.nonregisteringdriver.<clinit>(nonregisteringdriver.java:88) @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:169) @ org.hibernate.connection.drivermanagerconnectionprovider.configure(drivermanagerconnectionprovider.java:57) @ org.hibernate.connection.connectionproviderfactory.newconnectionprovider(connectionproviderfactory.java:124) @ org.hibernate.connection.connectionproviderfactory.newconnectionprovider(connectionproviderfactory.java:56) @ org.hibernate.cfg.settingsfactory.createconnectionprovider(settingsfactory.java:397) @ org.hibernate.cfg.settingsfactory.buildsettings(settingsfactory.java:62) @ org.hibernate.cfg.configuration.buildsettings(configuration.java:2006) @ org.hibernate.cfg.configuration.buildsessionfactory(configuration.java:1289) @ com.controller.trackerlogin.service(trackerlogin.java:55) @ javax.servlet.http.httpservlet.service(httpservlet.java:717) @ org.mortbay.jetty.servlet.servletholder.handle(servletholder.java:511) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1166) @ com.google.appengine.api.socket.dev.devsocketfilter.dofilter(devsocketfilter.java:74) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.appengine.tools.development.responserewriterfilter.dofilter(responserewriterfilter.java:123) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.appengine.tools.development.headerverificationfilter.dofilter(headerverificationfilter.java:34) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.appengine.api.blobstore.dev.serveblobfilter.dofilter(serveblobfilter.java:63) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.apphosting.utils.servlet.transactioncleanupfilter.dofilter(transactioncleanupfilter.java:43) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.appengine.tools.development.staticfilefilter.dofilter(staticfilefilter.java:125) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.appengine.tools.development.devappserverserversfilter.dodirectrequest(devappserverserversfilter.java:369) @ com.google.appengine.tools.development.devappserverserversfilter.dodirectserverrequest(devappserverserversfilter.java:352) @ com.google.appengine.tools.development.devappserverserversfilter.dofilter(devappserverserversfilter.java:115) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ org.mortbay.jetty.servlet.servlethandler.handle(servlethandler.java:388) @ org.mortbay.jetty.security.securityhandler.handle(securityhandler.java:216) @ org.mortbay.jetty.servlet.sessionhandler.handle(sessionhandler.java:182) @ org.mortbay.jetty.handler.contexthandler.handle(contexthandler.java:765) @ org.mortbay.jetty.webapp.webappcontext.handle(webappcontext.java:418) @ com.google.appengine.tools.development.devappenginewebappcontext.handle(devappenginewebappcontext.java:94) @ org.mortbay.jetty.handler.handlerwrapper.handle(handlerwrapper.java:152) @ com.google.appengine.tools.development.jettycontainerservice$apiproxyhandler.handle(jettycontainerservice.java:421) @ org.mortbay.jetty.handler.handlerwrapper.handle(handlerwrapper.java:152) @ org.mortbay.jetty.server.handle(server.java:326) @ org.mortbay.jetty.httpconnection.handlerequest(httpconnection.java:542) @ org.mortbay.jetty.httpconnection$requesthandler.content(httpconnection.java:938) @ org.mortbay.jetty.httpparser.parsenext(httpparser.java:755) @ org.mortbay.jetty.httpparser.parseavailable(httpparser.java:218) @ org.mortbay.jetty.httpconnection.handle(httpconnection.java:404) @ org.mortbay.io.nio.selectchannelendpoint.run(selectchannelendpoint.java:409) @ org.mortbay.thread.queuedthreadpool$poolthread.run(queuedthreadpool.java:582)
how can solve problem ,, following list of jar file added lib...
guys please let me out break point..
seems setting 'use google app engine' checked in web-project properties. uncheck , try again (project -> properties -> google -> app engine) (if don't intend use gae within eclipse)
since gae doesn't allow using threads, security setting restricts such operation giving accesscontrolexception.
further can checkout comprehensive list of can used gae willitplayinjava. according it:
you cannot use hibernate directly.
but via cloud sql possible, checkout https://developers.google.com/appengine/articles/using_hibernate