Jetty7启动的一些问题: 下载了各distribution后, 把自己的war拷贝到webapp下,然后 运行java -jar start.jar -OPTIONS=Server,default etc/jetty.xml 提示有错误: 无法初始化com.acme.SessionDump 在官网上找了说这个类是假设session中所有的值类型是string类型, 于是把jetty默认提供的contexts\test.d\override-web.xml中的给删掉就可以运行。
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<!-- This web.xml format file is an override file that is applied to the test webapp AFTER
it has been configured by the default descriptor and the WEB-INF/web.xml descriptor -->
<!-- Add or override context init parameter -->
<context-param>
<param-name>context-override-example</param-name>
<param-value>a context value</param-value>
</context-param>
<!-- Add or override servlet init parameter -->
<servlet>
<servlet-name>Dump</servlet-name>
<init-param>
<param-name>servlet-override-example</param-name>
<param-value>a servlet value</param-value>
</init-param>
</servlet>
<!-- Add servlet mapping -->
<servlet-mapping>
<servlet-name>Dump</servlet-name>
<url-pattern>*.more</url-pattern>
</servlet-mapping>
<!-- Reset servlet class and/or start order -->
<!--servlet>
<servlet-name>Session</servlet-name>
<servlet-class>com.acme.SessionDump</servlet-class>
<load-on-startup>5</load-on-startup>
</servlet-->
</web-app>