Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Lyo » Exception in oslcClient.lookupServiceProviderUrl
Exception in oslcClient.lookupServiceProviderUrl [message #1444058] Mon, 13 October 2014 15:26 Go to next message
Jan-Patrick Osterloh is currently offline Jan-Patrick OsterlohFriend
Messages: 6
Registered: September 2014
Junior Member
Dear all,

I used the GeneratorModel approach to create the Service Provider Catalog, the Services etc for my own Service. Now I'm writing the Client side, and I decided to use the OsclClient from org.eclipse.lyo.client.java, staring from the GenericCMSample:
String catalogUrl = "...";
String providerTitle = "...";
//STEP 1: Create a new generic OslcClient
OslcClient client = new OslcClient();
			
//STEP 2: Find the OSLC Service Provider 
String serviceProviderUrl = client.lookupServiceProviderUrl(catalogUrl, providerTitle);

When I paste the catalogUrl into my browser, I can see the generated html for my catalog, and everything seem to work. However, when I start the code above, I get a ResourceNotFoundException (org.eclipse.lyo.client.exception.ResourceNotFoundException: OSLCC004: The requested resource could not be found).
With some debugging, I found that the getServiceProviderCatalog() of the generated ServiceProviderCatalogService is called, and returns the correct ServiceProviderCatalog. But when the getResource() Method in the OsclClient returns in the lookupServiceProviderUrl(), the ClientResponse shows an Error 400 Bad Request, and the catalog is null in this code:
public String lookupServiceProviderUrl(final String catalogUrl, final String serviceProviderTitle) throws IOException, OAuthException, URISyntaxException, ResourceNotFoundException
  {
    String retval = null;
    ClientResponse response = getResource(catalogUrl, OSLCConstants.CT_RDF);
    System.out.println("RESP: " + response.getStatusCode() + " " + response.getMessage());
    ServiceProviderCatalog catalog = response.getEntity(ServiceProviderCatalog.class);
...

This results in the following output:
RESP: 400 Bad Request
org.eclipse.lyo.client.exception.ResourceNotFoundException: OSLCC004: The requested resource could not be found.  Resource: .../services/catalog/1  Value: WCET.
	at org.eclipse.lyo.client.oslc.OslcClient.lookupServiceProviderUrl(OslcClient.java:395)

Any Idea what this could be, or how to fix that? Any help is appreciated.

Best regards
Jan-Patrick
Re: Exception in oslcClient.lookupServiceProviderUrl [message #1444166 is a reply to message #1444058] Mon, 13 October 2014 18:41 Go to previous message
Samuel Padgett is currently offline Samuel PadgettFriend
Messages: 30
Registered: July 2009
Member
Jan-Patrick,

I'd recommend setting a breakpoint in the provider where it handles request for catalogs. Also check the Eclipse console for errors. Without seeing the generated code, it's difficult to say what's wrong. This request shouldn't result in a 400 error, so it's almost certainly a provider problem.

Sam
Previous Topic:Provider Link Modifications
Next Topic:OSLC Consumer Implementation with CM 2.0 Specification
Goto Forum:
  


Current Time: Fri Apr 26 05:06:03 GMT 2024

Powered by FUDForum. Page generated in 0.02644 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top