MPact Dependency Issues

I know this is not the right space for this question.  I don't have access to the MPact space; so I do not know where else to post this.  If someone can move this into the right space I would greatly appreciate it.

 

The MPact Server API Overview documentation goes over some of the RESTful APIs we can use to query for beacon, client and site data.  In section 2.3 "Sample Type Query Using a Java Client" there is an example listed that references a Jersey 2.13 dependency.  The Jersey package has since updated to 2.21, and v2.13 does not seem to be readily available for use.  Regardless, I managed to pull the whole maven project down and build v2.13 from source, but it seems to be missing one or more of the dependencies listed in the example.  Looking at the class hierarchy for v2.13, com.sun.jersey.api.client.* has become org.glassfish.jersey.client.* and com.sun.jersey.api.client.config doesn't exist at all.  I had to go all the way back to v1.19 in order to get the correct package structure and classes, but I am still missing javax.ws.rs.core.URLBuilder.  In fact, the documentation for 2.13 doesn't even list that as an available class.  I can look through documentation all the way back to v1.19, and I still cannot find URLBuilder as a class.  URIBuilder exists, but I do not know if it will produce the same results.

 

Where can I acquire the correct Jersey files to use to query an MPact server? or what alternative package/class can I use?

 

Thank you very much.

Anonymous (not verified)
Hi Jon-Luke, I will attempt

Hi Jon-Luke, I will attempt to move this...

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon-Luke West
Thank you!

Thank you!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Seth Atkins
I suspect this is a simple

I suspect this is a simple typo in the manual. I would try URIBuilder and you should be able to use this on any client version that exceeds the minimum requirements, and not have to go back to compile an older version.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon-Luke West
Seth,Due to the major package

Seth,

Due to the major package restructuring that occurred in the Jersey library, I was forced to "find" all of the correct classes to try and piece together the same code using the most up-to-date version of Jersey. (Ex com.sun.jersey.api.client.* has become org.glassfish.jersey.client.* and com.sun.jersey.api.client.config doesn't exist at all)  Going back to v1.19, to use the package structure that is documented, and using URIBuilder instead doesn't seem to produce a working result.

I did some more work on this and tried out the RoboSpice open-source library to see if it was an issue with Jersey.  I seem to be having more success with Robospice, but the application crashes reporting that the JSON response was unreadable/unparsable.  By switching my response filter to plain text, I am able to successfully initiate the GET and read the JSON response as a string.  I will pull open my code again and try to post the exact error messages I'm getting from Jersey and Robospice as soon as I can.

Thank you very much!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Seth Atkins
I think we will have to edit

I think we will have to edit that section of the guide and update it. I'm told by one of our engineers that:

client.resource(http://...) will also work.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments