Hello Rahul,
are you sure that this is your only dependency on commons-beanutils?
Jersey test framework don't depend on this, see dependency:tree below
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @
jersey-test-framework-grizzly ---
[INFO]
com.sun.jersey.jersey-test-framework:jersey-test-framework-grizzly:jar:1.9.1
[INFO] +- com.sun.grizzly:grizzly-servlet-webserver:jar:1.9.35:compile
[INFO] | +- com.sun.grizzly:grizzly-http:jar:1.9.35:compile
[INFO] | | +- com.sun.grizzly:grizzly-framework:jar:1.9.35:compile
[INFO] | | +- com.sun.grizzly:grizzly-rcm:jar:1.9.35:compile
[INFO] | | +- com.sun.grizzly:grizzly-portunif:jar:1.9.35:compile
[INFO] | | \- com.sun.grizzly:grizzly-utils:jar:1.9.35:compile
[INFO] | | \- com.sun.grizzly:grizzly-lzma:jar:1.9.35:compile
[INFO] | +- com.sun.grizzly:grizzly-http-servlet:jar:1.9.35:compile
[INFO] | \- javax.servlet:servlet-api:jar:2.5:compile
[INFO] +-
com.sun.jersey.jersey-test-framework:jersey-test-framework-core:jar:1.9.1:compile
[INFO] | +- javax.servlet:javax.servlet-api:jar:3.0.1:compile
[INFO] | +- junit:junit:jar:4.8.2:compile
[INFO] | +- com.sun.jersey:jersey-server:jar:1.9.1:compile
[INFO] | | +- asm:asm:jar:3.1:compile
[INFO] | | \- com.sun.jersey:jersey-core:jar:1.9.1:compile
[INFO] | \- com.sun.jersey:jersey-client:jar:1.9.1:compile
[INFO] \- com.sun.jersey:jersey-grizzly:jar:1.9.1:compile
you should be able to run "mvn dependency:tree" on your project also to
get info about possible dependency conflict.
Regards,
Pavel
On 11/1/11 12:26 AM, Rahul Babbar wrote:
> Hi,
>
> I was trying to run the REST tests through the Jersey test framework
> and starting getting the following error.
>
> "Caused by: java.lang.NoSuchMethodError:
> org.apache.commons.beanutils.converters.StringConverter.<init>(Ljava/lang/Object;)V
> at
> org.apache.commons.beanutils.ConvertUtilsBean.registerStandard(ConvertUtilsBean.java:681)
> at
> org.apache.commons.beanutils.ConvertUtilsBean.deregister(ConvertUtilsBean.java:579)
> at
> org.apache.commons.beanutils.ConvertUtilsBean.<init>(ConvertUtilsBean.java:164)
> at
> org.csmc.wscommon.util.jersey.JerseyParameterMapper.<init>(JerseyParameterMapper.java:40)
> at org.csmc.cdr.client.impl.CdrClientImpl.<init>(CdrClientImpl.java:72)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> at
> org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
> ... 55 more
> "
>
> Here is the jersey test framework dependency in pom.xml
>
> <dependency>
> <groupId>com.sun.jersey.jersey-test-framework</groupId>
> <artifactId>jersey-test-framework-grizzly</artifactId>
> <version>1.9.1</version>
> <scope>test</scope>
> </dependency>
>
>
> A bit of google serach showed that the problem is coming because of
> multiple versions of commons-beanutils jar, and apparently the
> previous version of BeanUtils is being used, which does not have this
> method.
> I have the following in pom.
>
> <dependency>
> <groupId>commons-beanutils</groupId>
> <artifactId>commons-beanutils</artifactId>
> <version>1.8.3</version>
> </dependency>
>
> Not sure what is the problem or whether the issue is related to
> jersey, but i thought may be Jersey Test framework uses the old
> version of BeanUtils. The problem only comes with the Jersey Tests and
> otherwise the application runs fine.
>
> Can someone please see what the problem could be.
>
> Thank you
>
> Rahul
>
>
>
> Rahul