Skip to Content
author's profile photo Former Member
Former Member

Class Dev Not Found Error - commons apache fileupload

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 21, 2013 at 09:39 AM

    HI Sandeep.

    To Upload a Excel in WDj, try to use jxl jars acoording to ur system req's.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 21, 2013 at 11:30 AM

    Hi Sandeep,

    In the app DC, add dependencies "Deploy-Time" and "Run-Time" to your library DC.

    Regards,

    Roberto

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.