nikki_agarwal
asked on
Linux and Corba
Hi
Hey I am again stuck in corba world
I do have
1. Jdk 1.2.2 for linux
I developed a small application on windows platform and i am porting on linux. but when i want to run server named HelloServer by command java HelloServer -ORBInitialPort 1050 it raises exception omg/orb/CORBA/ORB class not found. Do i need to install some packages may be jar file to get this program run please help
thanks
Hey I am again stuck in corba world
I do have
1. Jdk 1.2.2 for linux
I developed a small application on windows platform and i am porting on linux. but when i want to run server named HelloServer by command java HelloServer -ORBInitialPort 1050 it raises exception omg/orb/CORBA/ORB class not found. Do i need to install some packages may be jar file to get this program run please help
thanks
ASKER
hey there was some problem with the classpath and that is done but again i am in differnt mode. When i tested this program on windows it is working fine
but on linux it is initializing orb correctly
code is something like this
org.omg.CORBA.Object objRef = orb.resolve_initial_refere nces("Name Service");
NamingContext ncRef = NamingContextHelper.narrow (objRef);
NamingContext ncRef1 = NamingContextHelper.narrow (objRef);
NameComponent nc = new NameComponent("Hello","");
NameComponent nc1 = new NameComponent("Bye","");
NameComponent path[] = {nc};
NameComponent path1[] = {nc1};
till here it is working fine but this line is giving error
Hello helloRef = HelloHelper.narrow(ncRef.r esolve(pat h));
is there some problem with the idl mapping on windows and linux
thanx
but on linux it is initializing orb correctly
code is something like this
org.omg.CORBA.Object objRef = orb.resolve_initial_refere
NamingContext ncRef = NamingContextHelper.narrow
NamingContext ncRef1 = NamingContextHelper.narrow
NameComponent nc = new NameComponent("Hello","");
NameComponent nc1 = new NameComponent("Bye","");
NameComponent path[] = {nc};
NameComponent path1[] = {nc1};
till here it is working fine but this line is giving error
Hello helloRef = HelloHelper.narrow(ncRef.r
is there some problem with the idl mapping on windows and linux
thanx
Hi, nikki_agarwal. It`s to configure your java 1.2 environment in Unix (C Shell). Try it:
setenv CLASSPATH .:jdk1.2.2/jre/lib/rt.jar: $CLASSPATH
To make this setting permenent, you'd typically put this statement in your ".cshrc" file.
Bye... :)
setenv CLASSPATH .:jdk1.2.2/jre/lib/rt.jar:
To make this setting permenent, you'd typically put this statement in your ".cshrc" file.
Bye... :)
What does it mean "not working fine"?
Exception? may be the ncRef is null? This means the Naming context hasn't been found correctly.
Did you specify on which machine the Naming service is?
org.omg.CORBA.Object objRef = orb.resolve_initial_refere nces("Name Service");
Check it for null.
Cheers,
Nik
Exception? may be the ncRef is null? This means the Naming context hasn't been found correctly.
Did you specify on which machine the Naming service is?
org.omg.CORBA.Object objRef = orb.resolve_initial_refere
Check it for null.
Cheers,
Nik
ASKER
hey there was some problem with the classpath and that is done but again i am in differnt mode. When i tested this program on windows it is working fine
but on linux it is initializing orb correctly
code is something like this
org.omg.CORBA.Object objRef = orb.resolve_initial_refere nces("Name Service");
NamingContext ncRef = NamingContextHelper.narrow (objRef);
NamingContext ncRef1 = NamingContextHelper.narrow (objRef);
NameComponent nc = new NameComponent("Hello","");
NameComponent nc1 = new NameComponent("Bye","");
NameComponent path[] = {nc};
NameComponent path1[] = {nc1};
till here it is working fine but this line is giving error
Hello helloRef = HelloHelper.narrow(ncRef.r esolve(pat h));
is there some problem with the idl mapping on windows and linux
thanx
but on linux it is initializing orb correctly
code is something like this
org.omg.CORBA.Object objRef = orb.resolve_initial_refere
NamingContext ncRef = NamingContextHelper.narrow
NamingContext ncRef1 = NamingContextHelper.narrow
NameComponent nc = new NameComponent("Hello","");
NameComponent nc1 = new NameComponent("Bye","");
NameComponent path[] = {nc};
NameComponent path1[] = {nc1};
till here it is working fine but this line is giving error
Hello helloRef = HelloHelper.narrow(ncRef.r
is there some problem with the idl mapping on windows and linux
thanx
Post the stack trace in case of exception.
Nik
Nik
Check:
1.- Check that your pc have its corresponding ip address.
2.- U have installed TCP/IP protocol (needed by CORBA IIOP).
3.- Your server starts ok (not your nemeserver), and it runs the name component "Hello".
1.- Check that your pc have its corresponding ip address.
2.- U have installed TCP/IP protocol (needed by CORBA IIOP).
3.- Your server starts ok (not your nemeserver), and it runs the name component "Hello".
ASKER
hey it is giving org.omg.CORBA.COMM_FAILURE minor code: 1 comp
error
i am giving you full code including displaying the text in a textbox.
it displays till
before calling hellohelper.narrow
but narrow function fails i guess
code is
import HelloApp.*;
import java.applet.*;
import java.awt.*;
import org.omg.CosNaming.*;
import org.omg.CORBA.*;
import java.util.*;
import java.awt.event.*;
public class HelloApplet extends Applet
{
Button bDisp;
TextArea txterror = new TextArea();
Button bInit = new Button("Init ORB");
String args[] = new String[4];
class ButtonAction implements ActionListener
{
public void actionPerformed(ActionEven t e)
{
try
{
args[0] = new String("-ORBInitialPort");
args[1] = new String("1050");
args[2] = new String("-ORBInitialHost");
args[3] = new String("10.0.0.185");
java.util.Properties prop = new java.util.Properties();
prop.put("org.omg.CORBA.OR BClass","c om.sun.COR BA.iiop.OR B");
prop.put("org.omg.CORBA.OR BInitialHo st","10.0. 0.185");
prop.put("org.omg.CORBA.OR BInitialPo rt","1050" );
txterror.setText(args[0] + args[1] + args[2] + args[3]);
ORB orb = ORB.init(args,null);
txterror.setText(" before resolve");
org.omg.CORBA.Object objRef = orb.resolve_initial_refere nces("Name Service");
txterror.setText(" after resolve");
NamingContext ncRef = NamingContextHelper.narrow (objRef);
txterror.setText(" after naming context");
NamingContext ncRef1 = NamingContextHelper.narrow (objRef);
NameComponent nc = new NameComponent("Hello","");
txterror.setText(" after name compnent");
NameComponent nc1 = new NameComponent("Bye","");
NameComponent path[] = {nc};
txterror.setText(" after namepATH");
NameComponent path1[] = {nc1};
txterror.setText(" before calling hellohelper.narrow");
Hello helloRef = HelloHelper.narrow(ncRef.r esolve(pat h));
txterror.setText(" after helper");
Bye byeRef = ByeHelper.narrow(ncRef1.re solve(path 1));
txterror.setText("after calling sayhello");
//bDisp = new Button(hello);
String hello = helloRef.sayHello();
txterror.setText(hello);
System.out.println(hello);
String abuse = helloRef.abuse();
System.out.println(abuse);
String dont = helloRef.dont("Why Abuse");
System.out.println(dont);
txterror.setText(" after narrow");
String bye = byeRef.sayBye();
txterror.setText(" " + bye);
}
catch(Exception ex)
{
ex.printStackTrace();
txterror.setText(" " + ex.toString());
}
}
}
public void init()
{
add(bInit);
add(txterror);
bInit.addActionListener(ne w ButtonAction());
}
}
bye
error
i am giving you full code including displaying the text in a textbox.
it displays till
before calling hellohelper.narrow
but narrow function fails i guess
code is
import HelloApp.*;
import java.applet.*;
import java.awt.*;
import org.omg.CosNaming.*;
import org.omg.CORBA.*;
import java.util.*;
import java.awt.event.*;
public class HelloApplet extends Applet
{
Button bDisp;
TextArea txterror = new TextArea();
Button bInit = new Button("Init ORB");
String args[] = new String[4];
class ButtonAction implements ActionListener
{
public void actionPerformed(ActionEven
{
try
{
args[0] = new String("-ORBInitialPort");
args[1] = new String("1050");
args[2] = new String("-ORBInitialHost");
args[3] = new String("10.0.0.185");
java.util.Properties prop = new java.util.Properties();
prop.put("org.omg.CORBA.OR
prop.put("org.omg.CORBA.OR
prop.put("org.omg.CORBA.OR
txterror.setText(args[0] + args[1] + args[2] + args[3]);
ORB orb = ORB.init(args,null);
txterror.setText(" before resolve");
org.omg.CORBA.Object objRef = orb.resolve_initial_refere
txterror.setText(" after resolve");
NamingContext ncRef = NamingContextHelper.narrow
txterror.setText(" after naming context");
NamingContext ncRef1 = NamingContextHelper.narrow
NameComponent nc = new NameComponent("Hello","");
txterror.setText(" after name compnent");
NameComponent nc1 = new NameComponent("Bye","");
NameComponent path[] = {nc};
txterror.setText(" after namepATH");
NameComponent path1[] = {nc1};
txterror.setText(" before calling hellohelper.narrow");
Hello helloRef = HelloHelper.narrow(ncRef.r
txterror.setText(" after helper");
Bye byeRef = ByeHelper.narrow(ncRef1.re
txterror.setText("after calling sayhello");
//bDisp = new Button(hello);
String hello = helloRef.sayHello();
txterror.setText(hello);
System.out.println(hello);
String abuse = helloRef.abuse();
System.out.println(abuse);
String dont = helloRef.dont("Why Abuse");
System.out.println(dont);
txterror.setText(" after narrow");
String bye = byeRef.sayBye();
txterror.setText(" " + bye);
}
catch(Exception ex)
{
ex.printStackTrace();
txterror.setText(" " + ex.toString());
}
}
}
public void init()
{
add(bInit);
add(txterror);
bInit.addActionListener(ne
}
}
bye
ASKER
hey it is giving org.omg.CORBA.COMM_FAILURE minor code: 1 comp
error
i am giving you full code including displaying the text in a textbox.
it displays till
before calling hellohelper.narrow
but narrow function fails i guess
code is
import HelloApp.*;
import java.applet.*;
import java.awt.*;
import org.omg.CosNaming.*;
import org.omg.CORBA.*;
import java.util.*;
import java.awt.event.*;
public class HelloApplet extends Applet
{
Button bDisp;
TextArea txterror = new TextArea();
Button bInit = new Button("Init ORB");
String args[] = new String[4];
class ButtonAction implements ActionListener
{
public void actionPerformed(ActionEven t e)
{
try
{
args[0] = new String("-ORBInitialPort");
args[1] = new String("1050");
args[2] = new String("-ORBInitialHost");
args[3] = new String("10.0.0.185");
java.util.Properties prop = new java.util.Properties();
prop.put("org.omg.CORBA.OR BClass","c om.sun.COR BA.iiop.OR B");
prop.put("org.omg.CORBA.OR BInitialHo st","10.0. 0.185");
prop.put("org.omg.CORBA.OR BInitialPo rt","1050" );
txterror.setText(args[0] + args[1] + args[2] + args[3]);
ORB orb = ORB.init(args,null);
txterror.setText(" before resolve");
org.omg.CORBA.Object objRef = orb.resolve_initial_refere nces("Name Service");
txterror.setText(" after resolve");
NamingContext ncRef = NamingContextHelper.narrow (objRef);
txterror.setText(" after naming context");
NamingContext ncRef1 = NamingContextHelper.narrow (objRef);
NameComponent nc = new NameComponent("Hello","");
txterror.setText(" after name compnent");
NameComponent nc1 = new NameComponent("Bye","");
NameComponent path[] = {nc};
txterror.setText(" after namepATH");
NameComponent path1[] = {nc1};
txterror.setText(" before calling hellohelper.narrow");
Hello helloRef = HelloHelper.narrow(ncRef.r esolve(pat h));
txterror.setText(" after helper");
Bye byeRef = ByeHelper.narrow(ncRef1.re solve(path 1));
txterror.setText("after calling sayhello");
//bDisp = new Button(hello);
String hello = helloRef.sayHello();
txterror.setText(hello);
System.out.println(hello);
String abuse = helloRef.abuse();
System.out.println(abuse);
String dont = helloRef.dont("Why Abuse");
System.out.println(dont);
txterror.setText(" after narrow");
String bye = byeRef.sayBye();
txterror.setText(" " + bye);
}
catch(Exception ex)
{
ex.printStackTrace();
txterror.setText(" " + ex.toString());
}
}
}
public void init()
{
add(bInit);
add(txterror);
bInit.addActionListener(ne w ButtonAction());
}
}
i guess it will help you in understanding the problem
bye
nikki
error
i am giving you full code including displaying the text in a textbox.
it displays till
before calling hellohelper.narrow
but narrow function fails i guess
code is
import HelloApp.*;
import java.applet.*;
import java.awt.*;
import org.omg.CosNaming.*;
import org.omg.CORBA.*;
import java.util.*;
import java.awt.event.*;
public class HelloApplet extends Applet
{
Button bDisp;
TextArea txterror = new TextArea();
Button bInit = new Button("Init ORB");
String args[] = new String[4];
class ButtonAction implements ActionListener
{
public void actionPerformed(ActionEven
{
try
{
args[0] = new String("-ORBInitialPort");
args[1] = new String("1050");
args[2] = new String("-ORBInitialHost");
args[3] = new String("10.0.0.185");
java.util.Properties prop = new java.util.Properties();
prop.put("org.omg.CORBA.OR
prop.put("org.omg.CORBA.OR
prop.put("org.omg.CORBA.OR
txterror.setText(args[0] + args[1] + args[2] + args[3]);
ORB orb = ORB.init(args,null);
txterror.setText(" before resolve");
org.omg.CORBA.Object objRef = orb.resolve_initial_refere
txterror.setText(" after resolve");
NamingContext ncRef = NamingContextHelper.narrow
txterror.setText(" after naming context");
NamingContext ncRef1 = NamingContextHelper.narrow
NameComponent nc = new NameComponent("Hello","");
txterror.setText(" after name compnent");
NameComponent nc1 = new NameComponent("Bye","");
NameComponent path[] = {nc};
txterror.setText(" after namepATH");
NameComponent path1[] = {nc1};
txterror.setText(" before calling hellohelper.narrow");
Hello helloRef = HelloHelper.narrow(ncRef.r
txterror.setText(" after helper");
Bye byeRef = ByeHelper.narrow(ncRef1.re
txterror.setText("after calling sayhello");
//bDisp = new Button(hello);
String hello = helloRef.sayHello();
txterror.setText(hello);
System.out.println(hello);
String abuse = helloRef.abuse();
System.out.println(abuse);
String dont = helloRef.dont("Why Abuse");
System.out.println(dont);
txterror.setText(" after narrow");
String bye = byeRef.sayBye();
txterror.setText(" " + bye);
}
catch(Exception ex)
{
ex.printStackTrace();
txterror.setText(" " + ex.toString());
}
}
}
public void init()
{
add(bInit);
add(txterror);
bInit.addActionListener(ne
}
}
i guess it will help you in understanding the problem
bye
nikki
ASKER
hey i am not doing anything with property so don't be confused by that
I see you yous an applet. You have to make sure that the naming server and the orb run on the same machine where the web server is running. Unsigned applet runs in the secure environment of the browser and is not allowed to communicate with hosts different than the host of origin. Thus opening a socket (the orb code does that) is restricted to certified applet code.
Cheers,
Nik
P.S. Note that my name is Nik, not hey.
Cheers,
Nik
P.S. Note that my name is Nik, not hey.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok Nik not hey(just kidding)
it is true that this is in applet but i am also trying from the application which runs on windows machine and tnameserv and server runs on linux.
every things work fine if i port this application on windows NT(server and tnameserv) but not on linux
it prints the error on console like this
org.omg.CORBA.COMM_FAILURE : minor code: 1 completed: No at com.sun.CORBA.iiop.Connect ionTable.g et(Unknown Source) at com.sun.CORBA.iiop.GIOPImp l.createRe quest(Unkn own Source) at com.sun.CORBA.iiop.GIOPImp l.createRe quest(Unkn own Source) at com.sun.CORBA.idl.GenericC ORBAClient SC.createR equest(Unk nown Source) at com.sun.CORBA.idl.InitialN amingClien t.resolve( Unknown Source) at com.sun.CORBA.idl.InitialN amingClien t.cachedIn itialRefer ences(Unkn own Source) at com.sun.CORBA.idl.InitialN amingClien t.resolve_ initial_re ferences(U nknown Source) at com.sun.CORBA.idl.ORB.reso lve_initia l_referenc es(Unknown Source) at HelloApplet$ButtonAction.a ctionPerfo rmed(Hello Applet.jav a:34) at java.awt.Button.processAct ionEvent(U nknown Source) at java.awt.Button.processEve nt(Unknown Source) at java.awt.Component.dispatc hEventImpl (Unknown Source) at java.awt.Component.dispatc hEvent(Unk nown Source) at java.awt.EventQueue.dispat chEvent(Un known Source) at java.awt.EventDispatchThre ad.pumpOne Event(Unkn own Source) at java.awt.EventDispatchThre ad.pumpEve nts(Unknow n Source) at java.awt.EventDispatchThre ad.run(Unk nown Source)
it is true that this is in applet but i am also trying from the application which runs on windows machine and tnameserv and server runs on linux.
every things work fine if i port this application on windows NT(server and tnameserv) but not on linux
it prints the error on console like this
org.omg.CORBA.COMM_FAILURE
hm, for applet I'm pretty sure it won't work.
Could you try running everything on the Linux machine?
Cheers,
nik
Could you try running everything on the Linux machine?
Cheers,
nik
I mean the application.
Another idea, on the linux, examine the listening sockets, on the NT as well, using netstat. If the expected listening sockets are not there this means the orb is not properly configured.
Also try running the Linux process with 'nohup java blablabla'.
Cheers,
Nik
Also try running the Linux process with 'nohup java blablabla'.
Cheers,
Nik
ASKER
Nik
i tried everything in linux it is working. and it is showing the port when using netstat. I didn't get what is nohup java
how can i configure my linux server so that i can run client from windows machine
i tried everything in linux it is working. and it is showing the port when using netstat. I didn't get what is nohup java
how can i configure my linux server so that i can run client from windows machine
Hmm, I had a similar problem some time ago. The CORBA connection from our Solaris to the NT serves worked, however the other way around didn't. This does not help you much as my solution was to upgrade the orb to another version where this problem was not present.
To narrow further the problem whether it is a no connection at all or a non-bidirectional connection, you can run your applicaitons with exactly the opposite set-up. I believe it was the client on the NT and the server object on the + orb + NS on the linux. Now try it client on linux, server on NT.
Cheers,
Nik
To narrow further the problem whether it is a no connection at all or a non-bidirectional connection, you can run your applicaitons with exactly the opposite set-up. I believe it was the client on the NT and the server object on the + orb + NS on the linux. Now try it client on linux, server on NT.
Cheers,
Nik
ASKER
No it is not working otherway around
it is working only when i run server and tnameserv on NT and client on windows98
what could be the possible reason
nikki
it is working only when i run server and tnameserv on NT and client on windows98
what could be the possible reason
nikki
More ideas:
May be the linux uses the ports of the orb for something else.
Try changing the initial port (on both machines).
Cheers,
Nik
May be the linux uses the ports of the orb for something else.
Try changing the initial port (on both machines).
Cheers,
Nik
ASKER
No it is not working otherway around
it is working only when i run server and tnameserv on NT and client on windows98
what could be the possible reason
nikki
it is working only when i run server and tnameserv on NT and client on windows98
what could be the possible reason
nikki
I think I'm lost :-) Too many comments about computers that I cannot touch.
I think, your orb is misconfigured on one of the machines. Anyway, try changing (on each machine) the default orb ports to something like 5333, to see whether this is the problem in the Linux.
Cheers,
Nik
I think, your orb is misconfigured on one of the machines. Anyway, try changing (on each machine) the default orb ports to something like 5333, to see whether this is the problem in the Linux.
Cheers,
Nik
ASKER
Lol
Yup I will try
anyway thanx for your support
when i will get the solution i will get back to you
bye
Yup I will try
anyway thanx for your support
when i will get the solution i will get back to you
bye
ASKER
Hi Nik
what is this nohup java
why it is used for and how can i use it
nikki
what is this nohup java
why it is used for and how can i use it
nikki
ASKER
Hi Nik
what is this nohup java
why it is used for and how can i use it
nikki
what is this nohup java
why it is used for and how can i use it
nikki
I do not know exactly what 'nohup' is, but I do know that it helps sometimes on server processes, especially listening applications. nohup makes the application ignore 'hang-up' signals (if it already hasn't ignored them). In some cases, the kernel of the UNIX is configured to sent these on every process, just in case :-)
So, if you use the following line to start a java app in UNIX:
"java -cp /csad/casd/cas:/casc/casd ORBMainClass"
it shoudl become
"nohup java -cp /csad/casd/cas:/casc/casd ORBMainClass"
Try it out and tell me.
Cheers,
Nik
So, if you use the following line to start a java app in UNIX:
"java -cp /csad/casd/cas:/casc/casd ORBMainClass"
it shoudl become
"nohup java -cp /csad/casd/cas:/casc/casd ORBMainClass"
Try it out and tell me.
Cheers,
Nik
ASKER
Hi Nik
Thanx for yuor help. I got the things working and it was very silly thing.
I have to make entry of Linux server in hosts file in windows directory.
Thanx
bye
nikki
Thanx for yuor help. I got the things working and it was very silly thing.
I have to make entry of Linux server in hosts file in windows directory.
Thanx
bye
nikki
Yeah, tiny little detail.
Take care,
Nik
Take care,
Nik
Cheers,
Nik