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 107513 - Codegeneration issues inMobile Client to Webapplication
Summary: Codegeneration issues inMobile Client to Webapplication
Status: CLOSED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: Web Services (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Michal Skvor
URL:
Keywords:
: 107514 (view as bug list)
Depends on:
Blocks: 104262
  Show dependency tree
 
Reported: 2007-06-20 20:42 UTC by pcmreddy
Modified: 2007-06-27 20:11 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pcmreddy 2007-06-20 20:42:10 UTC
Build used 06/17/07 on xp with JDK 1.6 U1

How to reproduce.
Create a webapplication
Add a webservice "HelloWS"
Add an operation "getMsg" takes "name" as parameter and returns a string.

Deploy this application to Appserver.
Now Create a Mobile application.
Add "Mobile Client to Web Application"
Select "getMsg" operation

Observe the generated code has an error.
Open Utility.java in webapplication.
...
   protected static Object readObject(DataInput in) throws IOException {
        short type = in.readShort();
        Object result;
        switch (type) {
        case STRING_TYPE:
            result = ;
            return result;
        case NULL_TYPE: /* null */
            return null;
        default:
            throw new IllegalArgumentException(
                    "Unsupported return type (" + type + ")");
        }
    }
}
...

Check the line "result =;"
There is no value on right side.

Open WebService.java in Client code observe the same.
...
   private static Object readObject(DataInput in) throws IOException {
        int type = in.readShort();
        int length;
        Object result;
        switch (type) {
        case 1:
            result = ;
            return result;
        case -1: /* NULL */
            return null;
        }
        throw new IllegalArgumentException("Unsupported return type (" + type + ")");
    } 
}
...

Check the line " result = ;"
There is no value on right side.
Comment 1 pcmreddy 2007-06-20 20:45:25 UTC
As this are code generation errors making this issue as p1.
Comment 2 Lukas Hasik 2007-06-20 20:54:08 UTC
*** Issue 107514 has been marked as a duplicate of this issue. ***
Comment 3 Peter Pis 2007-06-25 19:05:21 UTC
This issue is showstopper for M10. Please integrate the fix into the trunk and "release60-m10" branch. 
Comment 4 Michal Skvor 2007-06-26 10:36:37 UTC
Fixed. The error was in serializer for String type in PrimitiveTypeSerializer class.
Comment 5 pcmreddy 2007-06-26 19:21:59 UTC
This is still reproducible in 6/26 M10 Build.

Utility.jsvs in Webapplication
...
      case STRING_TYPE:
            result = ;
            return result;
        case NULL_TYPE: /* null */
...

and NewWebService.java in MobileApplication.

...
        switch (type) {
        case 1:
            result = ;
            return result;
        case -1: /* NULL */
            return null;
...
Comment 6 Adam Sotona 2007-06-27 09:07:04 UTC
I've verified it in 6.0M10 (build 200706262201) and the fix works for me.
Please use the latest build for verification. 
Comment 7 pcmreddy 2007-06-27 20:08:47 UTC
Verified in M10 on 6/27.