For Programmers: Free Programming Magazines  


Home > Archive > Java Beans > October 2004 > Java data types (Classes) in multiple beans and ActiveX bean bridge









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Java data types (Classes) in multiple beans and ActiveX bean bridge
EPfromPPT

2004-10-29, 3:57 pm

I have 2 separate JavaBeans that I have written. They are in separate
packages and archived into separate JAR files. Both beans have a
property that is of a type (lets call it "TheClass") that is defined
in another package (lets call it "thepackage") that both beans import.

If I instantiate an instance of each of these 2 beans in something
like the Java Beanbox, I am able to get the "TheClass" property from
one of the beans and set it to the other bean with no problems.

I used the ActiveX Bridge packager from the 1.4.2 SDK to wrap each of
these beans into something that I can drop onto a Visual Basic form.
If I get the property and assign it to a Variant variable, I can set
it back to the bean that I got it from, but not the other bean. When I
try to set this property to the other bean I get:

java.lang.IllegalArgumentException: thepackage.TheClass cannot be
converted to type: {0}thepackage.TheClass
at sun.plugin.com.TypeConverter.convertObject(Unknown Source)
at sun.plugin.com.TypeConverter.convertObjectArray(Unknown Source)
at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
at sun.plugin.com.BeanDispatchImpl.invoke(Unknown Source)

It appears that now the ActiveX wrapped bean1's thepackage.TheClass
and the ActiveX wrapped bean2's thepackage.TheClass are 2 completely
different types.
Does anybody know why?
Is there a work around for this?
What does the packager do to create that DLL that it creates?
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com