Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_java thread: COM and Java Integration


Message #1 by "Christian Rodriguez" <crodrig70@e...> on Thu, 22 Feb 2001 20:56:12
Hello, 

Im using a 3rd party COM object that verifies an address in the US. I want 
to use Java code with this object. 

So far I used jactivex and the classes show up on the winnt/addrobj 
directory. 

Then I use the following Java code that generates an error:

import addrobj.*;

public class testobj
{
    public static void main(String[] args) throws UnsatisfiedLinkError
    {
        try
        {
        System.out.println("Hey!");
        System.out.println("About to start");
        IAddressCheck iadd = (IAddressCheck) new AddressCheck();

        System.out.println("After new");
        String aCity = "San Francisco";
        iadd.setCity(aCity);
        System.out.println("After assign");
        // iadd.setCity(aCity);
        // System.out.println("City: " + iadd.getCity());
        }
        catch (Exception e)
        {
           System.out.println(e.getMessage());
           e.printStackTrace();
        }
    }
}

The error is UnsatisfiedLinkError, and it happens when I try to use the 
setCity method (that appears in the class that jactivex generated). I have 
no idea what I am doing wrong. 

About the COM object: it has properties for 'street', 'city', 'zip', etc 
and then a 'VerifyAddress' method that checks that that address is correct 
in the US. I have verificed the version of the Microsoft Java Compiler and 
that doesnt seem to be the problem...

Any experts in Java/COM integration? 

I am not interested at all in writing a COM server using Java, just 
interested in using this COM server calling it with Java code.

Please let me know!!! 

Christian

  Return to Index