Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Uploading files  RSS feed

 
Shirley Ho
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Im having problem uploading files to the server. When i tested on my localhost it work well. But when i upload it to the server and test it, it doesnt work. The error I got was
Internal Servlet Error:
java.lang.NoClassDefFoundError: http/utils/multipartrequest/MultipartRequest
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:268)
at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289)
at org.apache.tomcat.core.Handler.service(Handler.java:254)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
what does this mean?
Please Help me
 
arun prasad
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
the error which you are getting is basically b'coz of classpath setting.
In the server the classpath is not set correctly.
Try after setting classpath properly
arun
 
Shirley Ho
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still having some problem
Uploaded Files java.io.IOException: Directory [http://www.enpgroup.com.sg/internal] is invalid. at http.utils.multipartrequest.MultipartRequest.(MultipartRequest.java) at http.utils.multipartrequest.ServletMultipartRequest.(ServletMultipartRequest.java) at uploadinternaladmin.doPost(uploadinternaladmin.java:26) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484)
what does this mean?
Please help
 
M.K.A. Monster
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try a local directory and not a URL.
 
DC Dalton
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to specify the file name (with correct path structure) using the servlet context! Like this:
javax.servlet.ServletContext sc = getServletContext();
MultipartRequest mp = new MultipartRequest(req, sc.getRealPath("/WEB-INF/classes/folder_name/"), 50000000);
 
RAJESH RASTOGI
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear,
u r getting the error for class 'MultiPartRequest' not found in http.utils.multipart package.
but for this class u need a different package com which consists all the files need to upload the files.
hope this will help u.
rajesh
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!