core icon indicating copy to clipboard operation
core copied to clipboard

Missing dependencies for multipart fileupload via Spring (OSGI) in dotCMS 3.2

Open hmboonstra opened this issue 11 years ago • 3 comments

I'm trying to convert our OSGI plugin using Spring to dotCMS 3.2 (from 2.5.7). This plugin configures a Apache Commons FileUpload multipartResolver:

``xml <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />``

The CommonsMultipartResolver tries to access the (original) classes from Apache Commons FileUpload, but those are not available since they are re-packaged to com.dotcms.repackage.

hmboonstra avatar May 01 '15 11:05 hmboonstra

right so this is on purpose and not a bug. Either alter your imports or package the libraries you need. Starting with 3.0 all our libraries are repackaged

jtesser avatar May 01 '15 12:05 jtesser

But I can't alter the import, since it is in dependency (Spring Web) which is provided by dotCMS. And since the Spring is loaded from the WEB-INF the classloader doesn't find the classes (commons-fileupload) even if I package them in my OSGI bundle. Or am I missing something?

hmboonstra avatar May 01 '15 12:05 hmboonstra

You have to add those dependencies on your own. Maybe through a static plugin OR better yet bring in your own Spring libs to your OSGi plugin. See the example here https://github.com/dotCMS/core/tree/master-3.2/docs/examples/osgi/com.dotcms.custom.spring

jtesser avatar May 01 '15 12:05 jtesser