JAVA/.NET INTEROPERABILTY

Last post 11-02-2005 4:23 PM by daddyam. 5 replies.

Sort Posts:

  • JAVA/.NET INTEROPERABILTY

    11-20-2002, 4:33 PM
    • Member
      5 point Member
    • Hsmith609b
    • Member since 11-20-2002, 4:00 PM
    • New Jersey - USA
    • Posts 1
    This is not a migration question but ......

    I need to access a third party java class library from a VB .NET application, any ideas?

    I have thought about writing a java web services and expose the results as XML and have seen third party tools that bridge the two environments, but I would perfer to talk to the class library directly.

    Thanks in advance.

    Harvey.
  • Re: JAVA/.NET INTEROPERABILTY

    03-01-2003, 5:07 PM
    I guess it depends somewhat on the functionality of the class library, and how easy it is to interoperate with it from another language. Java classes can be COM registered with JavaReg on windows servers which mean you could use COM Interop to get access to it from within VB.NET.

    I haven't done since .NET was in alpha, so you will need to try it and see if it still works.....

    If you have a Java class file containing a public method called SayHello() fro example....compile it using javac as normal.

    import java.io.*;

    public class javaNet{

    public String SayHello()
    String ret = "Hello from Java in .NET";
    return ret;
    }

    }

    Take the class and put it in winnt/java/trustlib. run regsvr32 against it to
    create a registration entry for the class using this line of code - you
    obviously need regsvr32 from ms to do this.

    javareg /register /class:javaNet /progid:javaNet

    Then simply call it as you would any latebound COM object.

    <%@ Page Language="VB" ClientTarget="downlevel" %>
    <%@ Import NameSpace="System.Web.Util" %>
    <%
    Dim XYZ As Object
    XYZ = Server.CreateObject("JavaNet")
    Response.Write (XYZ.SayHello())
    %>

    You might need to add trustlib to your classpath.

    You can find this example, and a copy of JavaReg if I remember correctly at the Wrox press site, as this was covered in Professional JSP release 2
    http://www.wrox.com/dynamic/books/download.aspx?isbn=1861004958&email=

    It is being decommisioned by MS as Sun (in their wisdom) appear to have messed up somewhat with their lawsuit of MS and shot themselves in the foot as MS have dropped all Java support - including Javareg and the SDK it used to come in.

    I would suspect that in the release version of .net that this approach of JavaReg might not work without using RegaAsm and creating a TLB wrapper for your component, then sticking it in the GAC.

    So, coming back to your intial thoughts - you may save yourself a lot of work by using a bridge after all, or decompiling the class, and using the Java converion assistant at http://msdn.microsoft.com/vstudio/downloads/tools/jlca/default.asp to convert the code in the class you have acquired to C#.

    If it was me, I would run a version of Tomcat alongside IIS, and get the webservice working instead, but I guess it depends on how much work there is to do.

    Regards

    John Timney (Microsoft ASP.NET MVP)



  • Re: JAVA/.NET INTEROPERABILTY

    03-12-2003, 5:48 PM
    Hi Harvey,

    Did you have a look to tools such as Ja.NET from Intrinsync or JNBridge ?

    Regards,
    Christophe Lauer - http://www.dotnet-fr.org

  • Re: JAVA/.NET INTEROPERABILTY

    03-17-2003, 4:53 AM
    Hi all,

    Found another interresting Open Source project. Not finished but yet very promising: RemotingDotCorba, a Corba/IIOP remoting channel for .NET.

    Early tests wih TAO sound promising, though much remains to implement, and much of the Corba services and typs won't be supported.

    Have a look here :
    http://kristopherjohnson.net/cgi-bin/twiki/view/KJ/RemotingDotCorba

    For those who can read French, of those who can deal with automatic translators a la Altavista, have a look at this article :
    http://www.dotnetguru.org/articles/articlets/iiopchannel/iiopremoting.htm (in French)

    Regards,
    Christophe Lauer - http://www.dotnet-fr.org

  • Re: JAVA/.NET INTEROPERABILTY

    01-26-2004, 3:28 AM
    The projects:

    IIOP.NET

    and

    Borland's Janeva

    are object bridges between J2EE/J2SE and .NET. The WS route will be the easiest but
    this OO route will be the most efficient.


  • Re: JAVA/.NET INTEROPERABILTY

    11-02-2005, 4:23 PM
    • Member
      5 point Member
    • daddyam
    • Member since 11-02-2005, 5:17 PM
    • Posts 1
    IIOP.NET is an open source product that seems to have become stale, its also very slow as its has to translate the .NET remoting calls to CORBA calls.

    Borlands Janeva is very good but also very expensive as its from Borland.

    There is another cheaper alternative which is on par with performance/if not better than Janeva and thats is J-Integra Espresso.
    http://j-integra.intrinsyc.com

    This product provides .NET/ASP access to J2EE and Corba objects.

    This is from the same guys who created J-Integra for .NET.

    Cheers,


Page 1 of 1 (6 items)