9

I am running CORBA Persistent Object implementation in Java IDL

as in Java IDL: The "Hello World" Example

I followed exact procedure in above article

I used servertool for registering Persistent server as shown in example . but when i tried to register server using syntax as in that article :

servertool > register -server PersistentServer -applicationName s1 -classpath path_to_server_class_files

I hangs and doesnt do any thing , then i have to do ctrl+c to back to normal mode

what could be wrong with this ??

3
  • I'm going through the same problem. I download the example there from download.java.net/jdk7/archive/b123/docs/technotes/guides/idl/… and began to follow the steps from readme.txt where at Step 5b I have a problem. More specifically, if I run "register -server PersistentServer -applicationName s1 -classpath ." in the servertool conncted at ORB port 1050 I get an error saying "Bad server definition: main class not found."
    – Alex Bitek
    Oct 27, 2011 at 17:21
  • I started ORBD as a background process which has the orb.db in the same directory as the PersistentHello directory; and I started servertool from PersistentHello directory where PersistentServer class is. If you search Google for the string "Bad server definition: main class not found" you will see 2-3 bug reports from a few years ago. I have some ideas to try if something works I'll let you know.
    – Alex Bitek
    Oct 27, 2011 at 17:25
  • @AlexButum Thanks for your consideration but at last i find my answer at cse.ohio-state.edu/~gurari/course/cis888w04/…
    – mojtaba
    Dec 15, 2013 at 17:46

2 Answers 2

1

The problem is that your Java JDK installation path contains spaces.

If your JDK is installed to a path with spaces for example "C:\Program Files\Java\jdk1.7.0" then you have to start orbd and servertool using their absolute path (in Windows you have to use short hand notation i.e with ~ [tilda]):

C:\Progra~1\Java\jdk1.7.0\bin\orbd -ORBInitialPort 1050 -serverPollingTime 200

C:\Progra~1\Java\jdk1.7.0\bin\servertool -ORBInitialPort 1050

servertool> register -server PersistentServer -applicationName MyApp -classpath . (adjust the classpath as needed for the files generated by idlj)

In Windows you can find short name path using: dir *.* /x

In case your using an environment variable like %JAVA_HOME% equals to "C:\Program Files\Java\jdk1.7.0" and then you append it to PATH it will NOT work, you have to use short hand notation (with tilda) i.e. "C:\Progra~1\Java\jdk1.7.0"

HINT: If your JDK is installed in a path with no spaces, for example C:\Java\jdk1.7.0 then you can start orbd and servertool without using an absolute path and it will work.

2
  • Which JDK version you are using for this ?
    – ajduke
    Nov 1, 2011 at 4:20
  • Latest Oracle JDK 7 on Windows XP SP3 32 bit and OpenJDK 1.7.0_147 on a Linux (Kubuntu 64bit) system. Read the comments from this post
    – Alex Bitek
    Nov 1, 2011 at 16:27
0

please read Running CORBA Applications for full description

Create the Java stub and skeleton classes by compiling the IDL file with the ‘idlj’ command.

  idlj -fall IDLfile.idl

Compile the source files

javac IDLserver.java
javac IDLclient.java
or

javac javac *.java IDLmodule/*.java

Start the Object Request Broker (ORB) daemon

unix:   orbd -ORBInitialPort 4321 &
windows:    start orbd -ORBInitialPort 4321

On unix, the command ‘ps -e’ shows the process number assigned to orbd. The kill command can be used to kill the process.

During its running, the daemon writes messages in the subdirectory orb.db. Invoke the server unix: java IDLserver -ORBInitialHost localhost -ORBInitialPort 4321 & windows: start java IDLserver -ORBInitialHost localhost -ORBInitialPort 4321 Invoke the client

java IDLclient -ORBInitialHost localhost -ORBInitialPort 4321

The default ORB initial port is port 900 (only a root can start it on solaris).

1
  • "(only a root can start it on Solaris)". Actually no!. This is in fact were Solaris differs from both Windows and Linux because it has the net_privaddr privilege that you can assign to a user, a process, an executable or a service. Much more safe.
    – peterh
    Dec 16, 2013 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.