Archived

This forum has been archived. Please start a new discussion on GitHub.

only one instance of the Application class can be used?

I deploy tow applications to iceregristry, and find such problem:only one instance of the Application class can be used.

will somebody tell me that is the problem?

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Could you please update your project field in your profile to something else than "None"? You can of course deploy and use simultaneously multiple applications with IceGrid. We would need more information about your problem if you want us to help you (Ice, OS, compiler version and more details on the problem, such as the exact error message if there's one).

    Cheers,
    Benoit.
  • Thanks for your reply vary much.

    I had fixed this problem. I open the source file of Ice.Application.java and find the folowing code show as below:
     public final int
        main(String appName, String[] args, InitializationData initData)
        {
            if(_communicator != null)
            {
                System.err.println(appName + ": only one instance of the Application class can be used");
                return 1;
          .....
    
     private static Communicator _communicator;
            }
    

    Now I know I can't deploy more then one application instance in an OSGi container since the _communicator instance is a shared instance for all class. So I change my code to use Ice.Communicator instead, not to use Ice.Application, and now everything is OK.

    I had updated my project name. As I said before, I had paid a lot time to integrate OSGi and Ice grid to provide service for PHP.

    There is no name for our project, we just need a cross-language and grid-computing platform for our programmers to develope service for PHP application.