• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

VAppli Runtime Security Exception

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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/FirstServlet"+"?UsrName="+nameTxt.getString()+"&PassWd="+passTxt.getString()+"&screenName=First";
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.
Thank U

Regds,
Gokul
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic