Hello guyz,
Im trying to use VAppli Emulator for Vodaphone which is built upon
j2me,Whn i try to call a servlet using the code its showing me
some Runtime Security Exception..
The code thro which im calling the servlet is as follows
public String NewDawnFirstServlet() throws IOException{
String itemData="";
HttpConnection http=null;
int d;
String url="http://localhost:8888/NewDawn/FirstServletVAppli";
System.out.println("NewDawnServlet call Succeded");
try{
http = (HttpConnection)Connector.open(url);
http.setRequestMethod(HttpConnection.GET);
System.out.println(http.getResponseMessage());
InputStreamReader stream=new
InputStreamReader(http.openInputStream(),"SJIS");
int returnCode=http.getResponseCode();
if(returnCode==HttpConnection.HTTP_OK){
while (true){
d=stream.read();
if (d==-1) break;
else itemData+=((char) d);
}
}
}
catch(SecurityException e){
e.printStackTrace();
}
finally{
http.close();
}
return itemData;
}
Also the RunTime Exceptions are as follows,
at com.sun.cldc.io.ConnectionBase.openPrim(+7)
at javax.microedition.io.Connector.openPrim(+270)
at javax.microedition.io.Connector.open(+15)
at javax.microedition.io.Connector.open(+6)
at javax.microedition.io.Connector.open(+5)
at NewDawn.NewDawnFirstServlet(+22)
at NewDawn.commandAction(+21)
at javax.microedition.lcdui.Displayable.actionCommand(+167)
at javax.microedition.lcdui.Displayable.dispatch(+24)
at javax.microedition.lcdui.Screen.dispatch(+103)
at javax.microedition.lcdui.Form.dispatch(+11)
at javax.microedition.lcdui.UiEventHandler.receiveEvent(+197)
Uncaught exception java/lang/NullPointerException
ALERT: uncaught Exception found
Kindly help me with this issue.
Also when i run this codes in J2ME tool kit its working fine
without all these Exceptions..Im really confused..
Thank U
Regds,
Gokul
_________________________________________________
Anything is Possible With little more effort!
Received on Tue Apr 5 13:37:43 2005