Hi,
I am building a project where Java and MySQL are used together. It is a client-server project with F10 @ client side and CentOS5.2 @ server side. I use ConnectorJ as driver. There is a java.policy in place that allows a connect from anywhere on poerts above 1024, the line is:
Quote:
grant codeBase "file:/var/www/html/Tr/-"
{
permission java.net.SocketPermission "*:1024-65535","listen,connect,accept,resolve";
}
|
I have embedded the login data (login/password) into the code, using these to log in (locally and remotely via phpMyAdmin) is possible, and the grant to the required database has been set. However, when my module tries to log in, I get an access denied. The URL to connect to the database is:
Quote:
jdbc:mysql:192.168.1.75/Central1
|
Needless to mention the database Central1 @ 192.168.1.75 exists; has the appropriate user, with the appropriate grants...
The stackdump is as follows:
Quote:
Standard exception : Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.1.75:3306 connect,resolve)
STACKTRACE:
java.net.SocketException: java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.1.75:3306 connect,resolve)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2569)
at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at t1.axt.s1.cps.C1.doConn(C1.java:103)
at t1.axt.s1.cps.C1.<init>(C1.java:57)
at t1.axt.s1.Tr.doPrepComponents(Tr.java:1643)
at t1.axt.s1.Tr.doConnect(Tr.java:410)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
** END NESTED EXCEPTION **
Last packet sent to the server was 74 ms ago.
|
Please help! Any delay eats in my project time and I lost quite some time just moving from *** to CentOS already...
Big TNX!!
Thor
PS I do hope this is the right place to put this call 4 help, it IS a programming problem, but also a server problem, or even a networking problem, but it IS a ... problem...