users@jersey.java.net

[Jersey] Re: Error while running the test

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Tue, 01 Nov 2011 11:15:40 +0100

Hi Rahul,

jersey-test-framework-grizzly artifact has no direct/indirect dependency
on the commons-beanutils module. I see from the stack trace you are
using some spring stuff and also some other external libraries.

Then especially the org.csmc.wscommon.util.jersey.JerseyParameterMapper
class
looks like bringing another indirect dependency layer. I guess its
containing module
might be including the other commons-beanutils dependency?

Anyways you might want to check what mvn dependency:tree says about all
the dependencies
and resolve any possible conflicts either by excluding unnecessary
transitive dependencies
or by fixing used artifact versions.

HTH,

~Jakub

On 1.11.2011 0:26, 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