azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

ServiceBusContract class throws Exception on Storm cluster

Open arbarik opened this issue 11 years ago • 3 comments

On a Storm cluster if we are trying to access Azure Service bus, it fails with below exception.

Service or property not registered: com.microsoft.windowsazure.services.servicebus.ServiceBusContract class com.sun.jersey.api.client.Client

This does not happen on our local Storm installation.

arbarik avatar Mar 02 '15 06:03 arbarik

We had a similar issue in storm cluster when we are creating a shaded jar which includes below jar files with a bunch of other jars:

microsoft-azure-api-core-0.5.0.jar microsoft-azure-api-servicebus-0.5.0.jar

There is a services resource file with same name "/META-INF/services/com.microsoft.windowsazure.core.Builder$Exports" in both the jar files

When the shaded jar is created, services entries from microsoft-azure-api-core-0.5.0.jar are overwritten with the service entries from microsoft-azure-api-servicebus-0.5.0.jar as the resource file name is same.

To fix this we used ServicesResourceTransformer class in maven-shade-plugin to merge the resource file from both the jars instead of overwriting as per below link:

http://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html#ServicesResourceTransformer

tlsaikishore avatar Mar 04 '15 09:03 tlsaikishore

thanks, above workaround solves the issue

arbarik avatar Apr 26 '15 13:04 arbarik

hi arbarik, we are also facing the same issue.. After using shading, when we try to deploy the jar, we are getting "Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jersey/api/client/config/ClientConfig" Could you please tell us how did u resolve this issue??

psekar83 avatar May 11 '15 10:05 psekar83