Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Persistent Server Id not initialized 1

Status
Not open for further replies.

dmosses

Programmer
Nov 5, 2003
11
0
0
GB
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");
persistentPOA.the_POAManager().activate();

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!
 
I think you should use a policy list instead of policy

rootPOA = PortableServer::pOA::_narrow(ro);
rootPoaMgr = rootPOA->the_POAManager();
rootPoaMgr->activate();
......
CORBA::policyList policy;
policy.length(2);
policy[0] = rootPOA->create_lifespan_policy(PortableServer::pERSISTENT);
policy[1] = rootPOA->create_servant_retention_policy(PortableServer::RETAIN);
db2orb3POA = rootPOA->create_POA(&quot;persistentChildPOA&quot;, rootPoaMgr, policy);


Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
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!
 
o, sorry, I have not noticed what it is java.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
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)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top