on 03-13-2014 1:56 AM
I am a engineer for develop network with real-time service, wihch can sending message to another remote applications.
First, I know Sybase have TIBCO-EMS System to achieving my requirement but TIBCO was not free software, thus I want it to do myself.
Ok, In my requirement, I find the Java Service in Sybase ASE and I followings with user guide:
My question is: Seem's Sybase ASE can't using socket directly ?
While I used socket, Sybase throws the exception:
There was an error reading the results of the SQL statement.
The displayed results may be incorrect or incomplete.
Unhandled Java Exception:
java.lang.ExceptionInInitializerError
at
java.net.Socket.setImpl(Socket.java:493)
at java.net.Socket.<init>
(Socket.java:414)
at java.net.Socket.<init>(Socket.java:208)
at org.
gms.client.ClientTest.send(ClientTest.java:13)
Caused by: java.lang.
SecurityException: Properties can not be inspected
at sybase.aseutils.
PCAJvmSecurityManager.checkPropertiesAccess(PCAJvmSecurityManager.java:
173)
at java.lang.System.getProperties(System.java:622)
at.
Sybase error code=10707
There was an error reading the results of the SQL statement.
The displayed results may be incorrect or incomplete.
Unhandled Java Exception:
java.lang.ExceptionInInitializerError
at
java.net.Socket.setImpl(Socket.java:493)
at java.net.Socket.<init>
(Socket.java:85)
Caused by: java.lang.SecurityException: Properties can
not be inspected
at sybase.aseutils.PCAJvmSecurityManager.
checkPropertiesAccess(PCAJvmSecurityManager.java:173)
at java.lang.
System.getProperties(System.java:622)
at java.net.PlainSocketImpl$1.
run(PlainSocketImpl.java:62)
at java.security.AccessController.
doPrivile.
Sybase error code=10707
Can anyone help me? Thank so much~!
Is anyone has solution ? Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't have any direct experience yet using Java sockets in ASE, but as the manuals explicitly mention the class, I suspect they can be used. Using socket classes
As an initial guess, have you adjusted the sp_configure parameter "number of java sockets" up from its default value of 0? number of java sockets
-bret
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello ! Bret.
Thank for your reply.
Yes. I already set 10 value of 'number of java sockets' attribute in configure.
In addition , I also enable the "pca_jvm_netio" and "-Dsybase.allow.native.lib=true" in pca/jvm options.
" I suspect they can be used. Using socket classes"
You are right , but it just can't use.
I have confused to one thing when watch the SecurityException of describtion :
'java.lang.SecurityException:Properties can not be inspected'
So I think, This is a point to using socket.
In this case , Why cause system to get properties for use socket?
Ok!
Here is my example of calling:
My class name is ClientTest that installed in sybase.
It can made sybase call by static method.
public static void send() {
Socket socket = null;
try {
socket = new Socket("192.168.100.169", 5056);
OutputStream op = socket.getOutputStream();
op.write("Hello Server".getBytes());
op.flush();
op.close();
socket.close();
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
In the InteractiveSQL , I used syntax as following:
select org.gms.client.ClientTest.send();
Than execute this column : socket = new Socket("192.168.100.169", 5056);
The SecurityException has been raised and made ExceptionInInitializerError occur, thus JVM can't load java.net.Socket class.
If the issue have no solution yet , will made me can't use Socket.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.