Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Other Application Frameworks and the fly likes test.jsp error HTTP 500 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "test.jsp error HTTP 500" Watch "test.jsp error HTTP 500" New topic
Author

test.jsp error HTTP 500

monika se
Greenhorn

Joined: Mar 23, 2011
Posts: 22
Hi,
I am using IntelliJIDEA IDE, Tomcat 6.0. i m getting the error HTTP 500 in test.jsp

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.NullPointerException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:536)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)

root cause

java.lang.NullPointerException
org.apache.jsp.test_jsp._jspInit(test_jsp.java:22)
org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:164)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.
Apache Tomcat/6.0.32


I am struggling with this since yesterday, Please help me and tell me possible ways to resolve this issues(Tell me what could be possible root cause ) Please tell me in brief , I am new to servlets, JSP web applications etc.
My code for hello.jsp etc can b found in site::
http://www.opensymphony.com/webwork/wikidocs/Lesson%201%20-%20Setting%20up%20webwork%20in%20a%20web%20application.html

I have not included taglib in web.xml as it was giving "symbol cannot resolve " error. I included <%@ taglib prefix="ww" uri="webwork" %> in my jsp file. still could not resolve it.. Please Help.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60776
    
  65

Do you have Java code in your JSP? If so, step 1 is to move it to a servlet controller or bean.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
monika se
Greenhorn

Joined: Mar 23, 2011
Posts: 22
Hi,

Only 2 problems are now is that "unexpected end of file" near HTML closing tag and "Cannot resolve helloWorld.action".
I doubt is my file corrupt??

my name.jsp file is ::

<%@ taglib prefix="ww" uri="/webwork" %>
<html>
<head>
<title>Enter your name</title>
</head>
<body>
<ww:if test="message != null">
<%--<ww:fontColors="red">--%>
<wwroperty value="message"/>
<%--</ww:fontColors>--%>
</ww:if>
Please enter your name:
<form action="helloWorld.action">
<input type="text" name="name" value="<wwroperty value= 'name'>" >
</form>

</body>
</html>


on compiling ti give error as below to browser. Please Help me....

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:161)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)

root cause

org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:630)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:149)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)

root cause

java.lang.ClassNotFoundException: org.apache.jsp.hello_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:202)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:628)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:149)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)
DaslanJ Govender
Greenhorn

Joined: Jul 25, 2007
Posts: 6
for "unexpected end of file"

remove

<%--<ww:fontColors="red">--%>
<wwroperty value="message"/>
<%--</ww:fontColors>--%>

if that does not work then it may also have a problem with

value="<wwroperty value= 'name'>"


Fix that.

For Cannot resolve helloWorld.action" what is helloWorld.action ?
monika se
Greenhorn

Joined: Mar 23, 2011
Posts: 22
yes you are right, problem with the <input type="text" name="name" value="<ww:property value = 'name'>" > only.
My form action code is :


<form action= "/helloWorld.action">
<label>
<input type="text" name="name" value="<ww:property value = 'name'>" >
</label>
</form>


can you tell me ways to write this particular input line. ww is prefix for webwork here.

Moreover,
My helloWorld action file is mapped to HelloWorld.class in configraion file xwork.xml as shown below.

<xwork>
<include file="webwork-default.xml"/>
<package name="default" namespace="/" extends="webwork-default">
<default-interceptor-ref name="completeStack"/>

<action name="helloWorld" class="sample1.HelloWorld">
<result name="success" type="dispatcher">hello.jsp</result>
<result name="input" type="dispatcher">name.jsp</result>
</action>

</package>
</xwork>


Please Help me in this.
DaslanJ Govender
Greenhorn

Joined: Jul 25, 2007
Posts: 6
Which bean is name in?

P Lease put a copy of xwork.xml
DaslanJ Govender
Greenhorn

Joined: Jul 25, 2007
Posts: 6
sorry try /helloWorld instead of /helloWorld.action
monika se
Greenhorn

Joined: Mar 23, 2011
Posts: 22
xwork.xml

<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-1.0.dtd">
<xwork>
<include file="webwork-default.xml"/>
<package name="default" extends="webwork-default">
<default-interceptor-ref name="completeStack"/>

<action name="helloWorld" class="sample1.HelloWorld">
<result name="success" type="dispatcher">hello.jsp</result>
<result name="input" type="dispatcher">name.jsp</result>
</action>

