Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Problem in accessing Dynamics from a Java Application

$
0
0
Hi,

I followed the link http://msdn.microsoft.com/en-in/library/jj602979.aspx to connect to Micsrosoft Dynamic CRM from a JAVA Application.

The first error which I got was "import org.apache.http.client.HttpClient;" because it could not be resolved.

The reason for this is the library which I was asked to download from http://hc.apache.org/downloads.cgi. I went to this link and selected 4.2.5.tar.gz. I hope I have selected the right option in this link. This had only libraries like httpcore-4.2.4.jar, httpcore-ab-4.2.4.jar and httpcore-nio-4.2.4.jar.

It did not have the httpclient.jar. So then I downloaded the apache-httpcomponents-httpclient.jar from http://www.java2s.com/Code/Jar/a/Downloadapachehttpcomponentshttpclientjar.htm because this is the only place I got the Client jar. It is not inside  http://hc.apache.org/downloads.cgi

Then the errors were gone.

But when I run the app it says: 

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/protocol/ImmutableHttpProcessor
at org.apache.http.impl.client.AbstractHttpClient.getProtocolProcessor(AbstractHttpClient.java:656)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:804)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
at java2crmpack.WsdlTokenManager.getSOAPResponse(WsdlTokenManager.java:287)
at java2crmpack.WsdlTokenManager.authenticate(WsdlTokenManager.java:206)
at java2crmpack.main.main(main.java:98)
Caused by: java.lang.ClassNotFoundException: org.apache.http.protocol.ImmutableHttpProcessor
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 7 more



The line which is throwing the error is:

        SecurityData discoverySecurityData = discoeryTokenManager.authenticate(DiscoveryServiceURL, 
                    UserName, 
                    UserPassword,
                    discoveryPolicy.getAppliesTo(),
                    discoveryPolicy.getPolicy(),
                    discoveryPolicy.getIssuerUri());



Please help Me!!!



Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>