我在 Eclipse 3.4、Jsf 1.2、java 1.7、tomcat 7 和 owl api 4.0 中有一个动态 Web 项目。我在 java 的支持 bean 中使用示例代码。此代码在 Java 应用程序中运行顺利,但在 JSF 项目中使用并在 tomcat 7 服务器上运行时会产生错误。
代码片段如下:-
OWLOntologyWalkerVisitor<Object> visitor = new OWLOntologyWalkerVisitor<Object>(
walker) {
@Override
public Object visit(OWLObjectSomeValuesFrom desc) {
// Print out the restriction
System.out.println(desc);
// Print out the axiom where the restriction is used
System.out.println(" " + getCurrentAxiom());
System.out.println();
// We don't need to return anything here.
return null;
}
};
// Now ask the walker to walk over the ontology structure using our
// visitor instance.
walker.walkStructure(visitor);
而它产生的错误是: -
The type OWLOntologyWalkerVisitor is not generic; it cannot be parameterized with arguments<Object>
任何线索为什么会发生这种情况?