Could not instantiate bean class [multipart.MultipartFile] : Specified class is an interface at org.springframework.beans.BeanUtils.instantiateClass
<p>I want to upload a file on my local website, I use Spring and Hibernate (I do not use Maven).</p>

<p>I have done a form :</p>

<pre><code>&lt;form class="text-center" action="&lt;c:url value="/createRessource.do"/&gt;" enctype="multipart/form-data" method="POST"&gt;
    &lt;h4 class="bleucolor"&gt;Titre de la ressource (20 caractères maximum) : &lt;/h4&gt;
    &lt;input class="col-lg-4 text-center col-lg-offset-4" type="text" name="titre" maxlength="20"/&gt; &lt;br&gt; &lt;br&gt; &lt;br&gt;
    &lt;h4 class="bleucolor"&gt;Description de la ressource (1024 caractères maximum) : &lt;/h4&gt;
    &lt;textarea name="description" rows=10 cols=50 maxlength="1024" &gt;&lt;/textarea&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
    &lt;h4 class="bleucolor"&gt; Pièce jointe :&lt;/h4&gt;
    &lt;input class="col-lg-4 text-center col-lg-offset-4" type="file" name="file" /&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
    &lt;h4 class="bleucolor"&gt; Tags de la ressource : &lt;/h4&gt;
    &lt;c:forEach var="model" items="${sessionScope.tags}"&gt;
        &lt;input type="checkbox" name="tagsRessource" value="${model.getIdtag()}" id="${model.getIdtag()}"/&gt;
        &lt;label class="font18" for="${model.getIdtag()}"&gt;&amp;thinsp;${model.getLibelle()}&amp;thinsp;&lt;/label&gt;
    &lt;/c:forEach&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
    &lt;input class="text-center avioletbackground rosebtn btn btn-success btn-lg" type="submit"/&gt;
&lt;/form&gt;
</code></pre>

<p>I have some input, a title, a description, a file and tags.</p>

<p>I have add </p>

<pre><code>&lt;!-- Configure the multipart resolver --&gt;
    &lt;bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"&gt;
    &lt;!-- one of the properties available; the maximum file size in bytes --&gt;
    &lt;property name="maxUploadSize" value="5000000"/&gt;
&lt;/bean&gt;
</code></pre>

<p>in my dispatcher-servlet.xml.</p>

<p>My controller is probably not perfect, because when I start, I only do Controller, DAO and Model, I have forgot all services, but my function "createRessource" is like :</p>

<pre><code>public ModelAndView createRessource(HttpServletRequest request, HttpServletResponse response, @RequestParam(value="file", required=true) MultipartFile file){
    ApplicationContext ctx = new GenericXmlApplicationContext("applicationContext.xml");
    String resultat = null;
    RessourceHome bean = (RessourceHome) ctx.getBean("RessourceHome");
    String titre = request.getParameter("titre");
    String description = request.getParameter("description");
    String fichierUpload = request.getParameter("file");
    String[] tagsRessource = request.getParameterValues("tagsRessource");
    String fichierName = file.getName();
    String fichierType = file.getContentType();

    try {
        byte[] bytes = fichierUpload.getBytes();
        BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(new File("fichier")));
        stream.write(bytes);
        stream.close();            
        resultat = bean.ajouterRessource(titre, description, bytes, tagsRessource, fichierName, fichierType);
    } catch (Exception e) {
        return new ModelAndView("creationRessource");
    }
    if (resultat == null) {
        String erreur = "Création de l'annonce réussie";            
        return new ModelAndView("creationRessource", "erreur", erreur);
    } else {        
        return new ModelAndView("creationRessource", "erreur", resultat);
    }       
}
</code></pre>

<p>My function "ajouterRessource" add the ressource to the database.
At the beginning, I don't know that the type MyltipartFile exists in Java. It works but I can't find the name and the content type of the file I'm uploading and save it in database. </p>

<p>Now, when I submit my form, I have an error :</p>

<pre><code>janv. 06, 2016 7:08:41 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [dispatchers] in context with path [/jobEISTI] threw exception [Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]: Specified class is an interface] with root cause
org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]: Specified class is an interface
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:101)
    at org.springframework.web.servlet.mvc.multiaction.MultiActionController.newCommandObject(MultiActionController.java:520)
    at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:466)
    at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:408)
    at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
    at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:874)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:790)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)
</code></pre>

<p>I don't have "jsp-api-*.jar" in my /WEB-INF/lib.
I think it comes from the MultipartFile but I don't know what I'm supposed to do. Please, could you help me ?</p>

<p>Thanks you a lot</p>