Skip to content

UnsatisfiedDependencyException Ambiguous argument values for parameter of type [com.arangodb.springframework.core.ArangoOperations] #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hberndt opened this issue Feb 21, 2018 · 7 comments
Assignees
Labels

Comments

@hberndt
Copy link

hberndt commented Feb 21, 2018

Using spring-boot 1.5.10.RELEASE and arangodb-spring-data 1.0.1 we get the following error

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'contractRepository': Unsatisfied dependency expressed through constructor parameter 1: Ambiguous argument values for parameter of type [com.arangodb.springframework.core.ArangoOperations] - did you specify the correct bean references as arguments?
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:736)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
	at ...
@sukratkashyap
Copy link

I am getting the same error.
compile group: 'org.springframework.boot', name: 'spring-boot-devtools', version: '1.5.10.RELEASE'
This dependency in the project seems to trigger it. Do you have this dependency as well. I want to know the work around to it as well.

@mvollmary mvollmary self-assigned this Mar 8, 2018
@mvollmary mvollmary added the bug label Mar 8, 2018
@mvollmary
Copy link

Thank you both for reporting. I'll take a look.

@mark--
Copy link

mark-- commented Mar 15, 2018

We have the same problem when using @MockBean annotations. As a workaround you can set a name for the Annoatation like this: @MockBean(name="foo") Any name will do.

See https://stackoverflow.com/questions/49303080/spring-boot-application-context-with-arangodb-repository-cannot-be-created-if-us for a detailed description and a minimal example project. See the discussion for spring-projects/spring-boot#6541 for a possible explanation.

@mvollmary
Copy link

@hberndt @Sukrat @mark--
I pushed a fix which worked for me when using spring-boot-devtools. Would be nice if you can test it in your environment too. The fix is in 1.0.2-SNAPSHOT and 2.0.3-SNAPSHOT. Please let me know your results, then I can release a new version.

Keep in mind, that you have to add the staging repository of oss.sonatype.org in your project when using one of our snapshots.

<repositories>
  <repository>
    <id>arangodb-snapshots</id>
    <url>https://oss.sonatype.org/content/groups/staging</url>
  </repository>
</repositories>

Thanks & best
Mark

@mark--
Copy link

mark-- commented Mar 19, 2018

We tested version 1.0.2-SNAPSHOT and Spring Boot 1.5.6.Release and it works!
We tested with and without devtools and @MockBean with and without name Parameter.
Thank you for the quick response!

@sukratkashyap
Copy link

sukratkashyap commented Mar 19, 2018

@mpv1989 I have tested the 1.0.2-SNAPSHOT with Spring Boot 1.5.10.Release and it works fine with devtools!

@mvollmary
Copy link

released versions 1.0.2 and 2.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants