view raw
Ced Ced - 11 months ago 37
Java Question

jax-rs, jersey archetype, can't seem to use @WebListener

I'm trying to launch a background task at the start of a restful service. However I can't seem to use neither

. I thought it was a servlet version problem but it's the first time I use this archetype thing and jax rs.

I created the project on eclipse by right-clicking-> new project -> maven -> and I typed this for the archetype

my web.xml where it says version 2.5 (I changed it to 3) :

<web-app version="2.5" xmlns="" xmlns:xsi="" xsi:schemaLocation="">
<servlet-name>Jersey Web Application</servlet-name>
<servlet-name>Jersey Web Application</servlet-name>

That I changed to :


my pom.xml is :

<project xmlns="" xmlns:xsi=""





<!-- <artifactId>jersey-container-servlet-core</artifactId> -->
<!-- use the following artifactId if you don't need servlet 2.x compatibility -->



Neither can I use the interface

Ced Ced

I went in project properties and made sure some of the project facets were correct.

Then I went back to check if I could import the interface by hovering my mouse, there wasn't a possibility to import it but there was a "fix" proposition under it which made a jar available. Then it worked. All in all easy fix but it took me a while.

or as peerskilled said just add this to maven: