Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Persistent Server Id not initialized

Persistent Server Id not initialized

Persistent Server Id not initialized

Hi, I'm having trouble initialising a persistent POA.

POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));         
         Policy[] policy = new Policy[2];
         policy[0] = rootPOA.create_lifespan_policy(LifespanPolicyValue.PERSISTENT);
         policy[1] = rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.RETAIN);
         System.out.println("Creating persistant POA");
         POA persistentPOA = rootPOA.create_POA("persistentChildPOA", null, policy);
         System.out.println("activating persistant POA");

throws the following exception:
Creating persistant POA
ERROR: Persistent Server Id not initialized
org.omg.CORBA.INITIALIZE: Persistent Server Id not initialized  vmcid: SUN  mino
r code: 1002 completed: Maybe
        at com.sun.corba.se.internal.POA.POAORB.getPersistentServerId(POAORB.java:401 at .sun.corba.se.internal.POA.POAImpl.pre_initialize(POAImpl.java:159)
        at com.sun.corba.se.internal.POA.POAImpl.<init>(POAImpl.java:111)
        at com.sun.corba.se.internal.POA.POAImpl.makePOA(POAImpl.java:126)
        at com.sun.corba.se.internal.POA.POAImpl.create_POA(POAImpl.java:216)
        at com.sun.corba.se.internal.POA.POAImpl.create_POA(POAImpl.java:522) at server.main(server.java:33)

Any help would be much appreciated!

RE: Persistent Server Id not initialized

I think you should use a policy list instead of policy

rootPOA = PortableServer::POA::_narrow(ro);
rootPoaMgr = rootPOA->the_POAManager();
CORBA::PolicyList policy;
policy[0] = rootPOA->create_lifespan_policy(PortableServer::PERSISTENT);
policy[1] = rootPOA->create_servant_retention_policy(PortableServer::RETAIN);
db2orb3POA = rootPOA->create_POA("persistentChildPOA", rootPoaMgr, policy);

Ion Filipski

ICQ: 95034075
AIM: IonFilipski

RE: Persistent Server Id not initialized

Thanks for your reply.

It seems that the CORBA package that comes with the latest J2SE doesn't contain a PolicyList class, and the 'HelloWorld' example on the Sun website uses an Policy[].

I noticed that you've activated the rootPOA before doing the rest, and have tried that, but to no avail.

Any more ideas?

Many thanks!

RE: Persistent Server Id not initialized

o, sorry, I have not noticed what it is java.

Ion Filipski

ICQ: 95034075
AIM: IonFilipski

RE: Persistent Server Id not initialized

Ok - I've worked it out - actually, it was in the instructions on the sun website

you can't simply start a persistent server from the command line.  They must be registered with orbd -

from the command line:
>start orbd -ORBInitialHost localhost -ORBInititalPort 2090
>start servertool -ORBInitialHost localhost - ORBInitialPort 2090

then within servertool:
> register -server serverClassName -classpath classpathToServer -args -ORBInitialHost localhost -ORBInitialPort 2090

and it starts (although I think servertool on JDK1.4.2_01 has a bug meaning it can't find the server class, so may not work although this appears to be fixed in 1.4.2_02)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close