Problem with IntelliJ 12.1.1 and Jersy 1.12

Hi all I am trying a very simple Jersey 1.12/Tomcat 7/Java 7u15 project in IntelliJ.

I set it up with Web, Rest, Spring and Tomcat. I have one service class

package org.fwp.service;


public class FWPService

    public String getTest()
        return "TEST WORKED";


And a simple web.xml file

<?xml version="1.0" encoding="UTF-8"?>





However, when I try to run the project one of thwo things happen

1) If I have the Jersey Jar in the 'Available Elements' of the project artiacts configuration section, then Jersey does not seem to start at all and I get the following error when I go to localhost:8080/fwp/test

HTTP Status 404 -

type Status report
description The requested resource is not available.

Apache Tomcat/7.0.39

2) However if I move the Jersey jar into the lib directory of the web service then the webapp starts up with the following error

INFO: validateJarFile(/Users/conrad/FWPServerJava/out/artifacts/FWPServerJava_war_exploded/WEB-INF/lib/grizzly-servlet-webserver-1.9.45.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Apr 15, 2013 7:41:23 AM com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the packages:

But I am able to see the string "TEST WORKED" at the right url localhost:8080/fwp/test

In the dependenies for the module I have the Jersey jar set to 'compile' scope.

Can anybody help? This is the standard setup that IntelliJ created when I made the project.

Comment actions Permalink

Anybody? I really could do with help fixing this issue.

Comment actions Permalink


It looks like grizzly-servlet-webserver-1.9.45.jar is not a part of Jersey -- I can't see a grizzly jar in and also it's not among ones to be included into <artifact>/WEB-INF/lib according to tutortials (for instance -

So, I suspect you shouldn't include a grizzly-*.jar into the artifact. Do you have specific reasons to included the jar? Can you please try without it?


Please sign in to leave a comment.