黑莓RIM设备,访问服务器问题java

时间:2010-08-09 07:50:24

标签: java eclipse blackberry blackberry-eclipse-plugin

我的项目有问题。例外情况说“由于某些临时条件,服务器无法处理消息”。代码在这里,ı试图缓解这个问题但是ı不能......

package Kpaket;

import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.*;
import Kpaket.Pmain;
import webserviceOut.LoginWS;
import webserviceOut.*;
import java.rmi.RemoteException;

class LoginScreen extends MainScreen {

 boolean _checked;
 PasswordEditField PasswordField;// invisible type 
 Button btnLogin;
 String space="                       ";
 HorizontalFieldManager hrzManager, hrzManager2;
 EditField EditRef[];
 String EditContext[], LabelRef[]={" Kullanýcý Adý ", " Þifre             "};
 int count_of_component=0;
 LoginWS ws = new LoginWS();
 GetpsWS ps = new GetpsWS();

 public LoginScreen() {

  super(NO_VERTICAL_SCROLL);
  LabelField title = new LabelField("OMEGA YONETIM PANELI", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH | LabelField.FIELD_HCENTER |DrawStyle.HCENTER );
  hrzManager = new HorizontalFieldManager(){
   protected void paintBackground(Graphics graphics)
   {
    graphics.setBackgroundColor(0xcccccc);
    graphics.clear();
    super.paint(graphics);
    }
   };
  hrzManager.add(title);
  this.add(hrzManager);
  boyar(3);
  add( new SeparatorField() );
  EditRef = new EditField[2];
  EditContext = new String[2];

  for(count_of_component = 0; count_of_component < 2; count_of_component++){
   add(new SeparatorField());
   add( new HorizontalField(1, FIELD_HCENTER){
    protected void paintBackground(Graphics graphics)//boyama kýsmýdýr genc..
    {
     graphics.setBackgroundColor(0xcccccc);
     graphics.clear();
     super.paint(graphics);
    }

       { 
        add( new VerticalField(0.50, FIELD_HCENTER){
      {
       add(new LabelField ( LabelRef[count_of_component] ){
        {
         setFont(Font.getDefault().derive(Font.BOLD));;
        }
       });
      }
     });//vertical

     add( new VerticalField(0.50, FIELD_HCENTER) {
      {
       if( LabelRef[count_of_component].equals(" Kullanýcý Adý ") )
           add( EditRef[count_of_component]= new EditField() );
       else
        add( PasswordField = new PasswordEditField());
      }
     });//vertical
    }
   });//add(hfm);
  }
/*  try{
  if( Pmain.osman.loginCheck("bayram", "1").isCheck() == true){

   Dialog.alert(" if e girdim ");
   //UiApplication.getUiApplication().pushScreen( new ptMainScreen() );
  } 
  else{


  }

  }
  catch ( Exception e ){}
*/

  add( new SeparatorField() );
  add( new SeparatorField() );
  add(new HorizontalField(1, FIELD_HCENTER){
   {
    add(new VerticalField(1, FIELD_HCENTER | USE_ALL_WIDTH | DrawStyle.VCENTER){
     {
      btnLogin = new Button (space+"GÝRÝÞ",FIELD_HCENTER){ 
       public void onClick() 
       {
        for(int count_of_component = 0; count_of_component<2; count_of_component++){
         if(count_of_component == 0){
          EditContext[count_of_component] = EditRef[count_of_component].getText();
         }
         if(count_of_component ==1){
          EditContext[count_of_component] = PasswordField.getText();
         }
        }  
        deneme();
        /*        

         * try{
         ws = Pmain.owner.loginCheck(EditContext[0], EditContext[1]);
        }
        catch( Exception e ){
         Dialog.alert(e.getMessage()+"ben burdayým dior");
        }
*/        
        //_checked = kullaniciGirisi();
        //if(_checked == true)
        // UiApplication.getUiApplication().pushScreen( new ptMainScreen() );
        //else
        // Dialog.alert(" HAtalý giris ");

       }
       public int getPreferredWidth() {

        return getScreen().getWidth();
       }

       public void setLabel(String label) {

       }

      };

         add(btnLogin);
     }
    });

   }
  });
  add( new SeparatorField() );
  boyar(5);
 }
 public boolean onClose(){

  String msg = new String( " sistem kapatýlýyor " );

  Dialog.alert(msg);
  System.exit( 0 );
  return( true );
 }
 public void boyar(int kacblok ){
  for(int i=0; i<kacblok; i++){
   hrzManager2 = new HorizontalFieldManager(){
    protected void paintBackground(Graphics graphics)
     {
      graphics.setBackgroundColor(0x00382B79);
      graphics.clear();
      super.paint(graphics);
      }
     };
   hrzManager2.add(new LabelField(" ", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH));

   this.add(hrzManager2);

     } 
 }
 public boolean kullaniciGirisi(){

  int checked = 0;


  try{
   ws = Pmain.owner.loginCheck(EditContext[0], EditContext[1]);
   Dialog.alert(" bu þekilde bir yere varamazsýn ");
   if(ws.isCheck()== true){
    checked =1;
   }
   else{
    checked = 0;
   }

  }
  catch( Exception e ){
   if(ws.isCheck()== true){
    checked =1;
   }
   if( ws.isCheck() == false ){
    Dialog.alert(" ikinci if e girdim ");
    checked = 0;
   }
   Dialog.alert(e.getMessage()+"ben burdayým dior");

  }
  if( checked ==1 ){
   return true;
  }
  else{
   Dialog.alert( checked +"");
   return  false;
  }





 }
 public void deneme(){
  try { ps =  Pmain.owner.getPS("bayram", "1");
  Dialog.alert( ps.getPs() + " kisisel ");
 }
 catch( RemoteException e ){ Dialog.alert(" getpsWS.ex  "+e.getMessage()); }

 }
}

1 个答案:

答案 0 :(得分:0)

临时协作的解决方案是稍等一会然后重试。