3

I am trying to intigrate jersey-server and the grizzly-servlet-webserver into my Maven Webapp to try a hellworld with JAX-RS. Unfortunately the Jersey and Grizzly dependencies are trouble and not working.

I tried deleting the .m2 folder because I thought it might be corrupted which did not help. I added other dependencies like jsoup which works fine. In the log it actually downloads jersey-server from the repository so its not a networking issue.

Can anybody help me? I am really stuck!

My Eclipse Log:

14.07.11 18:31:33 MESZ: Refreshing [/server/pom.xml]
14.07.11 18:31:33 MESZ: Missing artifact com.sun.jersey:jersey-server:jar:1.8:compile
14.07.11 18:31:33 MESZ: Missing artifact com.sun.grizzly:grizzly-servlet-webserver:jar:1.9.18-i:compile
14.07.11 18:31:33 MESZ: Missing artifact com.sun.grizzly:grizzly-utils:jar:1.9.18-i:compile
14.07.11 18:31:33 MESZ: Maven Builder: AUTO_BUILD 
14.07.11 18:31:42 MESZ: Updated index for central|http://repo1.maven.org/maven2

... an earlier part where it downloads:

.07.11 18:08:25 MESZ: Downloaded http://download.java.net/maven/2/javax/servlet/servlet-api/2.5/servlet-api-2.5.pom
14.07.11 18:08:26 MESZ: Downloading http://repo1.maven.org/maven2/javax/servlet/servlet-api/2.5/servlet-api-2.5.pom
14.07.11 18:08:26 MESZ: Downloaded http://repo1.maven.org/maven2/javax/servlet/servlet-api/2.5/servlet-api-2.5.pom
14.07.11 18:08:27 MESZ: Downloading http://download.java.net/maven/2/com/sun/jersey/jersey-server/1.8/jersey-server-1.8.jar
14.07.11 18:08:27 MESZ: Downloaded http://download.java.net/maven/2/asm/asm/3.1/asm-3.1.jar
14.07.11 18:08:28 MESZ: Downloading http://download.java.net/maven/2/com/sun/jersey/jersey-core/1.8/jersey-core-1.8.jar
14.07.11 18:08:29 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-servlet-webserver/1.9.18-i/grizzly-servlet-webserver-1.9.18-i.jar
14.07.11 18:08:30 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-http/1.9.18-i/grizzly-http-1.9.18-i.jar
14.07.11 18:08:31 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-framework/1.9.18-i/grizzly-framework-1.9.18-i.jar
14.07.11 18:08:33 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-rcm/1.9.18-i/grizzly-rcm-1.9.18-i.jar
14.07.11 18:08:34 MESZ: Downloaded http://download.java.net/maven/2/com/sun/grizzly/grizzly-rcm/1.9.18-i/grizzly-rcm-1.9.18-i.jar
14.07.11 18:08:35 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-portunif/1.9.18-i/grizzly-portunif-1.9.18-i.jar
14.07.11 18:08:37 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-http-servlet/1.9.18-i/grizzly-http-servlet-1.9.18-i.jar
14.07.11 18:08:37 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-utils/1.9.18-i/grizzly-utils-1.9.18-i.jar
14.07.11 18:08:38 MESZ: Downloaded http://download.java.net/maven/2/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar

POM.XML

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.e.api</groupId>
    <artifactId>server</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>server Maven Webapp</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-server</artifactId>
            <version>1.8</version>
        </dependency>
        <dependency>
            <groupId>com.sun.grizzly</groupId>
            <artifactId>grizzly-servlet-webserver</artifactId>
            <version>1.9.18-i</version>
        </dependency>
    </dependencies>
<build>
    <finalName>server</finalName>
    <plugins>
        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>maven-jetty-plugin</artifactId>
        </plugin>
    </plugins>
</build>
    <repositories>
        <repository>
            <id>maven2-repository.java.net</id>
            <name>Java.net Repository for Maven</name>
            <url>http://download.java.net/maven/2/</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>maven-repository.java.net</id>
            <name>Java.net Maven 1 Repository (legacy)</name>
            <url>http://download.java.net/maven/1</url>
            <layout>legacy</layout>
        </repository>
    </repositories>
</project>
Dominik
  • 4,718
  • 13
  • 44
  • 58
  • `C:\Users\Dom\.m2\repository\com\sun\jersey\jersey-server\1.8\jersey-server-1.8.pom` exists too for example. – Dominik Jul 14 '11 at 16:38
  • 1
    Try running maven from the command line with `-e` to show stacktraces. Then post the error messages. – Ryan Stewart Jul 14 '11 at 16:43
  • "to try a hellworld" I'd say a hellworld is what you've already got :-) – Sean Patrick Floyd Jul 14 '11 at 16:44
  • I added `jetty` to `` because I am actually trying to run it in jetty rather than grizzly at the end. The problem already occurs when I save the `pom.xml` after adding the two dependencies. What command do you want me to run exactly with `-e`? – Dominik Jul 14 '11 at 17:05
  • when running `mvn jetty:run` I get a nice `[INFO] Started Jetty Server`. – Dominik Jul 14 '11 at 17:25

1 Answers1

2

Do you see the same problem if you explicitly run Maven (as opposed to the M2E autorun)? If not, you probably need to update the project config (select proj, right-click, Maven..Update..Project Configuration and Maven..Update..Project Dependencies.

Ed Staub
  • 15,480
  • 3
  • 61
  • 91