Error in creating remedy ticket using java

0

i need a Java class to submit tickets to BMC Remedy's but i was getting error could anyone please help me how to resolve that error.

Find the below code:

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();
}
}
}

Here is the 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)

Thanks in advance.

java
remedy
asked on Stack Overflow Jun 20, 2017 by Taamil Arasan • edited Jun 20, 2017 by Hovercraft Full Of Eels

1 Answer

0

This is old but for anyone looking at it after; the code looks fine. ARERROR 91 is typically a networking issue. Port 3389 is the default for Remote Desktop. Therefore, I wonder if you are tunneling to localhost and trying to connect to the Windows machine that you RDP to? Instead of the TCP port the AR Server is actually running on and let in through the Windows firewall?

answered on Stack Overflow Oct 7, 2019 by DannyK

User contributions licensed under CC BY-SA 3.0