Jetty启动webApp报错,是因为没有加全依赖


如下:

2016-07-06 10:24:47.748:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
2016-07-06 10:24:47.764:INFO::jetty-6.1.25
2016-07-06 10:24:47.826:INFO::NO JSP Support for /myWeb, did not find org.apache.jasper.servlet.JspServlet
log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).
log4j:WARN Please initialize the log4j system properly.
2016-07-06 10:24:48.216:WARN::EXCEPTION 
java.lang.ClassNotFoundException: org.eclipse.jetty.servlet.DefaultServlet
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:401)
	at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363)
	at org.mortbay.util.Loader.loadClass(Loader.java:91)
	at org.mortbay.util.Loader.loadClass(Loader.java:71)
	at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
	at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
	at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
	at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1272)
	at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
	at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:489)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
	at org.mortbay.jetty.Server.doStart(Server.java:224)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at com.heroinex.install.install.main(install.java:31)
2016-07-06 10:24:48.216:INFO:/myWeb:Unavailable javax.servlet.UnavailableException: org.eclipse.jetty.servlet.DefaultServlet
2016-07-06 10:24:48.216:WARN::failed default: java.lang.NullPointerException
2016-07-06 10:24:48.216:WARN::Failed startup of context org.mortbay.jetty.webapp.WebAppContext@36f0f1be{/myWeb,webapps/myWeb}
java.lang.NullPointerException
	at java.lang.Class.isAssignableFrom(Native Method)
	at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
	at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
	at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1272)
	at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
	at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:489)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
	at org.mortbay.jetty.Server.doStart(Server.java:224)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at com.heroinex.install.install.main(install.java:31)
2016-07-06 10:24:48.263:INFO::Started [email protected]:17000

加上依赖就行了:



			org.eclipse.jetty
			jetty-server
			7.2.2.v20101205
		
		
			org.eclipse.jetty
			jetty-webapp
			7.2.2.v20101205
		

		
			org.eclipse.jetty
			jetty-jsp-2.1
			7.2.2.v20101205
		
		
			org.mortbay.jetty
			jsp-2.1-glassfish
			2.1.v20100127
		


你可能感兴趣的:(编程)