I have two Mybatis mappers:
<code>@Mapper
public interface AccountMapper { // methods}
@Mapper
public interface SpecialAccountMapper extends AccountMapper {// methods}
</code>
<code>@Mapper
public interface AccountMapper { // methods}
@Mapper
public interface SpecialAccountMapper extends AccountMapper {// methods}
</code>
@Mapper
public interface AccountMapper { // methods}
@Mapper
public interface SpecialAccountMapper extends AccountMapper {// methods}
The above code works fine without obfuscation. But when I added proguard obfuscation, I got a runtime error:
<code>NoUniqueBeanDefinitionException: No qualifying bean of type 'com.xxx.data.mapper.AccountMapper' available: expected single matching bean but found 2: SpecialAccountMapper,AccountMapper
</code>
<code>NoUniqueBeanDefinitionException: No qualifying bean of type 'com.xxx.data.mapper.AccountMapper' available: expected single matching bean but found 2: SpecialAccountMapper,AccountMapper
</code>
NoUniqueBeanDefinitionException: No qualifying bean of type 'com.xxx.data.mapper.AccountMapper' available: expected single matching bean but found 2: SpecialAccountMapper,AccountMapper
I referenced the above mappers in Account service:
<code>public abstract class AbstractAccountService {
@Resource
AccountMapper accountMapper;
@Resource
SpecialAccountMapper specialAccounttMapper;
}
</code>
<code>public abstract class AbstractAccountService {
@Resource
AccountMapper accountMapper;
@Resource
SpecialAccountMapper specialAccounttMapper;
}
</code>
public abstract class AbstractAccountService {
@Resource
AccountMapper accountMapper;
@Resource
SpecialAccountMapper specialAccounttMapper;
}
The AccountService
extends AbstractAccountService
and has no duplicate fields. Because of the above error, AccountService
bean cannot be created.
In my Proguard config, I already have -keep interface com.xxx.data.mapper.* {*;}
The output interface classes do not have any obfuscation as expected, but I still got the runtime error.