This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 229816 - REST Java Client wizard throws exception for Delicious service
Summary: REST Java Client wizard throws exception for Delicious service
Status: RESOLVED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: Client (show other bugs)
Version: 7.4
Hardware: All All
: P2 normal (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-16 02:32 UTC by David Konecny
Modified: 2013-06-28 02:17 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 200689


Attachments
stacktrace (9.13 KB, text/plain)
2013-05-16 02:32 UTC, David Konecny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Konecny 2013-05-16 02:32:14 UTC
Build: NetBeans IDE Dev (Build 20130515-8ffb71db1a32)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11
OS: Linux

User Comments:
dkonecny: Generating REST Java Client for Delicious -> Bookmarking Service -> posts/all throws this exception because OAuth does not seem to be supported in Jersey 2.0. Or perhaps this was not implemented on NB side yet.




Stacktrace: 
java.lang.AssertionError
   at org.netbeans.modules.websvc.rest.client.JaxRsGenerationStrategy.generateOAuthMethods(JaxRsGenerationStrategy.java:803)
   at org.netbeans.modules.websvc.rest.client.ClientJavaSourceHelper.generateClassArtifacts(ClientJavaSourceHelper.java:527)
   at org.netbeans.modules.websvc.rest.client.ClientJavaSourceHelper.modifyJerseyClientClass(ClientJavaSourceHelper.java:391)
   at org.netbeans.modules.websvc.rest.client.ClientJavaSourceHelper.access$000(ClientJavaSourceHelper.java:126)
   at org.netbeans.modules.websvc.rest.client.ClientJavaSourceHelper$1.run(ClientJavaSourceHelper.java:340)
   at org.netbeans.modules.websvc.rest.client.ClientJavaSourceHelper$1.run(ClientJavaSourceHelper.java:331)
Comment 1 David Konecny 2013-05-16 02:32:16 UTC
Created attachment 134491 [details]
stacktrace
Comment 2 Petr Jiricka 2013-05-28 08:37:29 UTC
Waiving this bug for 7.3.1.
Comment 3 Milan Kuchtiak 2013-06-25 08:43:42 UTC
The Delicious as well as Twitter client were examples demonstrating how to use OAuth authentication with Jersey (1.x).

The OAuth libraries (oauth-client and oauth-signature) were removed from Jersey 2.0 library and the generated code was simplified (AssertionError was included).

Solutions:

1, The Simplest
   comment out AssertionError from  the code

2. The Most Complex.
Add oauth-client and oauth-signature back to JerseyLibrary and figure out how to rewrite old (Jersey 1.x) code to new JAX-RS 2.0/Jersey 2.0 code

3. Provide some hint to user that the Delicious client requires OAuth functionality, that requires Jersey 1.x + oauth-client + oauth-signature jar files, and this can be implemented in Java EE 6 project types only.
Comment 4 Milan Kuchtiak 2013-06-25 08:55:45 UTC
The solution 2 is not realistic. The oauth-client/ oauth-signature libraries were not migrated to Jersey 2.0 yet.
Comment 5 Milan Kuchtiak 2013-06-26 08:59:01 UTC
Delicious rest resources were likely simplified recently.
OAuth authentication is not needed any more, but the BASIC authentication is required.

Also "http://api.del.icio.us/v2" URL is not working anymore, but "http://api.del.icio.us/v1" works.

I discovered one important issue anyway. The Rest Client Wizard with Basic Authentication is incorrectly generated(see bug 231819).
Comment 6 Milan Kuchtiak 2013-06-26 17:02:58 UTC
Fixed for 7.4:
Changed authentication to Basic.
Comment 7 Quality Engineering 2013-06-28 02:17:24 UTC
Integrated into 'main-silver', will be available in build *201306272300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/43a65ada94aa
User: Milan Kuchtiak <mkuchtiak@netbeans.org>
Log: #229816 change Delicious authentication to Basic