Tomcat部署错误
我创建了一个简单的 jsp 应用程序,它在我的所有三个 jsp 文件中具有以下结构,
simple
WEB-INF
demo.jsp
demo1.jsp
classes
web.xml
index.jsp
我使用表达式标记来回显字符串,以便我可以证明我的应用程序可以通过正确的映射正常工作。
在我的 web.xml 中,我编写了
<web-app>
<servlet>
<servlet-name>demo1</servlet-name>
<jsp-file>demo1.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>demo1</servlet-name>
<url-pattern>/demo1</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>demo</servlet-name>
<jsp-file>demo.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>demo</servlet-name>
<url-pattern>/demo</url-pattern>
</servlet-mapping>
</web-app>
使用以下命令创建战争的内容
C:\simple> jar -cf simple.war *.*
,但是当我在 tomcat 7 中部署此战争文件并启动应用程序时,我收到以下错误
FAIL - Application at context path /simple could not be started
FAIL - Encountered exception org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/simple]]
您能描述一下上述问题吗?为什么我会收到此错误?我的代码或结构有问题吗?
I created a simple jsp application which has the following structure
simple
WEB-INF
demo.jsp
demo1.jsp
classes
web.xml
index.jsp
in my all three jsp file i have used expression tag to echo a string so that i can justify that my app is working fine with proper mapping.
in my web.xml i have written
<web-app>
<servlet>
<servlet-name>demo1</servlet-name>
<jsp-file>demo1.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>demo1</servlet-name>
<url-pattern>/demo1</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>demo</servlet-name>
<jsp-file>demo.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>demo</servlet-name>
<url-pattern>/demo</url-pattern>
</servlet-mapping>
</web-app>
i create the war using the following command
C:\simple> jar -cf simple.war *.*
but when i deployed this war file in tomcat 7 and start the app i got the following error
FAIL - Application at context path /simple could not be started
FAIL - Encountered exception org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/simple]]
Can you please describe the above problem? Why am i getting this error? Is there something wrong with my code or structure?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 demo.jsp、demo1.jsp 放置在 WEB-INF 文件夹之外,即放置在文件夹 /simple 中。
Place your demo.jsp, demo1.jsp out of WEB-INF folder, i.e place it in folder /simple.