[ HELP!!! ] Ultra Simple Souce Code Running Problem
Hi, I'm a spring newbie.
I'm trying to run a very simple project in STS run on Server. http://localhost:8080/springbook/hellospring.jsp
There is no errors in Console when I run it, but I got the following message
================================================== =================
HTTP Status 404 - /springbook/hellospring.jsp
type Status report
message /springbook/hellospring.jsp
description The requested resource (/springbook/hellospring.jsp) is not available.
================================================== =================
I attached the zipped project file.
Could you please take a look and let me know what was wrong with it.
(Note: I removed all related .jar files in WEB-INF/lib since they are too big to be attached)
You have no JSP files in the WebContent directory. You only have them in the WEB-INF directory. A request to /springbook/hellospring.jsp will return a 404 because there's nothing at that url.
Thank you for letting me know.
After I put hellospring.jsp file in WebContent Directory, I got another errors when I click http://localhost:8080/springbook/hellospring.jsp as follows
I google it to fix this problem, but couldn't find.
Could you please let me know again what was wrong in this case?
Actually, when I 'run on server' in STS, HelloSpring.class file was not automatically created.
So I just manually compiled HelloSpring.java in the command line,
then I created directory manually in the command line under WebContent --> WEB-INF-->classes --> springbook --> temp
and then put HelloSpring.class under the WebContent --> WEB-INF-->classes --> springbook --> temp --> HelloSpring.class
------------------------------------------------------------------------------------------------------
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpres sionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/hellospring_jsp, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ExpressionFactory used in the signature
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:343)
javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
root cause
java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpres sionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/hellospring_jsp, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ExpressionFactory used in the signature
org.apache.jsp.hellospring_jsp._jspInit(hellosprin g_jsp.java:26)
org.apache.jasper.runtime.HttpJspBase.init(HttpJsp Base.java:49)
org.apache.jasper.servlet.JspServletWrapper.getSer vlet(JspServletWrapper.java:171)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:356)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.12 logs.
It looks like your source tree isn't added as a source tree in the project, or perhaps it doesn't know it's a web application.
It also sounds like you're including the "javax.el.*" package in your webapp. I believe that the container should be providing that. I think you should remove that jar from your webapp.