Hi Colin,
I have a Jersey implementation working with Spring and all annotations
on the resource interfaces.
I suspect you have duplicate path statements somewhere. Beware if there
is a child, ie Customers and Customer. There is no need for a Path on
the child.
I would advise not to use AOP on the REST api tier, the @Context fields
will not get injected
--------------------------------------------------------------------------
AstraZeneca UK Limited is a company incorporated in England and Wales with registered number: 03674842 and a registered office at 2 Kingdom Street, London, W2 6BD.
Confidentiality Notice: This message is private and may contain confidential, proprietary and legally privileged information. If you have received this message in error, please notify us and remove it from your system and note that you must not copy, distribute or take any action in reliance on it. Any unauthorised use or disclosure of the contents of this message is not permitted and may be unlawful.
Disclaimer: Email messages may be subject to delays, interception, non-delivery and unauthorised alterations. Therefore, information expressed in this message is not given or endorsed by AstraZeneca UK Limited unless otherwise notified by an authorised representative independent of this message. No contractual relationship is created by this message by any person unless specifically indicated by agreement in writing other than email.
Monitoring: AstraZeneca UK Limited may monitor email traffic data and content for the purposes of the prevention and detection of crime, ensuring the security of our computer systems and checking Compliance with our Code of Conduct and Policies.
-----Original Message-----
From: Colin Vipurs [mailto:zodiaczx6_at_gmail.com]
Sent: 01 May 2012 10:33
To: users_at_jersey.java.net
Subject: [Jersey] Annotating Interfaces
I have a project that uses Spring that I wish to introduce AOP to.
Our resource classes have constructors with arguments so I believe
this requires introducing interfaces and annotating those instead of
the implementation so that Spring can do its "magic", and this is
where the problems start.
I've moved my annotations to my interface, so I end with something like:
@Path("/")
public interface BlahResource {
@Path("/blah/{id}")
public void getTheBlah();
}
public class JaxRsBlahResource implements BlahResource {
public void getTheBlah() { .... }
}
This throwns an error as following:
SEVERE: Conflicting URI templates. The URI template / for root
resource class JaxRsBlahResource and the URI template / transform to
the same regular expression (/.*)?
So it seems that the @Path component is being picked up twice. If I
add another @Path annotation to the implementation, so something like:
@Path("/blah")
The everything works ok, but I now have that resource exposed at two
different endpoints.
It feels like I'm missing something obvious, but I'm tearing my hair
out figuring out what?
--
Maybe she awoke to see the roommate's boyfriend swinging from the
chandelier wearing a boar's head.
Something which you, I, and everyone else would call "Tuesday", of
course.