question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Library is not working because of dependencies

See original GitHub issue

Describe the bug With other dependencies library is failing because of lack of dependencies.

To Reproduce

  1. Create Spring Boot project
  2. Add dependency to IEXTrading4j library
  3. Library is not able to parse response because of missing dependency

Expected behavior Library should work fine with other frameworks

Additional context

Caused by: org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=application/json;charset=utf-8, type=interface java.util.List, genericType=java.util.List<pl.zankowski.iextrading4j.api.stocks.Chart>.
	at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:231)
	at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:155)
	at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1085)
	at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:874)
	at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:834)
	at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:368)
	at org.glassfish.jersey.client.InboundJaxrsResponse$2.call(InboundJaxrsResponse.java:126)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:419)
	at org.glassfish.jersey.client.InboundJaxrsResponse.runInScopeIfPossible(InboundJaxrsResponse.java:267)
	at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:123)
	at pl.zankowski.iextrading4j.client.rest.manager.RestManager.executeRequest(RestManager.java:38)
	... 33 more

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
WojciechZankowskicommented, Jul 5, 2018

@1in9ui5t

That looks like dependency conflict. In your dependency tree I can see both:

jsr311-api - This is the official spec jar for the JAX-RS 1.x - from spring-cloud-eureka-client javax.ws.rs-api - This is the official spec jar for the JAX-RS 2.x from my library

Currently most of the libraries moved to JAX-RS 2.x but for whatever reason spring-cloud-eureka still stays on JAX-RS 1.x Most likely because eureka-client-jersey2 that supports JAX-RS 2.x is not maintained by Netflix, but by community.

Some issues related to the topic:

So at the end, to use any library that is using JAX-RS 2.x (not only this one) you would need to exclude this old JAX-RS 1.x spec.

<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
	<version>2.0.0.RC1</version>
	<exclusions>
		<exclusion>
			<artifactId>jsr311-api</artifactId>
			<groupId>javax.ws.rs</groupId>
		</exclusion>
	</exclusions>
</dependency>

You can give it a try if you want, but I cannot guarantee that it will work…

Seems like I cannot do anything more about this, sorry 😦

Cheers,

Wojtek

0reactions
Mahima14CDACcommented, Aug 13, 2019

@1in9ui5t

That looks like dependency conflict. In your dependency tree I can see both:

jsr311-api - This is the official spec jar for the JAX-RS 1.x - from spring-cloud-eureka-client javax.ws.rs-api - This is the official spec jar for the JAX-RS 2.x from my library

Currently most of the libraries moved to JAX-RS 2.x but for whatever reason spring-cloud-eureka still stays on JAX-RS 1.x Most likely because eureka-client-jersey2 that supports JAX-RS 2.x is not maintained by Netflix, but by community.

Some issues related to the topic:

So at the end, to use any library that is using JAX-RS 2.x (not only this one) you would need to exclude this old JAX-RS 1.x spec.

<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
	<version>2.0.0.RC1</version>
	<exclusions>
		<exclusion>
			<artifactId>jsr311-api</artifactId>
			<groupId>javax.ws.rs</groupId>
		</exclusion>
	</exclusions>
</dependency>

You can give it a try if you want, but I cannot guarantee that it will work…

Seems like I cannot do anything more about this, sorry 😦

Cheers,

Wojtek

Thanks 😃 worked like a charm!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Libraries fail with dependency exception - Azure Databricks
Learn why notebook-scoped libraries trigger an Apache Spark dependency exception; return a requirement cannot be satisfied error.
Read more >
Android Repository not working in library module
I have got a project with app module and a library module. The app module can import library module properly.
Read more >
Project dependencies are lost when libraries are updated
I am using VS2017 Enterprise on multiple machines and multiple projects. On all of them, I have to frequently close visual studio and...
Read more >
Dependency hell - Wikipedia
The dependency issue arises when several packages have dependencies on the same shared packages or libraries, but they depend on different and incompatible ......
Read more >
Library dependencies uipath error - Studio
When I try to add this library in empty reframework project without to contains these library it's working. What can cause this problem?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found