Topic
3 replies Latest Post - ‏2013-09-11T12:56:03Z by develin
SystemAdmin
SystemAdmin
11979 Posts
ACCEPTED ANSWER

Pinned topic VapNumberToBooleanConverter returns java.lang.Short???

‏2003-03-28T23:38:49Z |
Hi there,

I'm working w/WSAD4.0.3 & Oracle 9i. After I performed
meet-in-the-middle
mapping w/my CMPs, WSAD automatically used VapNumberToBooleanConverter
for all of the CMP primitive boolean fields - which I thought was ok
since those fields
were mapped to Oracle NUMBER in my schema. I just tested the CMP and
received
the ff. ClassCastException when it tried to store the database value
into the CMP
boolean field:

CNTR0021E: Non-application exception occurred on bean
BeanId(MyEAR#MyEJBs.jar#MyCust, my.entitybeans.MyCustKey@8bf5413a):
com.ibm.websphere.cpi.CPIException: java.lang.ClassCastException:
java.lang.Short; nested exception is:
java.lang.ClassCastException: java.lang.Short
java.lang.ClassCastException: java.lang.Short
at
my.entitybeans.EJSJDBCPersisterCMPMyCustBean.store(EJSJDBCPersisterCMPMyCustBean.java:342)

at
com.ibm.ejs.container.ContainerManagedBeanO.store(ContainerManagedBeanO.java:299)

at
com.ibm.ejs.container.EntityBeanO.beforeCompletion(EntityBeanO.java:559)

at
com.ibm.ejs.container.ContainerTx.beforeCompletion(ContainerTx.java:267)

<< snipped the rest >>

In the EJSJDBCPersisterCMPMyCustBean.store() method it throws an
exception here:
~~~
objectTemp =
com.ibm.vap.converters.VapNumberToBooleanConverter.singleton().dataFrom(new
Boolean(b.invAcct));
if (objectTemp == null) {
pstmt.setNull(3, java.sql.Types.DECIMAL);
}
else {
pstmt.setBigDecimal(3, (java.math.BigDecimal)objectTemp);
}
~~~

I've tried NOT using converters and even playing around w/the schema to
change
column type in WSAD but have not been successful. Has anyone encountered
this
before? Is this a VapConverter problem? Thanks so much,
Frankie
Updated on 2003-09-05T16:43:00Z at 2003-09-05T16:43:00Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    11979 Posts
    ACCEPTED ANSWER

    Re: VapNumberToBooleanConverter returns java.lang.Short???

    ‏2003-09-04T21:15:52Z  in response to SystemAdmin
    Did anyone have a solution for this problem? I have the same issue.
    • develin
      develin
      1 Post
      ACCEPTED ANSWER

      Re: VapNumberToBooleanConverter returns java.lang.Short???

      ‏2013-09-11T12:56:03Z  in response to SystemAdmin

      Me to.

      The Problem is, that it is generated by the Deployment. Have someone an answer?

  • SystemAdmin
    SystemAdmin
    11979 Posts
    ACCEPTED ANSWER

    Re: VapNumberToBooleanConverter returns java.lang.Short???

    ‏2003-09-05T16:43:00Z  in response to SystemAdmin
    I ended up writing my own converter using the built-in wizard. This solved a similar problem I had.