</package>
</xwork>


My reference for this is:
http://media.techtarget.com/tss/static/articles/content/WebWorkinAction/WebWorkinAction.pdf


DaslanJ Govender
Greenhorn

Joined: Jul 25, 2007
Posts: 6
Which bean is "name" in?
Did you try /helloWorld instead of /helloWorld.action
monika se
Greenhorn

Joined: Mar 23, 2011
Posts: 22
Please help me, I am getting after compilation :
package com.symphony.xwork does not exist. Action class does not exist. cannot find symbol variable SUCCESS.

I know it is not able to recognize xwork.jar file. But i already kept it in my my_project/lib as well as in my WEB-INF/lib file.

I took this example from WEBWORK IN ACTION 1st example.
After running jsp page it shows ::

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /hello.jsp at line 17

14: </head>
15: <body>
16: WebWork says:
17: <h1><ww:property value="message"/></h1>
18: </body>
19: </html>
20:


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:519)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:410)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)

root cause

javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class com.opensymphony.xwork.util.OgnlValueStack
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:865)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
org.apache.jsp.hello_jsp._jspService(hello_jsp.java:79)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)

root cause

java.lang.NoClassDefFoundError: Could not initialize class com.opensymphony.xwork.util.OgnlValueStack
com.opensymphony.webwork.views.jsp.TagUtils.getStack(TagUtils.java:36)
com.opensymphony.webwork.views.jsp.WebWorkTagSupport.getStack(WebWorkTagSupport.java:46)
com.opensymphony.webwork.views.jsp.PropertyTag.doStartTag(PropertyTag.java:55)
org.apache.jsp.hello_jsp._jspx_meth_ww_005fproperty_005f0(hello_jsp.java:96)
org.apache.jsp.hello_jsp._jspService(hello_jsp.java:68)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.
Apache Tomcat/6.0.32
Kosh Koshy
Greenhorn

Joined: Mar 28, 2011
Posts: 1
Hello,

Try
<input type="text" name="name" value="&lt;ww:property value = 'name'&gt;" >
instead of
<input type="text" name="name" value="<ww:property value = 'name'>" >



Regards,
.
monika se
Greenhorn

Joined: Mar 23, 2011
Posts: 22
Now i am getting error exceptions as

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: Servlet execution threw an exception
root cause

java.lang.NoSuchMethodError: com.opensymphony.xwork.ObjectFactory.buildBean(Ljava/lang/String;Ljava/util/Map;)Ljava/lang/Object;
com.opensymphony.webwork.dispatcher.mapper.ActionMapperFactory.getMapper(ActionMapperFactory.java:37)
com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:101)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.



i saw xwork.jar files with two versions, so removed one of it so to avoid collision(as seen on google-help)

then i got error as:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /hello.jsp at line 16

13: </head>
14: <body>
15: WebWork says:
16: <h1><ww:property value="message"/></h1>
17: </body>
18: </html>
19:


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:519)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:410)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class com.opensymphony.xwork.util.OgnlValueStack
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:865)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
org.apache.jsp.hello_jsp._jspService(hello_jsp.java:78)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

java.lang.NoClassDefFoundError: Could not initialize class com.opensymphony.xwork.util.OgnlValueStack
com.opensymphony.webwork.views.jsp.TagUtils.getStack(TagUtils.java:39)
com.opensymphony.webwork.views.jsp.WebWorkBodyTagSupport.getStack(WebWorkBodyTagSupport.java:40)
com.opensymphony.webwork.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:32)
org.apache.jsp.hello_jsp._jspx_meth_ww_005fproperty_005f0(hello_jsp.java:95)
org.apache.jsp.hello_jsp._jspService(hello_jsp.java:67)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.

Apache Tomcat/6.0.32

can anyone tell me ways to solve it??
 
 
subject: test.jsp error HTTP 500
 
Similar Threads
Connecting to Oracle using Struts 2
org.apache.jasper.JasperException: java.lang.NullPointerException: Module 'null' not found.
Unable to load tag handler class "com.opensymphony.webwork.views.jsp.PropertyTag
how to apply theme as ajax to the jsp form with struts2-core-2.1.6.jar used struts 2 application ?
SQL Exception :general error