RESOLVED: Unexpected Java Interop Behaviour with TIBCO HAWK libraries - Constructor Call Failure

HI everyone,

I’ve been using Kotlin to garner access to some third-party JVM libraries to a commercial product called Hawk written by TIBCO. When using version 1.0.0-beta-1038, I was able to call a desired constructor but in version 1.0.0-beta-2423 I wasn’t able to call the same constructor until I fully qualified the constructor call.

Here’s a minimal working example in version 1.0.0-beta-1038:

kewoo@AUD31304KZ c:\u\kotlin-compiler-1.0.0-beta-1038\kotlinc
$ set HL=c:\tibco\hawk\4.9\lib
kewoo@AUD31304KZ c:\u\kotlin-compiler-1.0.0-beta-1038\kotlinc
$ java -Xmx256M -Xms32M -noverify  -cp lib\kotlin-preloader.jar org.jetbrains.kotlin.preloading.Preloader -cp lib\kotlin-compiler.jar org.jetbrains.kotlin.cli.jvm.K2JVMCompiler -cp lib\kotlin-reflect.jar;%HL%\console.jar;%HL%\talon.jar
Welcome to Kotlin version 1.0.0-beta-1038 (JRE 1.7.0_07-b10)
Type :help for help, :quit for quit
>>> import COM.TIBCO.hawk.console.hawkeye.TIBHawkConsole
>>> var _console = COM.TIBCO.hawk.console.hawkeye.TIBHawkConsole("QSLTIBPR", "tcp://clsemsapppr01:9220", "admin", "__redacted_password__", 1)
>>> :quit

However, when I try what I think is the same thing in <<>>, this is what I get:

kewoo@AUD31304KZ C:\u\kotlin-compiler-1.0.0-beta-2423\kotlinc
$ java -Xmx256M -Xms32M -noverify  -cp lib\kotlin-preloader.jar org.jetbrains.kotlin.preloading.Preloader -cp lib\kotlin-compiler.jar org.jetbrains.kotlin.cli.jvm.K2JVMCompiler -cp lib\kotlin-reflect.jar;%HL%\console.jar;%HL%\talon.jar
Welcome to Kotlin version 1.0.0-beta-2423 (JRE 1.7.0_07-b10)
Type :help for help, :quit for quit
>>> var _console = TIBHawkConsole("QSLTIBPR", "tcp://clsemsapppr01:9220", "admin", "__redacted_password__", 1)
error: unresolved reference: TIBHawkConsole
var _console = TIBHawkConsole("QSLTIBPR", "tcp://clsemsapppr01:9220", "admin", "__redacted_password__", 1)
           ^

>>> var _console = COM.TIBCO.hawk.console.hawkeye.TIBHawkConsole("QSLTIBPR", "tcp://clsemsapppr01:9220", "admin", "__redacted_password__", 1)
>>> :quit

Has anyone seen a similar issue? I’ve looked at this issue for a couple of days but have failed to see what I’ve done wrong. Anyone got suggestions as to what I’ve done wrong?

I’d like to attach the JAR files for verification but I don’t have permission to do so. However, I’m willing to try different suggestions that may lead to an explanation of what I’m seeing. Any ideas and feedback will appreciated. I also failed to find similar symptoms, so if this has been previously reported then let me know where I can find out more.

Regards,

Kevin

Your first example has an “import” command, while your second example doesn’t. Is this intentional? Does the problem go away if you add an import to your second example?

Hi abreslav,

I feel totally foolish! The missing ‘import’ statement made the difference. Thanks for your gracious response.

Regards,

Kevin

I’ve found what I think is a different error, but I noticed Beta 3 has come out recently so I’ll see if I can replicate what I see in Beta 3 first. Please close this ticket and mark it as Problem Between Keyboard and Chair.

Regards,

Kevin