Archived
This forum has been archived. Please start a new discussion on GitHub.
defining the Object Adapter Replication.throwing InitializationException
Hello everyone,
throwing an exception when The server to start .
the version:Ice 3.3.1
the exception information is shown below:
How to solve the exception?
thank you
throwing an exception when The server to start .
the version:Ice 3.3.1
the exception information is shown below:
C:\>icegridnode --Ice.Config=c:\node.cfg
[ 12/02/13 11:06:18.250 icegridnode: Server: changed server `PrinterServer1' state to `Loading' ]
[ 12/02/13 11:06:18.250 icegridnode: Server: changed server `PrinterServer1' state to `Inactive' ]
[ 12/02/13 11:06:18.765 icegridnode: Server: changed server `PrinterServer1' state to `Activating' ]
[ 12/02/13 11:06:18.765 icegridnode: Activator: activating server `PrinterServer1'
path = C:\WINDOWS\system32\java.exe
pwd = C:\
args = C:\WINDOWS\system32\java.exe -jar C:\ICETest_fat.jar --Ice.Config=C:\\IceGrid\\node/servers/PrinterServer1/config/config ]
[ 12/02/13 11:06:18.765 icegridnode: Server: changed server `PrinterServer1' state to `WaitForActivation' ]
Server: Ice.InitializationException
reason = "object adapter `PrinterAdapter' requires configuration"
Ice.InitializationException
reason = "object adapter `PrinterAdapter' requires configuration"
at Ice.ObjectAdapterI.<init>(ObjectAdapterI.java:789)
at IceInternal.ObjectAdapterFactory.createObjectAdapter(ObjectAdapterFactory.java:183)
at Ice.CommunicatorI.createObjectAdapter(CommunicatorI.java:71)
at iceGrid.sampleAdapterLocator.server.Server.run(Server.java:15)
at Ice.Application.main(Application.java:116)
at Ice.Application.main(Application.java:37)
at iceGrid.sampleAdapterLocator.server.Server.main(Server.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.simontuffs.onejar.Boot.run(Boot.java:306)
at com.simontuffs.onejar.Boot.main(Boot.java:159)
[ 12/02/13 11:06:19.500 icegridnode: Activator: detected termination of server `PrinterServer1'
exit code = 1 ]
[ 12/02/13 11:06:19.500 icegridnode: Server: changed server `PrinterServer1' state to `Deactivating' ]
[ 12/02/13 11:06:19.500 icegridnode: Adapter: server `PrinterServer1' adapter `PrinterServer1.PrinterAddapter' deactivated ]
[ 12/02/13 11:06:19.515 icegridnode: Server: changed server `PrinterServer1' state to `Inactive' ]
Configuring the Registry:
IceGrid.Registry.Client.Endpoints=tcp -h 192.168.1.91 -p 4061 IceGrid.Registry.Server.Endpoints=tcp IceGrid.Registry.Internal.Endpoints=tcp IceGrid.Registry.AdminPermissionsVerifier=IceGrid/NullPermissionsVerifier IceGrid.Registry.Data=C:\IceGrid\registry #IceGrid.Registry.DynamicRegistration=1 IceGrid.Registry.Admin.Endpoints=default IceGrid.Registry.Trace.Adapter=3 IceGrid.Registry.Trace.Node=3 IceGridAdmin.Username=mygrid IceGridAdmin.Password=mygriddescriptor:
<icegrid>
<application name="PrinterApplication">
<replica-group id="PrinterAddapters">
<object identity="SimplePrinter" type="iceGrid.sampleAdapterLocator.servant.PrinterI"/>
</replica-group>
<server-template id="PrinterTemplate">
<parameter name="index" />
<server id="PrinterServer${index}" exe="java" activation="always">
<option>-jar</option>
<option>C:\ICETest.jar</option>
<adapter name="PrinterAddapter" replica-group="PrinterAddapters"
endpoints="tcp" />
</server>
</server-template>
<node name="Node1">
<server-instance template="PrinterTemplate"
index="1" />
</node>
</application>
</icegrid>
Configuring the Node:
IceGrid.Node.Endpoints=tcp IceGrid.Node.Name=Node1 IceGrid.Node.Data=C:\IceGrid\node Ice.Default.Locator=IceGrid/Locator:tcp -h 192.168.1.91 -p 4061Configuring the Client:
Ice.Default.Locator=IceGrid/Locator:tcp -h 192.168.1.91 -p 4061server code:
public class Server extends Ice.Application {
public int run(String[] args) {
Ice.ObjectAdapter adapter = communicator().createObjectAdapter("PrinterAdapter");
Ice.Object object = new PrinterI();
Ice.ObjectPrx simplePrinterPrx = adapter.add(object, Ice.Util.stringToIdentity("SimplePrinter"));
adapter.activate();
communicator().waitForShutdown();
return 0;
}
public static void main(String[] args) {
Server app = new Server();
System.exit(app.main("Server", args));
}
}
client code:
public class Client extends Ice.Application {
public int run(String[] args) {
Ice.ObjectPrx base = communicator().stringToProxy("SimplePrinter");
PrinterPrx printer = PrinterPrxHelper.checkedCast(base);
if (printer == null)
throw new Error("Invalid proxy");
String ret = printer.printString("192.168.1.144 say:Hello World!");
System.out.println(ret);
return 0;
}
public static void main(String[] args) {
Client app = new Client();
String conf = "F:\\client.conf";
System.exit(app.main("Client", args, conf));
}
}
How to solve the exception?
thank you
0
Comments
-
seems you have a typo in the descriptor server template, "PrinterAddapter" is misspelled should be "PrinterAdapter" like in your server code.0