# Issue with resolving methods from concrete classes using Gradle build

**URL:** <https://discuss.gradle.org/t/issue-with-resolving-methods-from-concrete-classes-using-gradle-build/21885>\
**Category:** Help/Discuss\
**Tags:** gradle-3297\
**Created:** [March 8, 2017, 2:38pm UTC](https://discuss.gradle.org/t/issue-with-resolving-methods-from-concrete-classes-using-gradle-build/21885 "2017-03-08T14:38:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![realKakarotto](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@realKakarotto](https://discuss.gradle.org/u/realKakarotto)\
**Post date:** [March 8, 2017, 2:38pm UTC](https://discuss.gradle.org/t/issue-with-resolving-methods-from-concrete-classes-using-gradle-build/21885/1 "2017-03-08T14:38:26Z")

</div>

I am trying to use a logger in a subproject. The dependency for this is defined in the subprojects { … } space of my parent gradle.build. My settings.gradle includes the subproject containing the below code. The issue is that I am unable to use an dependencies that provide a concrete implementation of any interface, abstract class or just extends a class to add more methods. For example:  
In my subproject,

import org.slf4j.Logger;  
import org.slf4j.LoggerFactory;  
public class Abc {  
private static final Logger LOGGER = LoggerFactory.getLogger(Abc.class);  
public void method1() {  
[LOGGER.info](http://LOGGER.info)(“Number of entries found for id {} in system is {} of {} expected”,id, system.size(), systemCount);  
//Here, it says that the method info with varargs method parameters is not found and I get an error in this line.

}  
}

/\*  
Actual error reported by gradle build  
C:\GIT\dir1\dir2\dir3\src\main\java\com\something\Abc.java:647: error: no suitable method found for info(String,String,int,int)  
[LOGGER.info](http://LOGGER.info)(“Number of entries found for id {} in system is {} of {} expected”,id, system.size(), systemCount);;  
^  
\*/

I am using Gradle 3.4 directly without a wrapper. The build.gradle files were generated from maven POMs using gradle init and it works fine with maven. I also double checked to make sure all the dependencies were equivalent to that of maven’s.

---

<div class="post-metadata">

**Author:** ![realKakarotto](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@realKakarotto](https://discuss.gradle.org/u/realKakarotto)\
**Post date:** [March 9, 2017, 5:34pm UTC](https://discuss.gradle.org/t/issue-with-resolving-methods-from-concrete-classes-using-gradle-build/21885/2 "2017-03-09T17:34:39Z")

</div>

This got fixed by removing a dependency from the build.gradle file.  
So spring-core and apacheds are two artifacts that both have a class with exact same fully qualified name i.e. org.springframework.util.CollectionUtils. The issue was that CollectionUtils was being picked up from apacheds instead of spring-core. I removed apacheds from the build.gradle and everything got fixed. Even the above stated logger issue got resolved. However, I am still wondering about two things:

1. How come maven did not complaint about this?
2. What should I have done if I could not afford to remove the apacheds dependency from my build.gradle? Is there a way to force gradle to pick up classes from a specific jar?
