HTTP Status 500 exception error

Upload core product.
Post Reply
ron91351
Posts: 10
Joined: Sat Mar 22, 2008 7:10 am

HTTP Status 500 exception error

Post by ron91351 »

I get a Apache/Tomcat 5.0.27 - Error report when using:

http://www.jig4u.com/jspupload/process.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: /jspupload/process.jsp(12,0) The value for the useBean class attribute jfileupload.jspupload.FileUploadBean is invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:150)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1225)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Generator.generate(Generator.java:3269)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
sun.reflect.GeneratedMethodAccessor218.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:239)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:266)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:157)

Thanks in advance for the help,
RJ

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: HTTP Status 500 exception error

Post by support »

This error means that JSPUpload is not deployed correctly. process.jsp is not able to find out .class files under WEB-INF/classes. Did you copy these classes ?

ron91351
Posts: 10
Joined: Sat Mar 22, 2008 7:10 am

Re: HTTP Status 500 exception error

Post by ron91351 »

Thanks for the quick reply. I must have missed something. I have added lib/ directory in same directory as HTML files. I copied all jar files to lib/ directory. I have not added any files to the WEB-INF directory. What files do I need to add to the WEB-INF/classes and WEB-INF/lib directories ?

Thanks in advance,
RJ

ron91351
Posts: 10
Joined: Sat Mar 22, 2008 7:10 am

Re: HTTP Status 500 exception error

Post by ron91351 »

I have copied the jar files to WEB-INF/lib. I am not sure what to copy to WEB-INF/classes directory.

When I try: http://www.jig4u.com/jspupload/process.jsp

I no longer get the HTTP 500 status error. I now get a different error.

org.apache.jasper.JasperException

Check FileUploadBean properties in your JSP.
For folder store check: <jsp:setProperty name="upBean" property="folderstore" value="c:/uploads" />

The code in process.jsp doesn't point to c:/uploads ???

Here is the code in process.jsp:

<% String directory = "/home/content/r/o/n/ron91351/html/uploads/"; %>
<% String tmpdirectory = "/home/content/r/o/n/ron91351/html/uploads/tmp/"; %>
<% boolean createsubfolders = true; %>
<% boolean allowresume = true; %>
<% boolean allowoverwrite = true; %>
<% String encoding = "ISO-8859-1"; %>
<% boolean keepalive = false; %>

<jsp:useBean id="upBean" scope="page" class="jfileupload.jspupload.FileUploadBean">
<jsp:setProperty name="upBean" property="folderstore" value="<%= directory %>" />
<jsp:setProperty name="upBean" property="parsertmpdir" value="<%= tmpdirectory %>" />
<jsp:setProperty name="upBean" property="filesizelimit" value="8589934592" />
<jsp:setProperty name="upBean" property="overwrite" value="<%= allowoverwrite %>" />
<jsp:setProperty name="upBean" property="dump" value="true" />
</jsp:useBean>

Thanks for the help,
RJ

Here is the HTML for the page with the error:

<html>
<head>
<title>Exceptional Even Occurred!</title>
</head>
<body>

<font size="-1" face="Verdana, Arial, Helvetica, sans-serif" color="red">
<b>org.apache.jasper.JasperException</b><br/>
</font>
<br/>Check FileUploadBean properties in your JSP.<br/> For folder store check:
<jsp:setProperty name="upBean" property="folderstore" value="c:/uploads" /><br/>

<!--
org.apache.jasper.JasperException
at org.apache.jasper.runtime.JspRuntimeLibrary.handleSetProperty(JspRuntimeLibrary.java:665)
at org.apache.jsp.jspupload.process_jsp._jspService(process_jsp.java:78)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at sun.reflect.GeneratedMethodAccessor218.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:239)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:266)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:157)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:140)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:417)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)
-->

</body>
</html>

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: HTTP Status 500 exception error

Post by support »

Oh, great, you solved the JARs issue. My mistake, the files required are JARs under WEB-INF/lib folder. WEB-INF/classes is empty.

Now, the error you get is a servlet engine cache issue. Your JSP is compiled with the old configuration (c:/uploads). Make sure the directory and tmpdirectory paths are correct and RESTART the servlet engine. It should work.

ron91351
Posts: 10
Joined: Sat Mar 22, 2008 7:10 am

Re: HTTP Status 500 exception error

Post by ron91351 »

I don't understand your statement:

Now, the error you get is a servlet engine cache issue. Your JSP is compiled with the old configuration (c:/uploads). Make sure the directory and tmpdirectory paths are correct and RESTART the servlet engine. It should work.

What I have discovered is that there is an error which is causing ExceptionHandler.jsp to be invoked. The exceptionHandler displays:

if (exception.toString().indexOf("JasperException") > 0)
{
out.println("<br/>Check FileUploadBean properties in your JSP.<br/> For folder store check: ");
out.println(" <jsp:setProperty name=\"upBean\" property=\"folderstore\" value=\"c:/uploads\" /><br/>");
}

But, I don't know what is causing the exceptionHandler to be invoked. Can you tell from the previous dump ???

Thanks,
RJ

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: HTTP Status 500 exception error

Post by support »

Ok, the problem could come from one of the following:
1 - You've tested the process.jsp without modifying the directory variable and the compiled JSP includes the original path c:/uploads. As this folder doesn't make sense under your server you have the exception you've reported. The solution is to stop the servlet engine (Tomcat), modify the JSP with the correct folder (if needed) and restart the servlet engine. Once done, the up to date JSP will be used.

2 - The directories you've setup are not readable/writable.
<% String directory = "/home/content/r/o/n/ron91351/html/uploads/"; %>
<% String tmpdirectory = "/home/content/r/o/n/ron91351/html/uploads/tmp/"; %>
First, try the remove the ending "/"
<% String directory = "/home/content/r/o/n/ron91351/html/uploads"; %>
<% String tmpdirectory = "/home/content/r/o/n/ron91351/html/uploads/tmp"; %>
and make sure they have read/write permission for the process that runs the servlet engine.
Try chmod 777 if you don't know.

Does it help ?

If not then if you could provide access to your server (FTP or SSH) then I will have a look.
You can send info to support(at)jfileupload(dot)com.

Post Reply