[英]Gradle project in eclipse builds fine but java files show compilation error
[英]Method in Java showing error in Eclipse, builds fine with Maven
我無法擺脫Eclipse中的這個錯誤。 該項目使用的是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);
}));
您是否嘗試過通過轉到Project-> Clean並隨后通過File-> Refresh刷新其Eclipse工作空間的方法?
當我遇到相同的行為但在Eclipse中出現錯誤但在使用Maven構建時卻沒有出現時,這通常對我有用。
通過Eclipse Kepler和Java 7在發生這種情況時,通過Eclipse的菜單窗口→首選項→Maven→安裝和添加外部Maven安裝總是對我有幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.