2.2 plugin REST interface no longer available in 2.3.1

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

2.2 plugin REST interface no longer available in 2.3.1

PeterB
Hi,

we are working on a plug-in and developing for Nexus 2.2-01. It has web configuration that uses a REST interface. It works when running on Nexus 2.2-01.

When using this plug-in (still built for 2.2-01) on a Nexus 2.3.1 everything works except the REST interface is not published. Gives 404. I have tried both our GUI and directly accessing the REST interface in the web browser with the same result.

The REST handling is much based on the LDAP plug-in that is provided with Nexus. The REST interface is quite similar to the LDAP class: LdapUserAndGroupsConfigurationPlexusResource.

I can see no error in the log. Not during start up or during the actual REST call. REST calls for Nexus own plug-ins work.

I saw that there has been a lot of updates to 3PP libraries according the the 2.3 release information but I can not see how that would affect the plug-in.

Any ideas what could cause this behaviour and if it is possible to fix in out 2.2 development?

/BR Peter Bäckman, Tieto
Reply | Threaded
Open this post in threaded view
|

Re: 2.2 plugin REST interface no longer available in 2.3.1

Peter Lynch-2
Can you tell us what annotations are on your resource class? 404 sounds like your REST endpoints are not being registered by the container.

You should compare you resource classes with some working 2.3.1 versions. For example:


-Peter


On Thu, Apr 4, 2013 at 11:20 AM, PeterB <[hidden email]> wrote:
Hi,

we are working on a plug-in and developing for Nexus 2.2-01. It has web
configuration that uses a REST interface. It works when running on Nexus
2.2-01.

When using this plug-in (still built for 2.2-01) on a Nexus 2.3.1 everything
works except the REST interface is not published. Gives 404. I have tried
both our GUI and directly accessing the REST interface in the web browser
with the same result.

The REST handling is much based on the LDAP plug-in that is provided with
Nexus. The REST interface is quite similar to the LDAP class:
LdapUserAndGroupsConfigurationPlexusResource.

I can see no error in the log. Not during start up or during the actual REST
call. REST calls for Nexus own plug-ins work.

I saw that there has been a lot of updates to 3PP libraries according the
the 2.3 release information but I can not see how that would affect the
plug-in.

Any ideas what could cause this behaviour and if it is possible to fix in
out 2.2 development?

/BR Peter Bäckman, Tieto



--
View this message in context: http://maven.40175.n5.nabble.com/2-2-plugin-REST-interface-no-longer-available-in-2-3-1-tp5752625.html
Sent from the Nexus Maven Repository Manager Dev List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: 2.2 plugin REST interface no longer available in 2.3.1

PeterB
It looks so similar.

The same javax.ws imports.

