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 102177 - JSR172 Stubs generated by the IDE fail in WTK251 runtime
Summary: JSR172 Stubs generated by the IDE fail in WTK251 runtime
Status: VERIFIED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: Web Services (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Michal Skvor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-23 15:58 UTC by Lukas Hasik
Modified: 2007-04-26 13:23 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 Lukas Hasik 2007-04-23 15:58:46 UTC
MobPack 551 build 070423

-have a webservice method that returns array of Strings
 public String[] getStrings() 
->the generated stubs fails in runtime of the WTK 2.5.1 on ClassCastException

-the 2.2 code
        java.lang.String[] result;
        // Convert the result into the right Java type.
        // Unwrapped return value
        Object _returnObj = ((Object[])resultObj)[0];
        result = (java.lang.String[]) _returnObj;
        return result; 
-the 2.5 code
        java.lang.String[] result;
        // Convert the result into the right Java type.
        // Unwrapped return value
        Object _returnObj = ((Object[])resultObj)[0];
        // Even if return type of remote method is String[],
        // Object[] is expected according to the spec.
        Object[] _returnObjArray = (Object[]) _returnObj;
        result = new java.lang.String[_returnObjArray.length];
        java.lang.System.arraycopy(_returnObjArray, 0, result, 0,
_returnObjArray.length);
        return result; 


->we have to upgrade the generator in the 5.5.1 to generate 2.5.1 complaint code
when we want to bundle the WTK 2.5.1

-the wtk 2.5.1 code runs on wtk2.2 without problems
Comment 1 Michal Skvor 2007-04-25 15:52:55 UTC
Fixed.
Comment 2 Lukas Hasik 2007-04-25 17:20:25 UTC
the generated code is OK with the replaced library.

the issue has to be verified in tomorrow's daily build
Comment 3 pcmreddy 2007-04-25 21:36:11 UTC
Here is the generated code with platform set to WTK 2.5.1
However I still see class cast exception. 

"VisualMidlet, greeter, VisualMidlet
Exception: java.lang.ClassCastException"

Generated code.
java.lang.String[] result;
// Convert the result into the right Java type.
// Unwrapped return value
Object resultObj2 = ((Object[])resultObj)[0];
result = (java.lang.String[]) resultObj2;
return result;
Comment 4 Martin Ryzl 2007-04-25 22:15:48 UTC
PCM, the issue has been fixed on Apr/25 and Lukas was going to verify it in
tomorrow's daily build (Apr/26). Have you built your own IDE from the latest
sources? Because the latest daily is from Apr/25.
Comment 5 Lukas Hasik 2007-04-26 11:21:32 UTC
works in build 070426_1
Comment 6 Lukas Hasik 2007-04-26 13:23:55 UTC
v