hello, I've written an application that read data from the database and show
them on GUI. I used JDBC for reading data from database. --------------
Driver driver =
(Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
DriverManager.registerDriver(driver); String url =
"jdbc:oracle:thin:"+getDatabaseUser()+"/"+getDbPassword()+"@"+getDbHost()+":"+getDbPort()+":"+getDbName();
conn = DriverManager.getConnection(url, getDatabaseUser(),getDbPassword());
----------- I'm working with glassFish 3.1.2. after I switch on the security
with *auth-method=basic* and FileRealm, I get an Exception when my app try to
connect to the database:
[#|2012-03-30T14:03:14.619+0200|WARNING|glassfish3.1.2|oracle.jdbc|_ThreadID=24;_ThreadName=http-thread-pool-8080(2);|Error
while registering Oracle JDBC Diagnosability MBean.
java.security.AccessControlException: access denied
(javax.management.MBeanServerPermission createMBeanServer) at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at
java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:500)
at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:320) at
oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:199) at
java.security.AccessController.doPrivileged(Native Method) at
oracle.jdbc.driver.OracleDriver.(OracleDriver.java:195) at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:169)
[#|2012-03-30T14:03:15.681+0200|INFO|glassfish3.1.2|javax.enterprise.system.core.security|_ThreadID=24;_ThreadName=http-thread-pool-8080(2);|JACC
Policy Provider:Failed Permission Check: context (" erp/erp ") , permission
(" (java.lang.RuntimePermission SSLPassword) ") |#] What do I wrong?? Should
I get some permissions to the class where database connection is created???
how can I do it??? thank you for your help.
--
[Message sent by forum member 'johnbesel']
View Post: http://forums.java.net/node/884662