Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Communications Framework (ECF) » @InjectLink(I can not get the link @InjectLink)
@InjectLink [message #1820538] Wed, 22 January 2020 11:15 Go to next message
Gennadii Vakulenko is currently offline Gennadii VakulenkoFriend
Messages: 2
Registered: January 2020
Junior Member

Hello dear forum users. I apologize if I write off topic and not here.

I have a question about Jersey, namely @InjectLink annotations - Declarative Hyperlinking

I can't do it, and I ask for your help.
I have two classes, as shown here
Class WidgetsResource


public class WidgetsResource {

    public Widgets get() {
        return new Widgets();

and class widgets

import org.glassfish.jersey.linking.InjectLink;

public class Widgets {

    URI u;

    public Widgets() {

If I understand correctly, then in the Widgets class in the field URI u there should be a link

import org.glassfish.jersey.linking.InjectLink;

public class Widgets {

    URI u;

    public Widgets() {

Where /context is the application deployment context.
But for some reason, there is nothing there. It returns NULL to me.
Please tell me what am I doing wrong?
  • Attachment: jersey.png
    (Size: 49.75KB, Downloaded 121 times)
Re: @InjectLink [message #1821061 is a reply to message #1820538] Wed, 05 February 2020 04:08 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Hi Gennadii,

It appears to me that the example above is from here:

In the docs above, there is this:

12.7. Configure and register
In order to add the Declarative Linking feature register DeclarativeLinkingFeature

Example 12.1. Creating JAX-RS application with Declarative Linking feature enabled.

// Create JAX-RS application.
final Application application = new ResourceConfig()

[Scott] From the above, it looks as if it's necessary to register the DeclarativeLinkingFeature to activate this function of Jersey.

With ECF remote services, much of this configuration of Jersey is done automatically within the remote services exporter (i.e. the Jersey server distribution provider).

The parent project for both the Jersey and CXF distribution providers are here:

This is the project for the Jersey server distribution provider:

Essentially what's needed for the ECF jersey server distribution to support DeclarativeLinkingFeature is to register that feature at runtime

For example, in this file is a method: createConfigurable()

protected Configurable createConfigurable() {
return new ResourceConfig();

This method could be enhanced to registre the DeclarativeLinkingFeature like this:

protected Configurable createConfigurable() {
return new ResourceConfig().register(DeclarativeLinkingFeature.class);

Currently, however, the distribution provider does not include the Jersey bundle that has the DeclarativeLinkingFeature classes.. That bundle is at maven central:

But this jersey extension library/bundle is currently *not* included in the ECF jersey server distribution provider as of this released version:

I would consider adding support for the DeclarativeLinkingFeature (and perhaps others if desired), but might not be able to happen immediately.

If you would like work on this yourself or request that I put support for DeclarativeLinkingFeature in the ECF jersey server distribution provider, please open an issue here:

or contact me directly at scottlsewis at and reference this forum entry directly.


Previous Topic:@InjectLink
Goto Forum:

Current Time: Tue Jun 06 00:44:52 GMT 2023

Powered by FUDForum. Page generated in 0.01503 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top