Socket Connection : Class Cast Exception

Hai everybody,

I worked with a MIDP program that have client & server communication, I have wrote only this much on theServerSide:-

UUID x=new UUID(0x0003);

String uuid=x.toString();

StreamConnectionNotifier scn=(StreamConnectionNotifier)Connector.open("btspp://localhost:"+uuid+";name=SPPEx");

StreamConnection sc=(StreamConnection)scn.acceptAndOpen();

si.setText("Client Connected");

On theClient Side :-

StreamConnection sc=(StreamConnection)Connector.open("btspp://localhost:5");

si.setText("Connection Established With Server");

But when I am trying to connect with client to server , on the client side Iam getting theError :-

java.lang.ClassCastException

please any body can help me

Thanks & Regards

Sulfikkar

[842 byte] By [sulfikkartma] at [2007-11-26 19:40:08]
«« Hi ,
»» arrays
# 1
have you tried to open a SocketConnection with the example given in the Streamconnection javadoc?[url= http://www.blackberry.com/developers/docs/4.1api/javax/microedition/io/SocketConnection.html]javadoc here ![/url]
suparenoa at 2007-7-9 22:19:50 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2
[url= http://www.blackberry.com/developers/docs/4.1api/javax/microedition/io/Connector.html#bluetooth]i forgot this[/url]
suparenoa at 2007-7-9 22:19:50 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3
Hai,I tried both but I am getting the same errorThanksSulfikkar
sulfikkartma at 2007-7-9 22:19:50 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4

i found...

[url=http://forum.java.sun.com/thread.jspa?threadID=549463&messageID=2692724]one[/url]

[url=http://developers.sun.com/techtopics/mobility/apis/articles/bluetoothcore/]two[/url]

[url=http://developers.sun.com/techtopics/mobility/midp/articles/bluetooth2/]three[/url]

...

i think that you can solve your problem with this articles

suparenoa at 2007-7-9 22:19:50 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5
I think project in WTK22 --> BluetoothDemo helps you.
junaid-shabbira at 2007-7-9 22:19:50 > top of Java-index,Java Mobility Forums,Java ME Technologies...