What version of fileupload should I use?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

What version of fileupload should I use?

Joe Adams
Hi,

I'm trying to include commons-fileupload into my project which uses maven.  I seem to have a conflict.

I got the following exception:
java.lang.NoSuchMethodError: org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(Lorg/apache/commons/fileupload/RequestContext;)Ljava/util/List;

My maven has:

<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.1</version>
</dependency>

Which version of fileupload can I include with those versions of validator and codec?

Thanks,
Joe
Reply | Threaded
Open this post in threaded view
|

Re: What version of fileupload should I use?

Benedikt Ritter-4
Hi Joe,


2013/2/19 Joe Adams <[hidden email]>

> Hi,
>
> I'm trying to include commons-fileupload into my project which uses maven.
>  I seem to have a conflict.
>
> I got the following exception:
> java.lang.NoSuchMethodError:
> org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(Lorg/apache/commons/fileupload/RequestContext;)Ljava/util/List;
>
> My maven has:
>
> <dependency>
> <groupId>commons-validator</groupId>
> <artifactId>commons-validator</artifactId>
> <version>1.3.1</version>
> </dependency>
> <dependency>
> <groupId>commons-codec</groupId>
> <artifactId>commons-codec</artifactId>
> <version>1.3</version>
> </dependency>
> <dependency>
> <groupId>commons-fileupload</groupId>
> <artifactId>commons-fileupload</artifactId>
> <version>1.2.1</version>
> </dependency>
>
> Which version of fileupload can I include with those versions of validator
> and codec?
>

I can not tell from looking at the poms [1,2] what is causing the problems.
Have you tried the maven dependency plugin [3] to calculate dependencies?
It should tell you what dependencies are conflicting.

HTH,
Benedikt

[1]
http://search.maven.org/remotecontent?filepath=commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.pom
[2]
http://search.maven.org/remotecontent?filepath=commons-codec/commons-codec/1.3/commons-codec-1.3.pom
[3] http://maven.apache.org/plugins/maven-dependency-plugin/


>
> Thanks,
> Joe
>



--
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter
Reply | Threaded
Open this post in threaded view
|

RE: What version of fileupload should I use?

Joe Adams
After some experimentation I found that this worked:

                <dependency>
                        <groupId>commons-pool</groupId>
                        <artifactId>commons-pool</artifactId>
                        <version>1.6</version>
                </dependency>
                <dependency>
                        <groupId>commons-validator</groupId>
                        <artifactId>commons-validator</artifactId>
                        <version>1.3.1</version>
                </dependency>
                <dependency>
                        <groupId>commons-codec</groupId>
                        <artifactId>commons-codec</artifactId>
                        <version>1.3</version>
                </dependency>
                <dependency>
                        <groupId>commons-fileupload</groupId>
                        <artifactId>commons-fileupload</artifactId>
                        <version>1.1</version>
                </dependency>

Thanks,
Joe
________________________________________
From: Benedikt Ritter [[hidden email]]
Sent: Wednesday, February 20, 2013 1:53 AM
To: Commons Users List
Subject: Re: What version of fileupload should I use?

Hi Joe,


2013/2/19 Joe Adams <[hidden email]>

> Hi,
>
> I'm trying to include commons-fileupload into my project which uses maven.
>  I seem to have a conflict.
>
> I got the following exception:
> java.lang.NoSuchMethodError:
> org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(Lorg/apache/commons/fileupload/RequestContext;)Ljava/util/List;
>
> My maven has:
>
> <dependency>
> <groupId>commons-validator</groupId>
> <artifactId>commons-validator</artifactId>
> <version>1.3.1</version>
> </dependency>
> <dependency>
> <groupId>commons-codec</groupId>
> <artifactId>commons-codec</artifactId>
> <version>1.3</version>
> </dependency>
> <dependency>
> <groupId>commons-fileupload</groupId>
> <artifactId>commons-fileupload</artifactId>
> <version>1.2.1</version>
> </dependency>
>
> Which version of fileupload can I include with those versions of validator
> and codec?
>

I can not tell from looking at the poms [1,2] what is causing the problems.
Have you tried the maven dependency plugin [3] to calculate dependencies?
It should tell you what dependencies are conflicting.

HTH,
Benedikt

[1]
http://search.maven.org/remotecontent?filepath=commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.pom
[2]
http://search.maven.org/remotecontent?filepath=commons-codec/commons-codec/1.3/commons-codec-1.3.pom
[3] http://maven.apache.org/plugins/maven-dependency-plugin/


>
> Thanks,
> Joe
>



--
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]