RE: Passing CF5 Structures to Java

2002-11-13 Thread Correa, Orlando (ITSC)
Thanks Pete!

For now... we were able to get away with using and passing an integer array.
We haven't upgraded to CFMX yet, but are looking forward to better CF/Java
integration.

As an interesting side note... we found that if we called our Java object
via a cfscript UDF call and looped over that... we ran into a huge
bottleneck with its performance...  however, calling the Java objects
outside of the UDF in a loop performed about 8 times faster in our simple
tests (~34 seconds to ~4 seconds).  I'm not sure what's really going there,
but thought someone out there might know...

Thanks again...

Orlando Correa
IHS/ITSC

-Original Message-
From: Pete Freitag [mailto:pf@;cfdev.com]
Sent: Wednesday, November 13, 2002 12:10 PM
To: CF-Talk
Subject: RE: Passing CF5 Structures to Java


I don't think you can do that in CF5, you should be able to get something
like that working in CFMX though. Structures in CF5 are in C++ memory land,
but in MX they are java objects, so you can pass them around to your own
stuff.

One workaround is to use WDDX, serialize the structure to WDDX, pass it as a
string, and then in the Java class convert the WDDX into a Hashtable.

Another workaround would be to create a UDF or something that converted a CF
structure into a Java Hashtable by looping through the structure. This would
probably perform better than the WDDX solution.

_
Pete Freitag
CTO, CFDEV.COM
http://www.cfdev.com/

-Original Message-
From: Correa, Orlando (ITSC) [mailto:Orlando.Correa@;mail.ihs.gov]
Sent: Wednesday, November 13, 2002 1:44 PM
To: CF-Talk
Subject: Passing CF5 Structures to Java


We are experiencing a problem while trying to pass a ColdFusion 5 structure
to a java class that was created using CreateObject. Our java code
conceptually looks something similar to:

public class javaTest {

  public static int testThis(Hashtable testVal) {

return 7;

  }

}

The call in Cold Fusion is like:






where CFstructure is a basic structure (key/value pair) with 2 elements.
We have also tried to cast the structure as a HashMap and an Object and get
the same error each time.

"Unknown exception during conversion of a CF type to a Java type"
Can anyone help us with this?

Thanks...
Anderson, Ryan R. (ITSC)

Also... we are using JRE 1.4.0 JVM


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm



RE: Passing CF5 Structures to Java

2002-11-13 Thread Pete Freitag
I don't think you can do that in CF5, you should be able to get something
like that working in CFMX though. Structures in CF5 are in C++ memory land,
but in MX they are java objects, so you can pass them around to your own
stuff.

One workaround is to use WDDX, serialize the structure to WDDX, pass it as a
string, and then in the Java class convert the WDDX into a Hashtable.

Another workaround would be to create a UDF or something that converted a CF
structure into a Java Hashtable by looping through the structure. This would
probably perform better than the WDDX solution.

_
Pete Freitag
CTO, CFDEV.COM
http://www.cfdev.com/

-Original Message-
From: Correa, Orlando (ITSC) [mailto:Orlando.Correa@;mail.ihs.gov]
Sent: Wednesday, November 13, 2002 1:44 PM
To: CF-Talk
Subject: Passing CF5 Structures to Java


We are experiencing a problem while trying to pass a ColdFusion 5 structure
to a java class that was created using CreateObject. Our java code
conceptually looks something similar to:

public class javaTest {

  public static int testThis(Hashtable testVal) {

return 7;

  }

}

The call in Cold Fusion is like:






where CFstructure is a basic structure (key/value pair) with 2 elements.
We have also tried to cast the structure as a HashMap and an Object and get
the same error each time.

"Unknown exception during conversion of a CF type to a Java type"
Can anyone help us with this?

Thanks...
Anderson, Ryan R. (ITSC)

Also... we are using JRE 1.4.0 JVM

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm