APAR status
Closed as program error.
Error description
Java to UML transformation fails with: java.lang.Object; incompatible with java.lang.String Transforming a java class into an existing UML model. This window appears: (See attached screenshot: JavaToUML_TransformationAborted.zip) Transformation execution status. Details: java.lang.ClassCastException: [Ljava.lang.Object; incompatible with java.lang.String [Ljava.lang.Object; incompatible with java.lang.String Transform context stack [Ljava.lang.Object; incompatible with java.lang.String Transform com.ibm.xtools.transform.java.uml.GenerateUmlMethodTransform: Element 'com.ibm.xtools.transform.jaxrs.uml2.rules.GenerateMethodStereoR ule' Transform com.ibm.xtools.transform.java.uml.GenerateTransform: Element 'com.ibm.xtools.transform.java.uml.MethodProxyExtractor' was executing source 'c.. Transform Java to UML: Element 'com.ibm.xtools.transform.java.uml.extractors.ElementProxyExtrac tor' was executing source '[L/SCSISessionManager/src/com... This java class has JAX-RS annotations. Here's an example of some of them: @Path('get/uniqueId/{ibmUid}/userId/{ibmUserId}') @Produces({ 'application/xml', 'text/plain' }) @GET This option is checked in the transform: Comment out the @Produces annotations that have multiple values, the transform works fine. Also, if you change all @Produces annotations to have single values, like @Produces('text/plain'), the transform will work. So, the transform is not able to handle the syntax for specifying multiple values in @Produces annotations. Note that other classes with @Consumes annotations with mulitple values for which the transform also fails. There are three issues here: 1. As pointed out @Produces and @Consumes of the format {'a', 'b'} are not being handled and cause an exception in reverse. 2. There is an enum (StatusCode), which is causing NPE while running reverse. 3. The Application class SCSIRestApplication method getClasses has classes referred without inline fqn of each class. This causes reverse not being able to identify can create paths between application and resources. 1 and 2 can easily be fixed by workarounds, i.e. using 'a,b,c' syntax in @Produces/@Consumes and using fqn of each in getClasses. However 3, does not have a workaround, except by somehow removing references to the enum in the code first and then reversing.
Local fix
Problem summary
**************************************************************** * USERS AFFECTED: * **************************************************************** * PROBLEM DESCRIPTION: * **************************************************************** * RECOMMENDATION: * **************************************************************** Reverse transformation sometimes fails with an exception.
Problem conclusion
Reverse transformation now works as expected.
Temporary fix
Comments
APAR Information
APAR number
PM64298
Reported component name
RATL SW ARCHITE
Reported component ID
5725A3000
Reported release
803
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2012-05-09
Closed date
2012-06-28
Last modified date
2012-06-28
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
RATL SW ARCHITE
Fixed component ID
5725A3000
Applicable component levels
R803 PSN
UP
[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSYK2S","label":"Rational Software Architect Designer"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"803","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSYK2S","label":"Rational Software Architect Designer"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"803","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]
Document Information
Modified date:
10 September 2020