users@jersey.java.net

Re: [Jersey] An issue seen when running tests on a WebApp using the Grizzly container

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Thu, 06 Nov 2008 13:06:34 -0500

Salut,

Srinivas Naresh Bhimisetty wrote:
> Hi,
>
> I was trying to build the test framework for Jersey, which would allow
> tests to be run on the container of choice among - Embedded Glassfish,
> Grizzly, HTTPServer, GF v2 and GF v3.
> In this regard, I attempted to add this flexibility to the Jersey
> HelloWorld-WebApp sample.
>
> Things worked fine with Embedded GF and HTTPServer, but when I run with
> Grizzly option, the following error is seen:

You might have another "old" Grizzly version installed? Because this
method is there for awhile:

https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/http/servlet/ServletAdapter.html#352

A+

-- Jeanfrancois


> ====================================================================================
>
> java.lang.NoSuchMethodError:
> com.sun.grizzly.http.servlet.ServletAdapter.setContextPath(Ljava/lang/String;)V
>
> at
> com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory.create(GrizzlyWebContainerFactory.java:242)
>
> at
> com.sun.jersey.qe.tests.helloworld.HelloWorldWebAppTest.startServerAndDeploy(HelloWorldWebAppTest.java:142)
>
> at
> com.sun.jersey.qe.tests.helloworld.HelloWorldWebAppTest.setUp(HelloWorldWebAppTest.java:113)
>
> at junit.framework.TestCase.runBare(TestCase.java:128)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:120)
> at junit.framework.TestSuite.runTest(TestSuite.java:230)
> at junit.framework.TestSuite.run(TestSuite.java:225)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140
>
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>
> at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>
> at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
>
> ==========================================================================================
>
>
> Any ideas, as to what might be causing this issue?
>
> Attached are the pom.xml and the source code.
>
> Thanks,
> Naresh
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net