Skip to Content
0
Former Member
Sep 12, 2017 at 04:01 PM

JCoDestination Is not responding

199 Views Last edit Sep 12, 2017 at 02:56 PM 2 rev

I have provided my code my issue is below code is working on local but when deploy it on production JCoDestination Is not responding after below line, not even error or log.

destination = JCoDestinationManager.getDestination("mySAPSystem");

check my code once -

public class SapTest {

private static JCoDestination destination=null;
private static String DESTINATION_NAME1 = "mySAPSystem";

public static void main(String[] args) {

Properties connectProperties = new Properties();
connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "xxx.xx.xx.xx");
connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, "xx");
connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "xxx");
connectProperties.setProperty(DestinationDataProvider.JCO_USER, "279824");
connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "xxxxxxx");
connectProperties.setProperty(DestinationDataProvider.JCO_LANG, "EN");

createDestinationDataFile(DESTINATION_NAME1, connectProperties);

try {

destination = JCoDestinationManager.getDestination("mySAPSystem");

destination.ping();

}catch (JCoException e) {
e.printStackTrace();
}

}

private static void createDestinationDataFile(String destinationName, Properties connectProperties) {

File destCfg = new File(destinationName+".jcoDestination");
try
{
FileOutputStream fos = new FileOutputStream(destCfg, false);
connectProperties.store(fos, "for tests only !");
fos.close();
}
catch (Exception e)
{
throw new RuntimeException("Unable to create the destination files", e);
}

}

}