| | |
class cast exception
![]() |
•
•
Join Date: Dec 2004
Posts: 489
Reputation:
Solved Threads: 5
hey guys
I'm trying to get hold of a StreamConnection
however when i do this i get the following error
According to my know of and google it should compile fine. I've used this in a J2EE project and it works correctly but not in a J2ME???
I'm trying to get hold of a StreamConnection
Java Syntax (Toggle Plain Text)
try { StreamConnection conn = ( StreamConnection ) Connector.open ( url ) ; } catch (Exception ex) { ex.printStackTrace(); }
however when i do this i get the following error
•
•
•
•
java.lang.ClassCastException
J2ME (Micro/Mobile Edition) is a limited version of the J2SE (Standard Edition) and definately will not have anything that first available in the J2EE (Enterprise Edition).
See http://java.sun.com/javame/reference/apis.jsp#api and select the link for the appropriate version to see the API docs, and find out what is available.
See http://java.sun.com/javame/reference/apis.jsp#api and select the link for the appropriate version to see the API docs, and find out what is available.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Dec 2004
Posts: 489
Reputation:
Solved Threads: 5
I googled and quote the following websit whilst its implemented on J2EE its also available for J2ME
http://developers.sun.com/mobility/m...icles/network/
http://developers.sun.com/mobility/m...icles/network/
•
•
Join Date: Nov 2006
Posts: 224
Reputation:
Solved Threads: 31
the exception tells you exactly what's wrong; you can't cast it, because it's not that type
what makes you think that it is a StreamConnection? and why do you need it to be?
what makes you think that it is a StreamConnection? and why do you need it to be?
--
Index of mp3
Index of mp3
![]() |
Similar Threads
- Object failing to be cast (Java)
- class cast exception in EJB (Java)
- class cast Exception in EJB (IT Professionals' Lounge)
- JTable Cell Renderers (Java)
- Calling a class upon button click (C#)
- Cannot figure out why I'm getting these Errors (Java)
Other Threads in the Java Forum
- Previous Thread: javac doesn't work
- Next Thread: java runtime error for database connection
| Thread Tools | Search this Thread |
911 addball addressbook android api append applet application apps array arrays automation binary bluetooth businessintelligence button card chat class client code collision component crashcourse css csv database eclipse ee error fractal free game gis givemetehcodez graphics gui html ide image input integer integration j2me japplet java javaarraylist javadoc javafx javaprojects jni jpanel julia jvm linux list loan loop machine map method methods migrate mobile netbeans newbie objects oriented output panel phone physics problem program programming project radio recursion reporting scanner se server service set sms socket software sort sql string swing test textfield threads transfer tree trolltech ubuntu utility windows






