使用java创建补救票证时出错

时间:2017-06-20 11:02:39

标签: java remedy

我需要一个Java类来提交BMC Remedy的门票,但我收到错误,任何人都可以帮我解决这个错误。

找到以下代码:

if (this.destination_distance<300) {
    this.current_speed = 1.5; //start fast when in the deceleration zone
} else {
    this.current_speed = 0.1; //start slow when in the acceleration zone
}

这是stacktrace:

public class RemedyCreateTicket {

 public static void  main(String args[]) {

ARServerUser     arsServer = new ARServerUser();
Entry args1 = new Entry();
Entry incidentID;

String arForm = "HPD:IncidentInterface_Create";
String arForm1 = "HPD:IncidentInterface";

String IntEntryID = "";
String inciID = "";

try {

    //Create Ticket Part
    String strLastName = "radadiya";
    String strFirstName ="pragnesh";


    args1.put(new Integer("1000000076"),new Value("CREATE"));        //ticket_action
    args1.put(new Integer("1000000018"),new Value(strLastName));     //contact user first_name
    args1.put(new Integer("1000000019"),new Value(strFirstName));    //contact user    last_name
    args1.put(new Integer("7"), new Value("1"));                     //ticket status
    args1.put(new Integer("1000000099"),new Value("3"));             //service type
    //args1.put(new Integer("1000000163"),new Value("4000"));          //impact
    args1.put(new Integer("1000000162"),new Value("4000"));          //urgency
    args1.put(new Integer("1000000000"),new Value("Remedy 7.5 java api test")); //description
    args1.put(new Integer("1000000215"),new Value("10000"));                                      


    arsServer.setServer("localhost");
    arsServer.setUser("pragnesh");
    arsServer.setPassword("password");
    arsServer.setPort(3389);

    arsServer.login();

    //arsServer.setPort(3389);
    IntEntryID = arsServer.createEntry(arForm, args1);
    System.out.println("intEntryID="+IntEntryID);

    int[] entryField = {1000000161};        
    incidentID = arsServer.getEntry(arForm,IntEntryID,entryField);        

    if(incidentID!=null){
        System.out.println(incidentID);
    }        
    System.out.println("------------");

    for (Object o : incidentID.entrySet()) {
          Map.Entry e = (Map.Entry) o;              
          System.out.println(e.getKey() + " => " + e.getValue().getClass() + " " + e.getValue());
          if(e.getKey().toString().equalsIgnoreCase("1000000161")){
              inciID=e.getValue().toString();
          }
        }
    System.out.println("IncidentID = " + inciID);

    arsServer.logout();

} catch (ARException e) {
    e.printStackTrace();
    arsServer.logout();
}
}
}

提前致谢。

1 个答案:

答案 0 :(得分:0)

这是旧的,但对于以后看它的人来说;代码看起来不错。 ARERROR 91通常是网络问题。端口3389是远程桌面的默认端口。因此,我想知道您是否正在隧道传输到localhost并尝试连接到RDP所连接的Windows计算机吗? AR Server实际上是在运行Windows而不是通过TCP端口进入Windows防火墙的?