maven - java.lang.NoClassDefFoundError:org/apache/commons/fileupload/FileItemFactoryin Spring MVC -


i trying build simple spring mvc web app functionality of file uploading.i got following error:

java.lang.noclassdeffounderror: org/apache/commons/fileupload/fileitemfactory

after quick search,all answers pointed missing of dependencies,but seems not true in case:

i have included following code in pom.xml:

<dependencies> <dependency> <groupid>commons-fileupload</groupid> <artifactid>commons-fileupload</artifactid> <version>1.3.1</version> </dependency> <dependency> <groupid>commons-io</groupid> <artifactid>commons-io</artifactid> <version>2.4</version> </dependency> </dependencies> commons.io-2.4.jar , commons.fileupload-1.3.1.jar added lib folder.

one interesting thing found whenever deleted code:

   <bean id="multipartresolver"       class="org.springframework.web.multipart.commons.commonsmultipartresolver">     <property name="maxuploadsize">         <value>10000000</value>     </property>     <property name="maxinmemorysize">         <value>10000000</value>     </property>   </bean> 

the web app works fine(of course removed form file uploading well. )

if visit maven central repository , enter search term:

fc:org.apache.commons.fileupload.fileitemfactory 

then every released artifact available containing class listed.

you find commons-upload 1.3.1 in list.

therefore need double check deployment ensure jar present.

tip: use fc: locate jars in maven central contain specific class.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -