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 153274 - Generated .js files in RESTful Web Service Client Stubs.
Summary: Generated .js files in RESTful Web Service Client Stubs.
Status: RESOLVED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Ayub Khan
URL: http://http://www.netbeans.org/kb/60/...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-16 13:46 UTC by gmaniloff
Modified: 2009-02-19 23:29 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Customers client stub (3.90 KB, text/plain)
2008-12-02 22:39 UTC, Ayub Khan
Details
Customer client stub (6.98 KB, text/plain)
2008-12-02 22:40 UTC, Ayub Khan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gmaniloff 2008-11-16 13:46:32 UTC
Hello,

     Versions: Netbeans 6.5 RC2 / Tomcat 6.018 / Toplink / Jersey 1.0 / Jax-RS 1.0 / Sql Server 2005 (tested on mySql
5.0 and Derby 10)

Symptom:  When you do the Step 7 of the "Creating Restful Web Service Client stubs" the data of your database is not
shown and you will get an error of a Proxy needed becose the function resource.getItems() returns 0.

Problem: On all the Init() functions of the .js generated files says this:

      note: in this case we will open the Customer.js file.

      init : function() {
      var remote = new CustomerRemote(this.uri);
      var c = remote.getJson_();
      if(c != -1) {
         var myObj = eval('(' +c+')');
         var customer = myObj.customer;
      ......
 
The contents of remote.getJson_() has a reference of an "customess" object but not to the "customer" object so.. the
folowing line

         var customer = myObj.customer;

Asigns an undefined and null object to the var customer

Fix:
 
      In all the generated .js rest files:

      replace the line ->>   var customer = myObj.customer;
      with the line ---->>   var customer = myObj;

This was tested on other projects with same results.


Regards.
Guillermo Maniloff
from Argentina
Comment 1 Ayub Khan 2008-12-01 23:05:14 UTC
This issue is a duplicate of 150367 and is fixed in NB6.5 FCS. Please
try NB6.5 FCS to verify this.

*** This issue has been marked as a duplicate of 150367 ***
Comment 2 Ayub Khan 2008-12-02 22:38:49 UTC
I am sorry, the fix http://hg.netbeans.org/main/rev/c771ff3b8fde somehow didn't make it into NB6.5. We are planning to
put this fix into NB 6.5 patch2. In the meanwhile you can try either

1) the NB dev build from http://bits.netbeans.org/download/trunk/nightly/latest/ or
2) Use the attached sample to fix generated .js files for your project.
Atttached files Customers.js (the container script that communicates with CustomersResource) and Customer.js (the
container item script that communicates with CustomerResource)
Comment 3 Ayub Khan 2008-12-02 22:39:49 UTC
Created attachment 74445 [details]
Customers client stub
Comment 4 Ayub Khan 2008-12-02 22:40:05 UTC
Created attachment 74446 [details]
Customer client stub
Comment 5 Ayub Khan 2008-12-03 17:33:21 UTC
According to QA, since its already fixed for 7.0 M1, this issue can be closed as fixed.

Hi Guillermo Maniloff,

Please use either solutions
1) the NB dev build from http://bits.netbeans.org/download/trunk/nightly/latest/ or
2) Use the attached sample to fix generated .js files for your project.
Atttached files Customers.js (the container script that communicates with CustomersResource) and Customer.js (the
container item script that communicates with CustomerResource)
3) Also this fix will make it into 7.0 milestone1 release (tentative date 3rd week of December)

Thanks
Ayub