Velocity 怎么搭建环境呢,今天搭了一个时没搭出来,请求帮助?

发布于 2021-11-06 01:08:08 字数 16 浏览 837 评论 12

各位好心人,帮帮忙啊!!!谢谢!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

岁吢 2021-11-09 00:13:22

按照自带的例子copy过来,试试。

2021-11-09 00:12:49

这不是项目名称……是sevelet-name,配置文件上下不一致会出问题的

月牙弯弯 2021-11-09 00:10:42

项目名称而已,没太大的关系!!!谢谢!

旧城烟雨 2021-11-09 00:09:32

严重: Servlet /valocity threw load() exception

拼写错了,你改正确试试  veloctiy

女中豪杰 2021-11-09 00:00:13

我不信

爱你是孤单的心事 2021-11-08 23:48:03

亮了!

多情癖 2021-11-08 22:51:24

什么亮了??

背叛残局 2021-11-08 22:37:48

所有的JAR包都放进去了!

<load-on-startup>1</load-on-startup> 不要这个启动就不报错,但访问报错!

平生欢 2021-11-08 21:01:51


疑心病 2021-11-08 20:11:49
2011-11-14 22:24:24 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:Javajdk1.6bin;E:tomcat-6.0.33bin
2011-11-14 22:24:24 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2011-11-14 22:24:24 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 405 ms
2011-11-14 22:24:24 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2011-11-14 22:24:24 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.33
2011-11-14 22:24:24 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor host-manager.xml
2011-11-14 22:24:25 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor manager.xml
2011-11-14 22:24:25 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory docs
2011-11-14 22:24:25 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory examples
2011-11-14 22:24:25 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2011-11-14 22:24:25 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2011-11-14 22:24:25 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT
2011-11-14 22:24:25 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory valocity
2011-11-14 22:24:25 org.apache.catalina.core.ApplicationContext log
信息: Marking servlet velocity as unavailable
2011-11-14 22:24:25 org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet /valocity threw load() exception
java.lang.InstantiationException
	at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at java.lang.Class.newInstance0(Class.java:355)
	at java.lang.Class.newInstance(Class.java:308)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1116)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2011-11-14 22:24:25 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2011-11-14 22:24:25 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2011-11-14 22:24:25 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/32  config=null
2011-11-14 22:24:25 org.apache.catalina.startup.Catalina start
信息: Server startup in 654 ms

终遇你 2021-11-08 18:30:46

这样配置一启动就报这个错啊!

 

at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)

爱的故事 2021-11-08 17:26:20

velocity 只是一个 jar 包,引入 jar 包后,在 web.xml 中配置如下即可

<servlet>
	<servlet-name>velocity</servlet-name>
	<servlet-class>org.apache.velocity.servlet.VelocityServlet</servlet-class>
	<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
	<servlet-name>velocity</servlet-name>
	<url-pattern>*.vm</url-pattern>
</servlet-mapping>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文