Skip to Content.
Sympa Menu

grouper-users - Help with accessing web services

Subject: Grouper Users - Open Discussion List

List archive

Help with accessing web services


Chronological Thread 
  • From: Paul Gazda <>
  • To: "" <>
  • Subject: Help with accessing web services
  • Date: Wed, 4 Feb 2009 11:03:34 -0700
  • Accept-language: en-US
  • Acceptlanguage: en-US

I am trying to access grouper web services using REST. I am trying to use the sample code for WsSampleFindStemsRestLite (in grouper-ws/src/test/edu/internet2/middleware/grouper/ws/samples/rest/stem) as a model, but I need to incorporate it in a uPortal channel rather than running it from a command line. I keep getting ClassNotFound error for com/thoughtworks/xstream/io/json/JettisonMappedXmlDriver that I can’t get around. I see that the class is in the grouperClient.jar which I have deployed to the proper lib under the uPortal app in Tomcat 5.5.9. But I see that the classpath is different in grouperClient.jar since it prepends edu.internet2.middleware.grouperClientExt to the com.thoughtworksclasspath. Details of the code and error are below.

 

Any help is greatly appreciated.

Paul Gazda

 

 

      HttpClient httpClient = new HttpClient();

 

      DefaultHttpParams.getDefaultParams().setParameter(

          HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(0, false));

 

      //URL e.g. http://localhost:8093/grouper-ws/servicesRest/v1_3_000/...

      //NOTE: aStem:aGroup urlencoded substitutes %3A for a colon

      PostMethod method = new PostMethod(

          "http://testgrouperserver.ucc.nau.edu/grouper-ws/servicesRest/v1_4_000/stems");

 

      httpClient.getParams().setAuthenticationPreemptive(true);

      Credentials defaultcreds = new UsernamePasswordCredentials("xxxxx", "xxxxx");

 

      //no keep alive so response if easier to indent for tests

      method.setRequestHeader("Connection", "close");

 

      //e.g. localhost and 8093

      httpClient.getState()

          .setCredentials(new AuthScope("http:// testgrouperserver.ucc.nau.edu", 80), defaultcreds);

 

      //Make the body of the request, in this case with beans and marshaling, but you can make

      //your request document in whatever language or way you want

      WsRestFindStemsLiteRequest findStemsLite = new WsRestFindStemsLiteRequest();

 

      // set the act as id

      findStemsLite.setActAsSubjectId("GrouperSystem");

 

      findStemsLite.setStemName("NAU");

      findStemsLite.setStemQueryFilterType(WsStemQueryFilterType.FIND_BY_STEM_NAME_APPROXIMATE.name());

 

      //get the xml / json / xhtml / paramString

      WsSampleRestType wsSampleRestType = WsSampleRestType.xhtml;

      String requestDocument = wsSampleRestType.getWsLiteRequestContentType().writeString(findStemsLite);

.

.

.

 

 

When it executes the line “WsSampleRestType wsSampleRestType = WsSampleRestType.xhtml;”

it throws this error:

ERROR [http-8443-Processor25] portal.ChannelRenderer.[] Feb/04 10:38:17 - Unexpected exceptional condition trying to get the result from the workTracker Future rendering channel [edu.nau.its.sia.portal.channels.ldapSvcs.CLdapSvcs@1c304c7].

edu.emory.mathcs.backport.java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/json/JettisonMappedXmlDriver

.

.

.

Caused by: java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/json/JettisonMappedXmlDriver

            at edu.internet2.middleware.grouper.ws.samples.types.WsSampleRestType.<clinit>(WsSampleRestType.java:17)

            at edu.nau.its.sia.portal.channels.ldapSvcs.LdapAccess.stAliasSearch(LdapAccess.java:5239)

.

.

.

 




Archive powered by MHonArc 2.6.16.

Top of Page