Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-01-2009, 12:23 AM   #1
Senior Member
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,451
Blog Entries: 23

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
Question XS denied - why? pls hlp!


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:

grant codeBase "file:/var/www/html/Tr/-"
permission "*: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:

Needless to mention the database Central1 @ exists; has the appropriate user, with the appropriate grants...

The stackdump is as follows:

Standard exception : Communications link failure due to underlying exception:

MESSAGE: access denied ( connect,resolve)

STACKTRACE: access denied ( connect,resolve)
at com.mysql.jdbc.StandardSocketFactory.connect(
at com.mysql.jdbc.MysqlIO.<init>(
at com.mysql.jdbc.Connection.createNewIO(
at com.mysql.jdbc.Connection.<init>(
at com.mysql.jdbc.NonRegisteringDriver.connect(
at java.sql.DriverManager.getConnection(
at java.sql.DriverManager.getConnection(
at t1.axt.s1.cps.C1.doConn(
at t1.axt.s1.cps.C1.<init>(
at t1.axt.s1.Tr.doPrepComponents(
at t1.axt.s1.Tr.doConnect(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at sun.rmi.server.UnicastServerRef.dispatch(
at sun.rmi.transport.Transport$
at Method)
at sun.rmi.transport.Transport.serviceCall(
at sun.rmi.transport.tcp.TCPTransport.handleMessages(
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(
at sun.rmi.transport.tcp.TCPTransport$
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
at java.util.concurrent.ThreadPoolExecutor$


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!!


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...
Old 06-01-2009, 09:12 AM   #2
Registered: Jan 2006
Location: Culver City, California
Distribution: Fedora
Posts: 64

Rep: Reputation: 21
Is this Java code an Applet running in a browser by any chance? I ask because Applets are only allowed to connect to the same server and port that the applet was loaded from in the first place, and this is exactly the exception I would expect in that case.
Old 06-02-2009, 09:42 AM   #3
Senior Member
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,451
Blog Entries: 23

Original Poster
Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
and...right you are :-)

Indeed, but I solved it. The exception (and stack dump) happened on the server, I ommitted the "codebase" clause in the policy file, that would seem to have helped, conflict between that and the classpath? Possibly.




access, denied, java, mysql

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java and PHP - pls hlp Thor_2.0 Linux - Software 5 04-11-2009 03:14 AM
Alternative JVM - pls hlp Thor_2.0 Programming 4 04-02-2009 01:40 PM
installation probs pls hlp ZINZIN Linux - Newbie 4 03-18-2006 01:58 AM
macromedia flash for linux hlp pls!!!! mlu Linux - Software 3 12-01-2004 10:20 PM
mozilla firefox with JRE 1.5 hlp pls!!!! mlu Linux - Software 1 11-30-2004 06:29 PM

All times are GMT -5. The time now is 11:29 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration