Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8776537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:05:02+00:00 2026-06-13T19:05:02+00:00

I would like to init my ORB from property file (normally I init it

  • 0

I would like to init my ORB from property file (normally I init it like this, while running my examples: ./app -ORBInitRef NameService=corbaloc::localhost:2809/NameService)

I wrote a simple code:

private static String[] readConfigFile()
{
    Properties prop = new Properties();
    String arg[] = new String[1];
    try 
    {
        prop.load(new FileInputStream("config.properties"));
    } catch (IOException ex) {}
    arg[0] = prop.getProperty("ORBInitRef");
    return arg;
}

and then tried to init my orb:

clientsORB = org.omg.CORBA.ORB.init(readConfigFile(), null);

but there are some errors:

2012-11-01 12:15:36 com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl <init>
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 900"
org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
        at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2172)
        at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2193)
        at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:223)
        at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:236)
        at com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:119)
        at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:168)
        at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:136)
        at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.invoke(BootstrapResolverImpl.java:99)
        at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.resolve(BootstrapResolverImpl.java:132)
        at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:47)
        at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:47)
        at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:47)
        at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references(ORBImpl.java:1174)
        at ClientConnection.connect(ClientConnection.java:68)
        at Client.main(Client.java:303)
Caused by: java.net.ConnectException: Connection refused
        at sun.nio.ch.Net.connect(Native Method)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:525)
        at java.nio.channels.SocketChannel.open(SocketChannel.java:164)
        at com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl.createSocket(DefaultSocketFactoryImpl.java:78)
        at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:206)
        ... 12 more

My config.properties file:

ORBInitRef NameService=corbaloc::localhost:2809/NameService

What I did wrong? When I init my ORB normally, everything is great, so its not the code issue, its definitely problem with initialization from file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:05:03+00:00Added an answer on June 13, 2026 at 7:05 pm

    You have to add -ORBInitRef to the ORB arguments also. Compare it to the commandline you normaly use. ALL the arguments have to be passed to the ORB.init()

    config.properties:

    ORBInitRef NameService=corbaloc::localhost:2809/NameService 
    

    Java Code using it (ReadProps.java)

    import java.io.FileInputStream;
    import java.io.IOException;
    import java.util.Properties;
    
    import org.omg.CORBA.ORB;
    
    public class ReadProps {
        public static void main(String[] args) {
            ORB clientsORB = org.omg.CORBA.ORB.init(readConfigFile(), null);
        }
    
        static String[] readConfigFile() {
            Properties prop = new Properties();
            String[] orbarg = new String[2];
    
            try {
                // load a properties file
                prop.load(new FileInputStream("config.properties"));
                // get the property value and print it out  
                orbarg[0] = "-ORBInitRef"; // <---- NEEDED
                orbarg[1] = prop.getProperty("ORBInitRef");
    
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return orbarg;
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to Initialize a string with data from a property file in
Would like to parse IPv4 address from exit-addresses . Format of the file: ExitNode
For C I would init an array like this: NSInteger x[3][10]; That works. Below
I would like to something like this in JavaScript var init = function ()
I would like to integrate the neo4j_config.props file from http://wiki.neo4j.org/content/Configuration_Settings#Optimizing_for_traversals_example into the : a
I would like to dynamically allocate memory from the machine_init function in my arm
I would like to get POST data sent to page controller in init() function
I would like to fire up this event: - (IBAction)profilePop:(id)sender { ProfileViewController * profile
I would like to add the text Sent from to the bottom of the
I would like to set up a simple python app as a periodic celery

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.