Hi I am trying to run an example (example450__MarketPrice__QueryServiceDiscovery) and facing an error
in serviceDiscovery.registerClient
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/client/ClientProtocolException
at com.thomsonreuters.upa.valueadd.reactor.RestClient.<init>(RestClient.java:62)
at com.thomsonreuters.upa.valueadd.reactor.Reactor$1.<init>(Reactor.java:971)
at com.thomsonreuters.upa.valueadd.reactor.Reactor.createRestClient(Reactor.java:970)
at com.thomsonreuters.upa.valueadd.reactor.Reactor.initRestClientForQueryServiceDiscovery(Reactor.java:1057)
at com.thomsonreuters.upa.valueadd.reactor.Reactor.queryServiceDiscovery(Reactor.java:932)
at com.thomsonreuters.ema.access.ServiceEndpointDiscoveryImpl.registerClient(ServiceEndpointDiscoveryImpl.java:192)
at com.thomsonreuters.ema.access.ServiceEndpointDiscoveryImpl.registerClient(ServiceEndpointDiscoveryImpl.java:99)
at testSample.Consumer.main(Consumer.java:293)
Caused by: java.lang.ClassNotFoundException: org.apache.http.client.ClientProtocolException
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 8 more
I have the following code, which reads machineid/userName, password,clientid, keyfile and keypasswd. I have these vales stored in config.properties files
static boolean readCommandlineArgs(String[] args, OmmConsumerConfig config)
{
try
{
int argsCount = 0;
Consumer cons = new Consumer();
Properties properties = new Properties();
InputStream fs = cons.getClass().getClassLoader().getResourceAsStream("config.properties"); //new InputStreamReader("config.properties");
properties.load(fs);
userName = properties.getProperty("userName");
password = properties.getProperty("password");
clientId = properties.getProperty("clientId");
config.tunnelingKeyStoreFile(properties.getProperty("keyfile"));
config.tunnelingKeyStorePasswd(properties.getProperty("keypasswd"));
if ( userName == null || password == null || clientId == null)
{
System.out.println("Username, password, and clientId must be specified on the command line. Exiting...");
printHelp();
return false;
}
}
catch (Exception e)
{
printHelp();
return false;
}
return true;
}
And my properties file is like this
userName=GE-A-11111111-1-1111
password=NWfcW@g)>(Q[abcd_2(RdRmY#QhsN`/r/f9^~8.)q<&j9<Q<z3
clientId=2a93d054b1cd4f00a7b12345c5ee890a2ad7b18b
keyfile=c:\\KeyStore\\local.keystore
keypasswd=abcd123@
Can anybody help in fixing this issue?
Thanks