1
我正在開發一個使用atlassian-sdk的Bitbucket插件。當我嘗試使用GitCommandFactory,我碰到下面的錯誤:如何解決「AOP配置似乎無效」的錯誤?
"AOP configuration seems to be invalid: tried calling method [public
abstract com.atlassian.bitbucket.scm.git.command.GitCommandFactory
com.atlassian.bitbucket.scm.git.GitScm.getCommandFactory()] on target
[[email protected]]; nested
exception is java.lang.IllegalArgumentException: object is not an
instance of declaring class"
這是代碼引發錯誤行:
GitCommandFactory gitCommandFactory = gitScm.getCommandFactory();
我班的一瞥和構造:
@ComponentImport
private final PullRequestService pullRequestService;
@ComponentImport
private final GitScm gitScm;
@ComponentImport
private final GitScmConfig gitScmConfig;
@ComponentImport
private final EventPublisher eventPublisher;
@Autowired
private ApplicationContext applicationContext;
private Logger loggerLocal;
@Autowired
public SquashServlet(PullRequestService pullRequestService, GitScm gitScm, GitScmConfig gitScmConfig, EventPublisher eventPublisher) throws Exception{
super();
this.pullRequestService = pullRequestService;
this.gitScm = gitScm;
this.gitScmConfig = gitScmConfig;
this.eventPublisher = eventPublisher;
FileHandler handler = new FileHandler("BitBuckSquash.log",true);
this.loggerLocal = java.util.logging.Logger.getLogger("com.atlassian.kaushik.plugin.servlet");
loggerLocal.addHandler(handler);
}
我該如何解決這個問題?我究竟做錯了什麼?