Thanks Pavel, but I really can't get it to work no matter what I try. I will
disable the testing and come back to it sometime in the future (yeah right).
However now everything compiles, I have got another problem when running it
as war in Tomcat:
INFO: Provider classes found:
class com.brunata.webmon.ws.resources.ParserExceptionMapper
class com.brunata.webmon.ws.resources.InvalidCredentialsExceptionMapper
Feb 21, 2011 3:29:52 PM
com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.5 01/14/2011 12:36
PM'
Feb 21, 2011 3:29:52 PM com.sun.jersey.spi.inject.Errors
processErrorMessages
SEVERE: The following errors and warnings have been detected with resource
and/or provider classes:
SEVERE: Missing dependency for field: private javax.ws.rs.core.Response
com.brunata.webmon.ws.resources.RootResource.response
SEVERE: Missing dependency for constructor public
com.brunata.webmon.ws.resources.ChartResource(javax.servlet.ServletContext)
at parameter index 0
SEVERE: Missing dependency for field: private
com.sun.jersey.api.core.HttpRequestContext
com.brunata.webmon.ws.resources.LoginResource.rc
SEVERE: Missing dependency for field: private
com.sun.jersey.api.core.HttpRequestContext
com.brunata.webmon.ws.resources.TestResource.rc
The WAR file has jersey-core.jar, jersey-server.jar so I am really not sure
how I should interpret the "Missing dependecy..." messages?
/Casper
PS: I love developing with Jersey, but it is a bit of a configuration
nightmare unless you work with it all the time it seems.
On Mon, Feb 21, 2011 at 12:01 PM, Pavel Bucek <pavel.bucek_at_oracle.com>wrote:
> Hello Casper,
>
> you have to remove dependency on com.sun.jersey.jersey-test-framework, its
> "nothing" now; see helloworld sample for inspiration, basically you should
> have something like:
>
> <dependency>
> <groupId>com.sun.jersey.jersey-test-framework</groupId>
> <artifactId>jersey-test-framework-grizzly</artifactId>
> <version>${project.version}</version>
> <scope>test</scope>
> </dependency>
>
> helloworld sample:
> http://download.java.net/maven/2/com/sun/jersey/samples/helloworld/1.6-SNAPSHOT/helloworld-1.6-SNAPSHOT-project.zip
>
> Regards,
> Pavel
>
>
>
> On 02/21/2011 11:54 AM, Casper Bang wrote:
>
> Hello list,
>
> After laying dormant for about a year, I got back to my Maven project
> using Jersey. Rolling forward to most recent stable dependencies (i.e.
> Jersey 1.5) I've run into some trouble with the unit testing parts.
>
> I used to only rely on jersey-test-framework, but now the wiki [
> http://jersey.java.net/nonav/documentation/latest/user-guide.html#d4e1298]
> says it requires jersey-test-framework-grizzly. However, if I add this
> dependency, my project refuses to compile due to transient dependency of
> org.glassfish:javax.sevlet.jar:3.0-b66:
>
> Missing:
> ----------
> 1) org.glassfish:javax.servlet:jar:3.0-b66
>
> Try downloading the file manually from the project website.
>
> Then, install it using the command:
> mvn install:install-file -DgroupId=org.glassfish -DartifactId=javax.servlet
> -Dversion=3.0-b66 -Dpackaging=jar -Dfile=/path/to/file
>
> Alternatively, if you host your own repository you can deploy the file
> there:
> mvn deploy:deploy-file -DgroupId=org.glassfish -DartifactId=javax.servlet
> -Dversion=3.0-b66 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
> -DrepositoryId=[id]
>
> Path to dependency:
> 1) com.brunata:ws-webmon:war:1.3-SNAPSHOT
> 2)
> com.sun.jersey.jersey-test-framework:jersey-test-framework-grizzly:jar:1.5
> 3) com.sun.jersey.jersey-test-framework:jersey-test-framework-core:jar:1.5
> 4) org.glassfish:javax.servlet:jar:3.0-b66
>
>
> I find it odd that 1) there should be a dependency of a
> specific (glassfish) servlet implementation and 2) that the dependency can't
> be found yet observed in the java.net repo[
> http://download.java.net/maven/glassfish/org/glassfish/javax.servlet/3.0-b66/javax.servlet-3.0-b66.pom
> ].
>
>
> I'm also getting an error for jersey-test-framework:
>
> 2) com.sun.jersey:jersey-test-framework:jar:1.5
>
> Try downloading the file manually from the project website.
>
> Then, install it using the command:
> mvn install:install-file -DgroupId=com.sun.jersey
> -DartifactId=jersey-test-framework -Dversion=1.5 -Dpackaging=jar
> -Dfile=/path/to/file
>
> Alternatively, if you host your own repository you can deploy the file
> there:
> mvn deploy:deploy-file -DgroupId=com.sun.jersey
> -DartifactId=jersey-test-framework -Dversion=1.5 -Dpackaging=jar
> -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
>
> Path to dependency:
> 1) com.brunata:ws-webmon:war:1.3-SNAPSHOT
> 2) com.sun.jersey:jersey-test-framework:jar:1.5
>
> Since this dependency is mentioned by a wiki referenced blog entry [
> http://blogs.sun.com/naresh/entry/jersey_test_framework_makes_it] and
> indeed seems visible in the java.net repo [
> http://download.java.net/maven/2/com/sun/jersey/jersey-test-framework/1.5/]
> it seems a bit odd.
>
> Perhaps I am missing a repository:
>
> 2 required artifacts are missing.
>
> for artifact:
> com.brunata:ws-webmon:war:1.3-SNAPSHOT
>
> from the specified remote repositories:
> central (http://repo1.maven.org/maven2),
> releases (http://maven.brunata.dk/releases),
> terracotta-repository (
> http://www.terracotta.org/download/reflector/maven2),
> internal (http://maven.brunata.dk/internal),
> maven2-repository.dev.java.net (http://download.java.net/maven/2/),
> snapshots (http://maven.brunata.dk/snapshots),
> dist.wso2.org (http://dist.wso2.org/maven2/),
> maven-repository.dev.java.net (http://download.java.net/maven/1)
>
> ...or does something else jump in the eye? Perhaps there's an up-to-date
> sample using jersey-test-* which can work as a template for porting my stuff
> over. Thanks in advance for pointers. :)
>
> /Casper
>
>
>