Skip to Content
0
Former Member
Jan 16, 2013 at 09:23 PM

Class Dev Not Found Error - commons apache fileupload

35 Views

Hello experts,

I have an application deployed on portal as a development component.

I am trying to upload an excel file to my Servlet but getting the below error:

application [K2W_E2E_D~e2e~sce2e~dc_bspend~pg.com] Processing HTTP request to servlet [UploadXLSServletTest] finished with error. The error is: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
at org.apache.commons.fileupload.servlet.ServletFileUpload.isMultipartContent(ServletFileUpload.java:68)
at com.pg.fdd.basespend.servlets.UploadXLSServletTest.doPost(UploadXLSServletTest.java:57)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1060)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)

I have checked that my servlet is getting executed. I am trying to check if request variable has any files by using below code. This is where the servlet is crashing.

if (!ServletFileUpload.isMultipartContent(request)) {

// if not, we stop here

return;

}

I have added the commons-fileupload-1.2.2.jar file to the project as a library project under Used DCs by following the instructions from below document.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60d99678-1a29-2d10-94b4-9d9a67b7199b?quicklink=index&overridelayout=true

The upload functionality works fine when deployed on portal as a local project but not when deployed as a Developement Component (DC).

Please provide any suggestions or fixes for the above issue.

Thanks,

Sandeep