Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Linux and Corba

Posted on 2000-03-21
28
Medium Priority
?
403 Views
Last Modified: 2013-12-29
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

0
Comment
Question by:nikki_agarwal
  • 13
  • 13
  • 2
28 Comments
 
LVL 8

Expert Comment

by:diakov
ID: 2643425
Try to find where your classpath on the unix is. Then look into the archives whether the CORBA supoort is there. If not, you can always install another a pure Java orb, for example Orbacus or JacORB (search for the URLs with yahoo.)

Cheers,
  Nik
0
 

Author Comment

by:nikki_agarwal
ID: 2643725
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_references("NameService");
                              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.resolve(path));

is there some problem with the idl mapping on windows and linux

thanx

0
 
LVL 1

Expert Comment

by:dmaguillo
ID: 2643756
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... :)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 8

Expert Comment

by:diakov
ID: 2643773
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_references("NameService");

Check it for null.

Cheers,
  Nik
0
 

Author Comment

by:nikki_agarwal
ID: 2643779
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_references("NameService");
                              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.resolve(path));

is there some problem with the idl mapping on windows and linux

thanx

0
 
LVL 8

Expert Comment

by:diakov
ID: 2643802
Post the stack trace in case of exception.

Nik
0
 
LVL 1

Expert Comment

by:dmaguillo
ID: 2643809
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".

0
 

Author Comment

by:nikki_agarwal
ID: 2643955
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(ActionEvent 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.ORBClass","com.sun.CORBA.iiop.ORB");
                              prop.put("org.omg.CORBA.ORBInitialHost","10.0.0.185");
                               prop.put("org.omg.CORBA.ORBInitialPort","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_references("NameService");
                  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.resolve(path));
                  txterror.setText("      after helper");
                                   Bye byeRef = ByeHelper.narrow(ncRef1.resolve(path1));

                                    
                  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(new ButtonAction());            
                              
      }        
 }

bye
0
 

Author Comment

by:nikki_agarwal
ID: 2643961
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(ActionEvent 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.ORBClass","com.sun.CORBA.iiop.ORB");
                              prop.put("org.omg.CORBA.ORBInitialHost","10.0.0.185");
                               prop.put("org.omg.CORBA.ORBInitialPort","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_references("NameService");
                  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.resolve(path));
                  txterror.setText("      after helper");
                                   Bye byeRef = ByeHelper.narrow(ncRef1.resolve(path1));

                                    
                  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(new ButtonAction());            
                              
      }        
 }

i guess it will help you in understanding the problem
bye
nikki
0
 

Author Comment

by:nikki_agarwal
ID: 2643967
hey i am not doing anything with property so don't be confused by that
0
 
LVL 8

Expert Comment

by:diakov
ID: 2644003
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.

0
 
LVL 8

Accepted Solution

by:
diakov earned 75 total points
ID: 2644022
I believe the applet runs well on your local NT machine, doesn't it?
Some orbs like orbix support HTTP tunneling for the connection support.

My personal opinion is, that putting CORBA connectivity in an applet is a design error. Applets are just front end, and even a sophisticated application can be split in a backend, that probably communicates with other remote objects with CORBA, and front end that is HTTP, or applet using server side scripting (or servlets).

Another problem with CORBa in an applet are the corporate firewalls that have only a gateway for the http protocol. Your applet will never pass through even if it is signed.

I suggest you reconsider the usage of CORBa in an applet seriously.

Cheers,
  Nik
0
 

Author Comment

by:nikki_agarwal
ID: 2644057
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.ConnectionTable.get(Unknown Source)      at com.sun.CORBA.iiop.GIOPImpl.createRequest(Unknown Source)      at com.sun.CORBA.iiop.GIOPImpl.createRequest(Unknown Source)      at com.sun.CORBA.idl.GenericCORBAClientSC.createRequest(Unknown Source)      at com.sun.CORBA.idl.InitialNamingClient.resolve(Unknown Source)      at com.sun.CORBA.idl.InitialNamingClient.cachedInitialReferences(Unknown Source)      at com.sun.CORBA.idl.InitialNamingClient.resolve_initial_references(Unknown Source)      at com.sun.CORBA.idl.ORB.resolve_initial_references(Unknown Source)      at HelloApplet$ButtonAction.actionPerformed(HelloApplet.java:34)      at java.awt.Button.processActionEvent(Unknown Source)      at java.awt.Button.processEvent(Unknown Source)      at java.awt.Component.dispatchEventImpl(Unknown Source)      at java.awt.Component.dispatchEvent(Unknown Source)      at java.awt.EventQueue.dispatchEvent(Unknown Source)      at java.awt.EventDispatchThread.pumpOneEvent(Unknown Source)      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)      at java.awt.EventDispatchThread.run(Unknown Source)


0
 
LVL 8

Expert Comment

by:diakov
ID: 2644083
hm, for applet I'm pretty sure it won't work.

Could you try running everything on the Linux machine?

Cheers,
  nik
0
 
LVL 8

Expert Comment

by:diakov
ID: 2644084
I mean the application.
0
 
LVL 8

Expert Comment

by:diakov
ID: 2644093
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
0
 

Author Comment

by:nikki_agarwal
ID: 2644173
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
0
 
LVL 8

Expert Comment

by:diakov
ID: 2644285
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
0
 

Author Comment

by:nikki_agarwal
ID: 2644323
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
0
 
LVL 8

Expert Comment

by:diakov
ID: 2644334
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
0
 

Author Comment

by:nikki_agarwal
ID: 2644337
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
0
 
LVL 8

Expert Comment

by:diakov
ID: 2644360
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
0
 

Author Comment

by:nikki_agarwal
ID: 2644469
Lol
Yup I will try
anyway thanx for your support
when i will get the solution i will get back to you
bye
0
 

Author Comment

by:nikki_agarwal
ID: 2647948
Hi Nik
what is this nohup java
why it is used for and how can i use it
nikki
0
 

Author Comment

by:nikki_agarwal
ID: 2648021
Hi Nik
what is this nohup java
why it is used for and how can i use it
nikki
0
 
LVL 8

Expert Comment

by:diakov
ID: 2648288
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
0
 

Author Comment

by:nikki_agarwal
ID: 2648550
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
0
 
LVL 8

Expert Comment

by:diakov
ID: 2648553
Yeah, tiny little detail.

Take care,
  Nik
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question