我使用 tomcat 7 在 Eclipse 中创建了一个动态 web 项目(并且我使用了动态 web 模块版本 3.0 和 JSF 2.0)。现在,当我不得不从 tomcat 7 切换到 JBoss 4.2.1 时,似乎存在某种兼容性问题,因为 JBoss 不允许动态 Web 模块版本 3.0 而是 2.5 和 JSF 1.2 而不是我使用的 JSF 3.0。因此,当我尝试在将使用 JBoss 的新项目中部署我的旧项目时,出现了这个奇怪的错误:
我有这个DBManager
实现 2 个接口(UserManageable
和CategoryManageable
)的类。在UserManageable
I have a method void doInsert(User user)
,doUpdate(User)
等中,但 eclipse 告诉我有错误并提供 2 个解决方案:第一个删除@Override
注释,第二个doInsert(User)
在另一个界面中创建。如果我删除另一个接口,它只会为我提供第一个解决方案。
这是类和接口。
import jsfDP.interfaces.CategoryManageable;
import jsfDP.interfaces.UserManageable;
public class DBManager implements UserManageable, CategoryManageable{
@Override
public void doInsert(User user) {
// here I get
// The method doInsert(User) of type DBManager must override a superclass method
// 2 quick fixes available:
// Create doInsert() in supertype 'CategoryManageable'
// Remove '@Override' annotation
....
}
....
}
接口UserManageable
:
import java.util.List;
import jsfDP.beans.User;
public interface UserManageable {
void doInsert(User user);
void doUpdate(User user);
void doDelete(User user);
User getUserById(int userId);
List<Integer> getUserIds();
List<User> getAllUsersInList();
}
接口CategoryManageable
:
package jsfDP.interfaces;
import java.util.List;
import jsfDP.beans.Category;
public interface CategoryManageable {
List<Category> getCagegories();
}