[英]Method in Java showing error in Eclipse, builds fine with Maven
I cant get rid of this error in Eclipse. 我无法摆脱Eclipse中的这个错误。 The project is using Java 8 and so is Eclipse so I am at a stand still why I am getting this error below. 该项目使用的是Java 8,Eclipse也使用的是Java,所以我仍然站在下面为什么会出现此错误。
The method setTomcatContextCustomizers(Collection<? extends TomcatContextCustomizer>) in the type TomcatEmbeddedServletContainerFactory is not applicable for the arguments (List<Object>)
tomcatFactory.setTomcatContextCustomizers(Arrays.asList(context -> {
JDBCStore store = new JDBCStore();
store.setDriverName(tomcatConfig.getStoreDriverName());
store.setConnectionURL(jdbcUrl);
store.setConnectionName(jdbcUser);
store.setConnectionPassword(jdbcPassword);
store.setSessionAppCol(tomcatConfig.getStoreSessionAppCol());
store.setSessionDataCol(tomcatConfig.getStoreSessionDataCol());
store.setSessionIdCol(tomcatConfig.getStoreSessionIdCol());
store.setSessionLastAccessedCol(tomcatConfig.getStoreSessionLastAccessedCol());
store.setSessionMaxInactiveCol(tomcatConfig.getStoreSessionMaxInactiveCol());
store.setSessionTable(tomcatConfig.getStoreSessionTable());
store.setSessionValidCol(tomcatConfig.getStoreSessionValidCol());
PersistentManager pm = new PersistentManager();
pm.setDistributable(true);
pm.setProcessExpiresFrequency(tomcatConfig.getPersistenceManagerProcessExpiresFrequency());
pm.setMaxIdleBackup(tomcatConfig.getPersistenceManagerMaxIdleBackup());
pm.setStore(store);
context.setManager(pm);
}));
Have you tried cleaning up your eclipse workspace by going to Project->Clean and then refreshing it by going to File->Refresh? 您是否尝试过通过转到Project-> Clean并随后通过File-> Refresh刷新其Eclipse工作空间的方法?
This usually works for me when I encounter the same behavior with errors showing up in eclipse but not while building with maven. 当我遇到相同的行为但在Eclipse中出现错误但在使用Maven构建时却没有出现时,这通常对我有用。
通过Eclipse Kepler和Java 7在发生这种情况时,通过Eclipse的菜单窗口→首选项→Maven→安装和添加外部Maven安装总是对我有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.