0
我不明白爲什麼我得到這個錯誤下面我已經包括所有適當的罐子,據我可以告訴(我已經包括日食.classpath文件下面。)所有的classpath條目解決得很好。我錯過了什麼?建立路徑問題學習Guice
無法解析javax.servlet.ServletContextListener類型。它間接地從所需的.class文件中引用的 「延伸GuiceServletContextListener」 線
-
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;
import com.google.inject.servlet.ServletModule;
public class ServletConfig extends GuiceServletContextListener {
@Override
protected Injector getInjector() {
return Guice.createInjector(new ServletModule(){
@Override
protected void configureServlets() {
// TODO: add necessary code to bind
}
});
}
}
的.classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_21">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="oracle.eclipse.tools.glassfish.lib.system">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="lib" path="guice-3.0/aopalliance.jar"/>
<classpathentry kind="lib" path="guice-3.0/guice-3.0.jar"/>
<classpathentry kind="lib" path="guice-3.0/guice-servlet-3.0.jar"/>
<classpathentry kind="lib" path="guice-3.0/javax.inject.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>