BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-01-2009, 11:12 AM   #1 (permalink)
New Member
 
Join Date: May 2009
Model: 9000
PIN: N/A
Carrier: ATT
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Why is java.io.ObjectStreamException used in WTK stub generator for enums

Please Login to Remove!

I am using a web service implemented in WCF which has enums defined in the interface. I am trying to call this from a Java BlackBerry client. I am using Eclipse to develop the Java application for BlackBerry. I am using the Sun Java Wireless Toolkit (WTK) 2.5.2 to generate stub code since the web service is rather large (already in use by a Windows Mobile client).

When I try generating stub code using the WTK, I get errors in Eclipse about the enums. In the following function, it complains that java.io.ObjectStreamException cannot be resolved to a type.

private Object readResolve()
throws java.io.ObjectStreamException {
return fromValue(getValue());
}

When running the Stub Generator, there is a switch for either CLDC 1.0 or CLDC 1.1. Generating with both options result in the same issue.

I found a forum post about this at forums.sun.com with no response. The person in this post states that, "Now java.io.ObjectStreamException is not in CLDC but is in CDC instead. Is there a good tool out there for creating Stubs for Web Services for J2ME specifically CLDC 1.0/1.1 ?" I verified that it doesn't exist in CLDC 1.1 by looking at the documentation.

There are two quick fixes available in Eclipse to fix this situation: 1) Create class 'ObjectStreamException' in package 'java.io' or 2) Fix project setup (which is wanting me to add a reference).

Is this just a bug in the WTK? In case it was, I filed a bug report with Sun and will see if they respond. What is the correct way to work around this?

I have also posted this question at stackoverflow.com which I use for researching other development issues.
Offline  
Old 06-01-2009, 03:36 PM   #2 (permalink)
New Member
 
Join Date: May 2009
Model: 9000
PIN: N/A
Carrier: ATT
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is more information based on reply in stackoverflow.com posting.

Here is what the JSR-172 specification says...
5.2.5 Enumeration
The JAX-RPC Subset does not provide support for XML enumerations.
5.2.6 Simple Types Derived By Restriction
The JAX-RPC Subset does not provide support for deriving simple types by restriction.

The WSDL for the WCF enumeration generates a <xs:simpleType> with <xs:restriction> containing <xs:enumeration>. So I am wondering about the correct way to modify my WSDL to be CLDC compliant. Are there compliancy tools (I have a fairly large WSDL)?
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.