Our class annotations:
@Component(role = PlexusResource.class, hint = "ArmConfigurationPlexusResource")
@Path("/arm/conf")
@Produces({ "application/xml", "application/json" })
@Consumes({ "application/xml", "application/json" })
public class ArmConfigurationPlexusResource extends AbstractSecurityPlexusResource {

And our annotations for get
        @Override
        @GET
        @ResourceMethodSignature(output = ARMConfResp.class)
        public Object get(Context context, Request request, Response response, Variant variant) throws ResourceException {

But as you say it feels like it is not published.

/Peter
Reply | Threaded
Open this post in threaded view
|

Re: 2.2 plugin REST interface no longer available in 2.3.1

Stuart McCulloch-2
Note that the Restlet1x layer was moved into its own plugin in Nexus 2.3, so you need to add this dependency:

    <dependency>
      <groupId>org.sonatype.nexus.plugins</groupId>
      <artifactId>nexus-restlet1x-plugin</artifactId>
      <type>${nexus-plugin.type}</type>
      <scope>provided</scope>
    </dependency>

to your plugin pom.xml otherwise it won't have access to the AbstractSecurityPlexusResource type at runtime.

On 5 Apr 2013, at 06:55, PeterB wrote:

> It looks so similar.
>
> The same javax.ws imports.
>
> Our class annotations:
> @Component(role = PlexusResource.class, hint =
> "ArmConfigurationPlexusResource")
> @Path("/arm/conf")
> @Produces({ "application/xml", "application/json" })
> @Consumes({ "application/xml", "application/json" })
> public class ArmConfigurationPlexusResource extends
> AbstractSecurityPlexusResource {
>
> And our annotations for get
> @Override
> @GET
> @ResourceMethodSignature(output = ARMConfResp.class)
> public Object get(Context context, Request request, Response response,
> Variant variant) throws ResourceException {
>
> But as you say it feels like it is not published.
>
> /Peter
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/2-2-plugin-REST-interface-no-longer-available-in-2-3-1-tp5752625p5752724.html
> Sent from the Nexus Maven Repository Manager Dev List mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: 2.2 plugin REST interface no longer available in 2.3.1

Stuart McCulloch-2
On 5 Apr 2013, at 12:32, Stuart McCulloch wrote:

> Note that the Restlet1x layer was moved into its own plugin in Nexus 2.3, so you need to add this dependency:
>
>    <dependency>
>      <groupId>org.sonatype.nexus.plugins</groupId>
>      <artifactId>nexus-restlet1x-plugin</artifactId>
>      <type>${nexus-plugin.type}</type>

^ That should read  <type>nexus-plugin</type>

>      <scope>provided</scope>
>    </dependency>
>
> to your plugin pom.xml otherwise it won't have access to the AbstractSecurityPlexusResource type at runtime.
>
> On 5 Apr 2013, at 06:55, PeterB wrote:
>
>> It looks so similar.
>>
>> The same javax.ws imports.
>>
>> Our class annotations:
>> @Component(role = PlexusResource.class, hint =
>> "ArmConfigurationPlexusResource")
>> @Path("/arm/conf")
>> @Produces({ "application/xml", "application/json" })
>> @Consumes({ "application/xml", "application/json" })
>> public class ArmConfigurationPlexusResource extends
>> AbstractSecurityPlexusResource {
>>
>> And our annotations for get
>> @Override
>> @GET
>> @ResourceMethodSignature(output = ARMConfResp.class)
>> public Object get(Context context, Request request, Response response,
>> Variant variant) throws ResourceException {
>>
>> But as you say it feels like it is not published.
>>
>> /Peter
>>
>>
>>
>> --
>> View this message in context: http://maven.40175.n5.nabble.com/2-2-plugin-REST-interface-no-longer-available-in-2-3-1-tp5752625p5752724.html
>> Sent from the Nexus Maven Repository Manager Dev List mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: 2.2 plugin REST interface no longer available in 2.3.1

PeterB
Adding the dependency make it possible to build for 2.2-01 and run in 2.3.1. Although running in 2.2 causes problems loading my plugin.

From nexus.log:
The following plugins were processed:  
... org.sonatype.nexus.plugins:nexus-restlet1x-plugin:2.3.0-01 :: action=ACTIVATE result=MISSING                                                                        
       Reason: Plugin artifact "org.sonatype.nexus.plugins:nexus-restlet1x-plugin:2.3.0-01" not found!                                                                  
... com.company.my:my-nexus-extension:1.0-SNAPSHOT :: action=ACTIVATE result=BROKEN      


Is it possible to add this dependency and still use the plug-in in 2.2? If 2.2 would just skip the dependency if the plug-in is not found?

/BR Peter
Reply | Threaded
Open this post in threaded view
|

Re: 2.2 plugin REST interface no longer available in 2.3.1

Igor Fedorenko-3
I believe you will have to build two versions of the plugin, one that
targets nexus 2.2 and one 2.3. Although I have not tried this myself,
this should be doable by pom-profiles.

We plan to introduce better version compatibility story in a future
version of nexus, but this is rather significant amount of work and I
don't currently know when exactly this will happen.

--
Regards,
Igor

On 2013-04-09 4:16 AM, PeterB wrote:

> Adding the dependency make it possible to build for 2.2-01 and run in 2.3.1.
> Although running in 2.2 causes problems loading my plugin.
>
>  From nexus.log:
> The following plugins were processed:
> ... org.sonatype.nexus.plugins:nexus-restlet1x-plugin:2.3.0-01 ::
> action=ACTIVATE result=MISSING
>         Reason: Plugin artifact
> "org.sonatype.nexus.plugins:nexus-restlet1x-plugin:2.3.0-01" not found!
> ... com.company.my:my-nexus-extension:1.0-SNAPSHOT :: action=ACTIVATE
> result=BROKEN
>
>
> Is it possible to add this dependency and still use the plug-in in 2.2? If
> 2.2 would just skip the dependency if the plug-in is not found?
>
> /BR Peter
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/2-2-plugin-REST-interface-no-longer-available-in-2-3-1-tp5752625p5753274.html
> Sent from the Nexus Maven Repository Manager Dev List mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]