啟動jetty時報找不到spring webApplicationInitializer
2015-09-06 17:22:48.519:INFO:/:main: No Spring WebApplicationInitializer types detected on classpath
2015-09-06 17:22:48.570:INFO:/:main: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2015-09-06 17:22:48.712:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.m.p.JettyWebAppContext@73b634b1{/,file:/F:/Eclipseworkspace/spring-mvc-study/src/main/webapp/,STARTING}{file:/F:/Eclipseworkspace/spring-mvc-study/src/main/webapp/}
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
2017-11-21
public static void main(String[] args) {
? JFinal.start("src/main/webapp", 80, "/");// 啟動配置項
}
將這里的端口號與
pom.xml里面的port端口號一致就行
<plugin>
? <groupId>org.eclipse.jetty</groupId>
? <artifactId>jetty-maven-plugin</artifactId>
? <version>9.2.2.v20140723</version>
? <configuration>
? ? ?<httpConnector>
? ? ? ? <port>80</port><!-- 啟動端口號 -->
? ? ?</httpConnector>
? ? ?<stopPort>99</stopPort>
? ? ?<stopKey>stop</stopKey>
? ? ?<scanIntervalSeconds>10</scanIntervalSeconds>
? ? ?<webApp>
? ? ? ? <contextPath>/</contextPath>
? ? ?</webApp>
? ? ?<!-- 適應(yīng)測試階段的jetty,日志寫入目錄,tomcat寫入tomcat/logs下 -->
? ? ?<systemProperties>
? ? ? ? <systemProperty>
? ? ? ? ? ?<name>catalina.base</name>
? ? ? ? ? ?<value>.</value>
? ? ? ? </systemProperty>
? ? ?</systemProperties>
? </configuration>
</plugin>
我是用IDEA的jetty啟動的
2017-08-19
[INFO] Initializing Spring root WebApplicationContext
[INFO] started o.m.j.p.JettyWebAppContext{/,file:/E:/EclipseProject/Mybatis/web-parent/web-app/src/main/webapp/},file:/E:/EclipseProject/Mybatis/web-parent/web-app/src/main/webapp/
[INFO] Initializing Spring FrameworkServlet 'dispatcher'
[INFO] Started SelectChannelConnector@0.0.0.0:80
[INFO] Started Jetty Server
2015-12-27
估計你是不是亂改路勁了?