db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Huat Lau <emmanuel....@gmail.com>
Subject java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby Network Server on host 127.0.0.1, port 1527: Connection refused: connect
Date Thu, 31 Dec 2009 16:24:40 GMT
I tried connecting to an embedded server to a location in the
D:\DATABASE\CAD_DB using this policy file

Filename dbViewSecurityPolicy.policy

grant codeBase "file://D:/DEVELOPMENT_ECLIPSE_XITH_LIBRARY/B1711/derby.jar" {
permission java.lang.RuntimePermission "createClassLoader";
permission java.util.PropertyPermission "derby.*", "read";
permission java.io.FilePermission "${CadEngine.system.home}","read";
permission java.io.FilePermission
"${CadEngine.system.home}${/}*","read,write,delete";
permission java.io.FilePermission
"${CadEngine.system.home}${/}CAD_DB${/}-", "read,write,delete";
permission java.util.PropertyPermission "derby.storage.jvmInstanceId","write";
};

grant codeBase "file://D:/DEVELOPMENT_ECLIPSE_XITH_LIBRARY/B1711/derbynet.jar" {
permission java.lang.RuntimePermission "createClassLoader";
permission java.util.PropertyPermission "derby.*", "read";
permission java.io.FilePermission "${CadEngine.system.home}","read";
permission java.io.FilePermission
"${CadEngine.system.home}${/}*","read,write,delete";
permission java.io.FilePermission
"${CadEngine.system.home}${/}CAD_DB${/}-", "read,write,delete";
permission java.util.PropertyPermission "derby.storage.jvmInstanceId","write";
};



	protected void waitForStart() throws Exception {		
		org.apache.derby.drda.NetworkServerControl SERVER = null;
		
		SERVER = new NetworkServerControl(InetAddress.getByName("localhost"), 1527 );

		System.out.println("Testing if Embedded Server is up and running!");
		for (int i = 0; i < 10; i++) {
			try {

				Thread.currentThread().sleep(5000);
				SERVER.ping();
			} catch (Exception e) {
				System.out.println("Try #" + i + " " + e.toString());
				if (i == 9) {
					System.out.println("Giving up trying to connect to Embedded
Network Server!");
					throw e;
				}
			}
		}
		System.out.println("Derby Embedded Network Server now running");

	}

To execute this

java -DCadEngine.system.home=D:\Database;-Djava.security.manager=D:\DEVELOPMENT_2010_XITH_2\PROJECT_AREA\ECLIPSE_XITH\gcDbView\src\dbViewSecurityPolicy.policy;
test

But everytime I did this I get the following error

Try #0 java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby
Network Server on host 127.0.0.1, port 1527: Connection refused:
connect
Try #1 java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby
Network Server on host 127.0.0.1, port 1527: Connection refused:
connect
Try #2 java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby
Network Server on host 127.0.0.1, port 1527: Connection refused:
connect
Try #3 java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby
Network Server on host 127.0.0.1, port 1527: Connection refused:
connect
Try #4 java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby
Network Server on host 127.0.0.1, port 1527: Connection refused:
connect
Try #5 java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby
Network Server on host 127.0.0.1, port 1527: Connection refused:
connect
Try #6 java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby
Network Server on host 127.0.0.1, port 1527: Connection refused:
connect
Try #7 java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby
Network Server on host 127.0.0.1, port 1527: Connection refused:
connect
Try #8 java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby
Network Server on host 127.0.0.1, port 1527: Connection refused:
connect
Try #9 java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby
Network Server on host 127.0.0.1, port 1527: Connection refused:
connect
Giving up trying to connect to Embedded Network Server!
java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby Network
Server on host 127.0.0.1, port 1527: Connection refused: connect
	at org.apache.derby.impl.drda.NetworkServerControlImpl.consolePropertyMessageWork(Unknown
Source)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.consolePropertyMessage(Unknown
Source)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.setUpSocket(Unknown
Source)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.ping(Unknown Source)
	at org.apache.derby.drda.NetworkServerControl.ping(Unknown Source)
	at derby.DERBYMain.waitForStart(DERBYMain.java:78)

Could somebody point me step by step on how to solve this. Is over 2
weeks I'm stuck on this. The application has also a Connection to a
another embedded database located at D:\DATABASE\SETTINGS. This is
working well.

Mime
View raw message