Sun JDK 1.3.1 calling a Microsoft COM object?

My question, which inevitably in my eyes has been deemed impossible to answer, is as follows: How can one incorporate MS VM to connect to an MS COM object using Suns JDK 1.3.1?

I ve tried the following: I ran the simple example of a COM object with a client interfacing with that COM object that came with MS SDK for Java 4.0. I built the *java files using the given makefile (jvc). I registered the Hub with javareg and created a hub.tlb with jactivex.

Using JBuilder 4.0, I built a small non-swing object that created in instance of the Client class from above:

import sample.dcom.*;

public class Main

{

public Main()

{

try

{

// MS Client the Client class creates the COM object connection to HUB

Client client = new Client();

}

catch( Exception exception )

{

System.err.println("Default exception caught");

System.err.println(exception);

exception.printStackTrace();

}

}

}

I was able to compile/make the above snippet of code, but without having access to the com.ms* classes and without loading a library (since the Hub class actually references a native function), I was not able to run my application:

java.lang.UnsatisfiedLinkError: addListener

at hub.Hub.addListener(Native Method)

at sample.dcom.Client.<init>(Client.java)

at am.temp.Main.<init>(Main.java:30)

at am.temp.Main.main(Main.java:44)

However, if run the following command: jview Main, I get the necessary results. Which is what I thought would happen. I tried doing the same thing within a swing application, however, to my not-so-surprise, MS doesnt contain swing components. I ve read through many forum headaches: I ve tried appending rt.jar, You cant mix MS with Sun , etc.

Therefore, has anyone had any luck creating/connecting/instantiating a MS COM object while trying to run it under Suns VM? Note: I have to do it this way since the application I m trying to connect to is built as a COM server and Im using Java as my application language.

Thank you.

[2141 byte] By [DarrickWhite] at [2007-9-26 11:53:02]
# 1

gui != COM.

In other words COM objects are not limited to GUI objects. From your question it looks like you have a COM object which is a gui component. And you want to use it in swing. If it is just a fancy drop down box then I would say the complexity isn't worth it. If it does more, then I believe that people have put 'windows' into swing frames. You can search this forum or perhaps the "Advanced Programming" (or even all forums) for more discussion on that.

jschell at 2007-7-2 2:09:43 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
There is no need to respond if you are just advising to search in other places!
phobe at 2007-7-2 2:09:43 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3
phobe said>....Please don't respond to old threads. Either the poster found a solution or no longer cares. And those of us who answer a lot of messages every day must then spend time reading something which no longer matters.
jschell at 2007-7-2 2:09:43 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4

have you tried your code under ms vm?

hint: The Microsoft SDK for Java 4.0 is the developer kit for the Microsoft Internet Explorer environment. Tools, information, and samples are provided to help you develop Java programs and applets based on JDK 1.1.4 and the Microsoft virtual machine (Microsoft VM) optimized for the Microsoft Win32 API.

fmxu at 2007-7-2 2:09:44 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 5
fmxu said >have you tried your code under ms vm?I thought the original post was fairly specific ...one incorporate MS VM to connect to an MS COM object using Suns JDK 1.3.1? [i/]It does say 1.3.1.
jschell at 2007-7-2 2:09:44 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 6
actually i should've said it won't work outside of ms vm.
fmxu at 2007-7-2 2:09:44 > top of Java-index,Java HotSpot Virtual Machine,Specifications...