----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: GauravK_MS Message 2 in Discussion Hi! The April MSDN Session demonstrated this, where I showed how a .NET App consumed a Java class. This was exemplified using Ja.NET from http://j-integra.intrinsyc.com/ja.net/download/. Cheers! Gaurav Khanna ------------------------------------------------------------------------ I can't be garbage collected; I am pinned to .NET ------------------------------------------------------------------------ Developer Evangelist Microsoft Corporation India Private Limited 23, Prestige Takt, Kasturba Road, Bangalore - 560001 India Tel: 91-80-22121212 Ext - 695 Cell: 91-98861-88022 From: bsunil_net [mailto:[EMAIL PROTECTED] Sent: Thursday, May 06, 2004 5:51 PM To: BDOTNET Subject: Calling Java program form .net New Message on BDOTNET Calling Java program form .net Reply Reply to Sender Recommend Message 1 in Discussion From: bsunil_net Hi, Good evening.I have a query i.e how to call Java program from .net.So i searched in google and found JNbridge.I downloaded jnbridge software and tried to do some small experiment.But unfortunately i face few problems. I have created a windows form with 3 text boxes and one button.First two textboxes to enter some numbers when you click the button it has sum both and put into the third textbox Ex: First N0:12 Second No:13 Result :25 Submit // this button To add i written add method in java i want to call the same.This is my requirement. when i click button i used the following code int n1,n2,result; Addjava a = new AddJava(); n1 = Int32.Parse(textBox1.Text); n2 = Int32.Parse(textBox2.Text); result = a.add(n1,n2); textBox3.Text = result.ToString(); Java file will be public class AddJava { public int add(int a ,int b) { int result; result = a+ b; return result; } } First i compiled java file.Using jnbridge i created the dll and added the references to the project AddJava.dll.It asked one more dll to add i.e JNBShare.dll i have added the same. Compilation went through fine but failing in execution. To do this program Remoting is essential ? If yes than why ? The sample example they are using remoting so i copied all the files to the related directories and executed.I am facing the following error when i create a object of java class. creating binary server A communications error was encountered. If this error persists, please contact [EMAIL PROTECTED] java.net.SocketException: Connection reset by peer: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(Unknown Source) at java.net.SocketOutputStream.write(Unknown Source) at java.io.BufferedOutputStream.flushBuffer(Unknown Source) at java.io.BufferedOutputStream.flush(Unknown Source) at com.jnbridge.jnbcore.c.b.g.a(Unknown Source) at com.jnbridge.jnbcore.c.b.h.goto(Unknown Source) at com.jnbridge.jnbcore.c.b.h.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Can anybody faced this problem before ? If yes provide me your suggestion else give some URLs where i can get good example about communication from .net to java and vice versa. Regards, Sunil View other groups in this category. ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/bdotnet/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
