Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用java创建补救票证时出错_Java_Remedy - Fatal编程技术网

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

使用java创建补救票证时出错,java,remedy,Java,Remedy,我需要一个Java类来向BMC Remedy提交票据,但我遇到了一个错误。有人能帮我解决这个错误吗 查找以下代码: public class RemedyCreateTicket { public static void main(String args[]) { ARServerUser arsServer = new ARServerUser(); Entry args1 = new Entry(); Entry incidentID; String arForm = "H

我需要一个Java类来向BMC Remedy提交票据,但我遇到了一个错误。有人能帮我解决这个错误吗

查找以下代码:

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();
}
}
}
以下是stacktrace:

Jun 20, 2017 4:11:55 PM java.util.prefs.WindowsPreferences openKey
WARNING: Could not open windows registry node Software\JavaSoft\Prefs at root 0x80000002. Windows RegOpenKey(...) returned error code 2.
Jun 20, 2017 4:11:55 PM java.util.prefs.WindowsPreferences closeKey
WARNING: Could not close windows registry node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCloseKey(...) returned error code 6.
**ERROR (91): RPC call failed; localhost:3389 Connection reset**
    at com.bmc.arsys.apitransport.ApiProxyJRpcBase.convertException(ApiProxyJRpcBase.java:643)
    at com.bmc.arsys.api.ProxyJRpc.getRpcClient(ProxyJRpc.java:135)
    at com.bmc.arsys.api.ProxyJRpc.<init>(ProxyJRpc.java:67)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.bmc.arsys.apitransport.connection.ApiProxyFactory.createProxyInstance(ApiProxyFactory.java:89)
    at com.bmc.arsys.apitransport.connection.ApiProxyFactory.createProxy(ApiProxyFactory.java:160)
    at com.bmc.arsys.api.ProxyManager.createProxy(ProxyManager.java:602)
    at com.bmc.arsys.api.ProxyPool.createProxy(ProxyPool.java:106)
    at com.bmc.arsys.apitransport.connection.ApiProxyPool.get(ApiProxyPool.java:192)
    at com.bmc.arsys.apitransport.connection.ApiProxyManager.getProxy(ApiProxyManager.java:210)
    at com.bmc.arsys.api.PoolingProxyManager.getProxy(PoolingProxyManager.java:93)
    at com.bmc.arsys.apitransport.connection.ApiProxyManager.getProxy(ApiProxyManager.java:164)
    at com.bmc.arsys.api.ARServerUser.verifyUser(ARServerUser.java:1085)
    at com.bmc.arsys.api.ARServerUser.login(ARServerUser.java:412)
    at Remedi.RemedyCreateTicket.main(RemedyCreateTicket.java:46)
2017年6月20日下午4:11:55 java.util.prefs.WindowsPreferences openKey
警告:无法打开根目录0x8000002上的windows注册表节点Software\JavaSoft\Prefs。Windows RegOpenKey(…)返回错误代码2。
2017年6月20日下午4:11:55 java.util.prefs.WindowsPreferences closeKey
警告:无法关闭根0x8000002上的windows注册表节点Software\JavaSoft\Prefs。Windows RegCloseKey(…)返回错误代码6。
**错误(91):RPC调用失败;本地主机:3389连接重置**
位于com.bmc.arsys.apitransport.ApiProxyJRpcBase.convertException(ApiProxyJRpcBase.java:643)
位于com.bmc.arsys.api.ProxyJRpc.getRpcClient(ProxyJRpc.java:135)
位于com.bmc.arsys.api.ProxyJRpc.(ProxyJRpc.java:67)
位于sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)
位于sun.reflect.NativeConstructorAccessorImpl.newInstance(未知源)
位于sun.reflect.delegatingConstructor或AccessorImpl.newInstance(未知源)
位于java.lang.reflect.Constructor.newInstance(未知源)
在com.bmc.arsys.apitransport.connection.ApiProxyFactory.createProxyInstance(ApiProxyFactory.java:89)上
在com.bmc.arsys.apitransport.connection.ApiProxyFactory.createProxy(ApiProxyFactory.java:160)上
位于com.bmc.arsys.api.ProxyManager.createProxy(ProxyManager.java:602)
位于com.bmc.arsys.api.ProxyPool.createProxy(ProxyPool.java:106)
位于com.bmc.arsys.apitransport.connection.ApiProxyPool.get(ApiProxyPool.java:192)
位于com.bmc.arsys.apitransport.connection.ApiProxyManager.getProxy(ApiProxyManager.java:210)
在com.bmc.arsys.api.poolgproxymanager.getProxy上(poolgproxymanager.java:93)
位于com.bmc.arsys.apitransport.connection.ApiProxyManager.getProxy(ApiProxyManager.java:164)
位于com.bmc.arsys.api.ARServerUser.verifyUser(ARServerUser.java:1085)
位于com.bmc.arsys.api.ARServerUser.login(ARServerUser.java:412)
在Remedi.RemedyCreateTicket.main(RemedyCreateTicket.java:46)

提前感谢。

这本书很旧,但对以后看它的人来说;代码看起来不错。a错误91通常是一个网络问题。端口3389是远程桌面的默认端口。因此,我想知道您是否正在通过隧道连接到localhost并尝试连接到RDP要连接的Windows计算机?AR服务器实际运行的不是TCP端口,而是通过Windows防火墙进入的端口?

从错误日志看,这似乎是网络问题。感谢您的快速回复Akshay,代码正确吗?他们在代码中没有错误?我已经这样做了..创建补救票据..在非BMC网络上时,我曾经遇到过此类错误..使用vpn或使用BMC网络解决了这些问题如果是网络问题,考虑到调用localhost,我会感到惊讶。JS。您是否实际打开了端口3389?ARERR(91)表示网络连接@apexlol中存在一些不正常或故障