Maven項目使用Jetty啟動之后發生如下錯誤:


日期: 2016-7-19


錯誤內容描述:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Spring_Struts_HibernateWebProject 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Spring_Struts_HibernateWebProject ---
[INFO] Deleting E:\Java Work\Java Source\Spring_Struts_HibernateWebProject\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Spring_Struts_HibernateWebProject ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Spring_Struts_HibernateWebProject ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Spring_Struts_HibernateWebProject ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ Spring_Struts_HibernateWebProject ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ Spring_Struts_HibernateWebProject ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ Spring_Struts_HibernateWebProject ---
[INFO] Building jar: E:\Java Work\Java Source\Spring_Struts_HibernateWebProject\target\webDemo.jar
[INFO]
[INFO] >>> jetty-maven-plugin:9.2.7.v20150116:run (default) > test-compile @ Spring_Struts_HibernateWebProject >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Spring_Struts_HibernateWebProject ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Spring_Struts_HibernateWebProject ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Spring_Struts_HibernateWebProject ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ Spring_Struts_HibernateWebProject ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< jetty-maven-plugin:9.2.7.v20150116:run (default) < test-compile @ Spring_Struts_HibernateWebProject <<<
[INFO]
[INFO] --- jetty-maven-plugin:9.2.7.v20150116:run (default) @ Spring_Struts_HibernateWebProject ---
[INFO] Logging initialized @8318ms
[INFO] Configuring Jetty for project: Spring_Struts_HibernateWebProject
[INFO] webAppSourceDirectory not set. Trying src\main\webapp
[INFO] webAppSourceDirectory E:\Java Work\Java Source\Spring_Struts_HibernateWebProject\src\main\webapp does not exist. Trying E:\Java Work\Java Source\Spring_Struts_HibernateWebProject\target\webapp-tmp
[INFO] Reload Mechanic: automatic
[INFO] Classes = E:\Java Work\Java Source\Spring_Struts_HibernateWebProject\target\classes
[INFO] Context path = /
[INFO] Tmp directory = E:\Java Work\Java Source\Spring_Struts_HibernateWebProject\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides = none
[INFO] web.xml file = null
[INFO] Webapp directory = E:\Java Work\Java Source\Spring_Struts_HibernateWebProject\target\webapp-tmp
[INFO] jetty-9.2.7.v20150116
[INFO] Started o.e.j.m.p.JettyWebAppContext@29528a22{/,file:/E:/Java%20Work/Java%20Source/Spring_Struts_HibernateWebProject/target/webapp-tmp/,AVAILABLE}{file:/E:/Java%20Work/Java%20Source/Spring_Struts_HibernateWebProject/target/webapp-tmp/}
[WARNING] !RequestLog
[INFO] Started ServerConnector@249e0271{HTTP/1.1}{0.0.0.0:8080}
[INFO] Started @10162ms
[INFO] Started Jetty Server


1、翻牆之后有一個類似的問題有解決: http://stackoverflow.com/questions/12271187/how-to-override-web-xml-in-jetty-maven-plugin-when-filtering


2、https://vaadin.com/forum/#!/thread/9122376/9122375;


這個問題暫時沒有解決。


之后換了tomcat之后問題得以解決,我想是不是由於我本機沒有安裝jetty的緣故。雖然在執行"mvn jetty:run"之后提示started jetty Server。但是在瀏覽器輸入

http://localhost:8080/Spring_Struts_HibernateProject之后提交沒有反應。











注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2021 ITdaan.com