2012-02-15 61 views
0

我build.sbt:xsbt-網:啓動容器後,我無法訪問網頁

name := "admin" 

version := "1.0" 

scalaVersion := "2.9.1" 

seq(webSettings: _*) 

scanDirectories in Compile := Nil 

/************************************************************************/ 
// Jetty configurations 
port in container.Configuration := 9091 
/************************************************************************/ 

resolvers ++= Seq(
    "Scala Tools Releases" at "http://scala-tools.org/repo-releases/", 
    "Java.net Maven2 Repository" at "http://download.java.net/maven/2/" 
) 

libraryDependencies ++= { 
    val liftVersion = "2.4" // Put the current/latest lift version here 
    Seq(
    "net.liftweb" %% "lift-webkit" % liftVersion % "compile->default", 
    "net.liftweb" %% "lift-mapper" % liftVersion % "compile->default", 
    "net.liftweb" %% "lift-wizard" % liftVersion % "compile->default" 
) 
} 

libraryDependencies ++= Seq(
    "org.apache.httpcomponents" % "httpclient" % "4.1.2", 
    "javax.servlet" % "servlet-api" % "2.5" % "provided", 
    "junit" % "junit" % "3.8" % "test", 
    "org.eclipse.jetty" % "jetty-webapp" % "7.3.0.v20110203" % "container", 
    "ch.qos.logback" % "logback-classic" % "0.9.26" 
) 

項目/ plugins.sbt

resolvers += "Web plugin repo" at "http://siasia.github.com/maven2" 

libraryDependencies <+= sbtVersion(v => "com.github.siasia" %% "xsbt-web-plugin" % (v + "-0.2.11")) 

後重新從命令行配置,我嘗試執行container:start,然後訪問http://localhost:9091但失敗。容器的

日誌信息:啓動

> container:start 
[info] jetty-7.3.0.v20110203 
[info] NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet 
[info] started o.e.j.w.WebAppContext{/,[file:/D:/codebase/project/almeet-web/src 
/main/webapp/]} 
[info] Started [email protected]:9091 
[success] Total time: 1 s, completed Feb 15, 2012 1:46:18 PM 

,所以我想知道如果我錯過了一些配置?

+0

和我在哪裏可以找到碼頭日誌? – 2012-02-15 05:54:13

回答

0

什麼在./src/main/webapp/META-INF/web.xml

該插件包含許多測試項目。這裏有一個簡單的servlet項目:

https://github.com/siasia/xsbt-web-plugin/blob/master/src/sbt-test

而內的,web.xml

https://github.com/siasia/xsbt-web-plugin/blob/master/src/sbt-test/web/servlet/src/main/webapp/WEB-INF/web.xml

+0

謝謝。實際上,我忘了禁用代理,以至於無法訪問本地主機,即使容器啓動成功,也是我的錯誤。 – 2012-02-16 05:55:31