From: Dahiya, K. (GE H. consultant) <Kir...@ge...> - 2007-09-12 14:00:46
|
Hi, =20 I have an issue regarding passing of very large strings across TAO and openORB1.4.0. i tried it as: server =3D TAO client =3D openORB1.4.0=20 =20 ACE version is 5.2a_p9-OCI (OCI's Distribution of TAO) TAO version 1.2a_p9-OCI (OCI's Distribution of TAO =20 .idl file is: =20 test.idl: =20 interface test { void fun(inout string x); }; CLIENT CODE: =20 client.java: =20 import java.io.*; import org.omg.CORBA.*; import java.lang.*; import java.util.*; import java.text.*; public class client { public static void main(String args[]) { try { org.omg.CORBA.ORB orb =3D org.omg.CORBA.ORB.init (args, null); FileReader file =3D new FileReader("/homes/lf502787/string_1/generated/testServer.ior"); BufferedReader in =3Dnew BufferedReader(file); String obj =3D in.readLine(); //obj=3D(String)file.read (); org.omg.CORBA.Object strobj =3D orb.string_to_object(obj ); test testobj =3D testHelper.narrow( strobj ); java.lang.String in_str ; =20 char[] temp =3D new char[150000]; for(int i=3D0;i<150000;i++) { temp[i] =3D 'a'; } =20 in_str =3D new String(temp); org.omg.CORBA.StringHolder inout_str =3D new org.omg.CORBA.StringHolder(); // java.lang.String ret_str; inout_str.value =3D in_str; System.out.println("LENGTH OF INOUT STRING AT CLIENT(before sending) "+ in_str.length()); testobj.fun(inout_str); String temp_str =3D new String(); temp_str =3D inout_str.value ; System.out.println("LENGTH OF INOUT STRING RETURNED FROM SERVER(after calling) "+ temp_str.length()); =20 // System.out.println("LENGTH OF STRING RETURNED FROM SERVER "+ ret_str.length()); =20 } catch(Exception e) { e.printStackTrace(); } } } =20 =20 SERVER CODE: =20 server.cpp =20 #include <iostream> #include <fstream> #include "testS.h" //#include "testS.i" =20 using namespace std; =20 class test_Impl : virtual public POA_test { public: =20 void fun(char* & s_inout) throw(CORBA::SystemException) { =20 cout<<"length of string received as inout parameter from server(before modification) "<< strlen(s_inout)<<"\n"; char temp[2000005]; for(int i =3D 0;i<2000005;i++) { temp[i] =3D 'a'; } s_inout =3D CORBA::string_dup(temp); =20 cout<<"length of out parameter at server "<<strlen(s_inout)<<"\n"; =20 } }; =20 int main(int argc, char *argv[]) { CORBA::ORB_var orb =3D CORBA::ORB_init(argc,argv); =20 CORBA::Object_var poaobj =3D orb->resolve_initial_references("RootPOA"); =20 PortableServer::POA_var poa =3D PortableServer::POA::_narrow(poaobj); =20 PortableServer::POAManager_var mgr =3D poa->the_POAManager(); =20 test_Impl *test_servant =3D new test_Impl(); =20 CORBA::Object_var objv =3D test_servant->_this(); =20 CORBA::String_var ior =3D orb->object_to_string(objv); =20 ofstream of; =20 of.open("/homes/lf502787/string_1/generated/testServer.ior"); =20 of<<ior; of.close(); =20 mgr->activate(); =20 orb->run(); =20 return 0; } OPERATING SYSTEM: Linux =20 =20 PROBLEM DESCRIPTION: =20 Compilation problem: NO =20 Linking Problem : NO =20 While Execution: =20 1. When the client is sending string of length 150000 to the server,then it is giving an error as: =20 org.omg.CORBA.TRANSIENT: vmcid: 0x0 minor code: 2 completed: No at org.openorb.orb.core.Delegate$RequestState.findNextBinding(Delegate.java :2258) at org.openorb.orb.core.Delegate$RequestState.failoverFatal(Delegate.java:2 337) at org.openorb.orb.core.Delegate$RequestState.receiveSystemException(Delega te.java:2395) at org.openorb.orb.core.Delegate$RequestState.access$000(Delegate.java:1583 ) at org.openorb.orb.core.Delegate.invoke(Delegate.java:1100) at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457) at _testStub.fun(_testStub.java:35) at client.main(client.java:32) Caused by: org.omg.CORBA.COMM_FAILURE: IOException while reading from input stream (java.net.SocketException: Connection reset) vmcid: 0x444f7000 minor code: 268 completed: No at org.openorb.orb.iiop.IIOPTransport.readMagic(IIOPTransport.java:572) at org.openorb.orb.iiop.IIOPTransport.recvMessage(IIOPTransport.java:427) at org.openorb.orb.iiop.SocketQueue.process_or_enqueue(SocketQueue.java:265 ) at org.openorb.orb.iiop.SocketQueue.receive(SocketQueue.java:211) at org.openorb.orb.iiop.IIOPClientChannel.run_recv(IIOPClientChannel.java:1 337) at org.openorb.orb.net.ClientManagerImpl$ChannelRecvRunnable.run(ClientMana gerImpl.java:264) at java.lang.Thread.run(Thread.java:595) Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read1(BufferedInputStream.java:256) at java.io.BufferedInputStream.read(BufferedInputStream.java:313) at org.openorb.orb.iiop.IIOPTransport.readMagic(IIOPTransport.java:491) ... 6 more 2. When client is sending string of length 200000(or more) to the server,then the system is getting hanged. =20 SELF-EFFORTS: =20 I reffered to the already posted maills on openORB Community. =20 Reffered mail is present at: =20 http://sourceforge.net/mailarchive/forum.php?thread_name=3D001401c5beb1%2= 4 b5ef60e0%24140000c0%40W158&forum_name=3Dopenorb-users <BLOCKED::BLOCKED::http://sourceforge.net/mailarchive/forum.php?thread_n ame=3D001401c5beb1$b5ef60e0$140000c0@W158&forum_name=3Dopenorb-users>=20 =20 =20 COMMANDS USED: =20 =20 FOR SERVER: =20 COMPILING THE .idl FILE: /vobs/atlas-tools/tao12a/ACE_wrappers/bin/debug/linux/gcc332/tao_idl -g /vobs/atlas-tools/tao12a/ACE_wrappers/bin/debug/linux/gcc332/gperf test.idl COMPILING THE .cpp FILES: gcc -c -I/vobs/atlas-tools/tao12a/ACE_wrappers/TAO -I/vobs/atlas-tools/tao12a/ACE_wrappers -L/vobs/atlas-tools/tao12a/ACE_wrappers/bin/debug/linux/gcc332 -lTAO -lACE -lTAO_PortableServer server.cpp LINKING FILES: gcc -I/vobs/atlas-tools/tao12a/ACE_wrappers/TAO -I/vobs/atlas-tools/tao12a/ACE_wrappers -L/vobs/atlas-tools/tao12a/ACE_wrappers/bin/debug/linux/gcc332 -lTAO -lACE -lTAO_PortableServer -o server server.o testS.o testC.o =20 EXECUTION OF SERVER: ./server & =20 =20 FOR CLIENT: =20 COMPILATION=20 =20 /usr/java/jdk1.5.0_06/bin/javac -classpath /homes/lf502787/OpenORB_generated/openorb_orb-1.4.0.jar:/homes/lf502787/ OpenORB_generated/openorb_orb_tools-1.4.0.jar:/homes/lf502787/OpenORB_ge nerated/openorb_orb_examples-1.4.0.jar:/homes/lf502787/OpenORB_generated /openorb_orb_test-1.4.0.jar:/homes/lf502787/OpenORB_generated/xercesImpl .jar:/homes/lf502787/OpenORB_generated/logkit.jar:/homes/lf502787/OpenOR B_generated/junit.jar:/homes/lf502787/OpenORB_generated/excalibur-config uration.jar:/homes/lf502787/OpenORB_generated/avalon-framework.jar:/home s/lf502787/OpenORB_generated/tools-1.4.0.jar:/homes/lf502787/OpenORB_gen erated/openorb_orb-classes-1.4.0.jar:/homes/lf502787/OpenORB_generated/o penorb_orb-config-1.4.0.jar:/homes/lf502787/OpenORB_generated/openorb_or b_omg-1.4.0.jar:/homes/lf502787/OpenORB_generated/launcher.jar:/homes/lf 502787/OpenORB_generated/build.jar:/homes/lf502787/OpenORB_generated/ope norb_native.jar:/homes/lf502787/OpenORB_generated/tools_test-1.4.0.jar:/ homes/lf502787/OpenORB_generated/commons-cli.jar:/homes/lf502787/OpenORB _generated/hsqldb.jar:/homes/lf502787/OpenORB_generated/xml-apis.jar:/ho mes/lf502787/OpenORB_generated/ant.jar:/homes/lf502787/OpenORB_generated /ant-launcher.jar:/homes/lf502787/OpenORB_generated/batik.jar:/homes/lf5 02787/OpenORB_generated/checkstyle-all.jar:/homes/lf502787/OpenORB_gener ated/fop.jar:/homes/lf502787/OpenORB_generated/jfor.jar:/homes/lf502787/ OpenORB_generated/jimi.jar:/homes/lf502787/OpenORB_generated/xalan.jar:. client.java =20 EXECUTION=20 =20 =20 =20 /usr/java/jdk1.5.0_06/bin/java -classpath /homes/lf502787/OpenORB_generated/openorb_orb-1.4.0.jar:/homes/lf502787/ OpenORB_generated/openorb_orb_tools-1.4.0.jar:/homes/lf502787/OpenORB_ge nerated/openorb_orb_examples-1.4.0.jar:/homes/lf502787/OpenORB_generated /openorb_orb_test-1.4.0.jar:/homes/lf502787/OpenORB_generated/xercesImpl .jar:/homes/lf502787/OpenORB_generated/logkit.jar:/homes/lf502787/OpenOR B_generated/junit.jar:/homes/lf502787/OpenORB_generated/excalibur-config uration.jar:/homes/lf502787/OpenORB_generated/avalon-framework.jar:/home s/lf502787/OpenORB_generated/tools-1.4.0.jar:/homes/lf502787/OpenORB_gen erated/openorb_orb-classes-1.4.0.jar:/homes/lf502787/OpenORB_generated/o penorb_orb-config-1.4.0.jar:/homes/lf502787/OpenORB_generated/openorb_or b_omg-1.4.0.jar:/homes/lf502787/OpenORB_generated/launcher.jar:/homes/lf 502787/OpenORB_generated/build.jar:/homes/lf502787/OpenORB_generated/ope norb_native.jar:/homes/lf502787/OpenORB_generated/tools_test-1.4.0.jar:/ homes/lf502787/OpenORB_generated/commons-cli.jar:/homes/lf502787/OpenORB _generated/hsqldb.jar:/homes/lf502787/OpenORB_generated/xml-apis.jar:/ho mes/lf502787/OpenORB_generated/ant.jar:/homes/lf502787/OpenORB_generated /ant-launcher.jar:/homes/lf502787/OpenORB_generated/batik.jar:/homes/lf5 02787/OpenORB_generated/checkstyle-all.jar:/homes/lf502787/OpenORB_gener ated/fop.jar:/homes/lf502787/OpenORB_generated/jfor.jar:/homes/lf502787/ OpenORB_generated/jimi.jar:/homes/lf502787/OpenORB_generated/xalan.jar:. -Dorg.omg.CORBA.ORBClass=3Dorg.openorb.orb.core.ORB -Dorg.omg.CORBA.ORBSingletonClass=3Dorg.openorb.CORBA.ORBSingleton = client =20 Concerned replies are sincerely awaited & are requested to be sent at this email id only. =20 Regards =20 Ms. Kiran Dahiya GE Healthcare =20 |