View Single Post
  #1 (permalink)  
Old 10-25-2007
neons neons is offline
Registered User
 
Name: Jia Wei
Organization: WuHan University
Project: learning
 
Join Date: Oct 2007
Posts: 11
Smile importing Grid in the Demo Chat

I encounter a problem that preventing me from moving forward.
When I attempt to importing Grid in the Glacier2 Chat Demo,I am so boring that I don't know what I should do .
What I changed is just adding two configuration files.

application_with_replication.xml
Code:
<icegrid>
	<application name="Simple">

		<server-template id="SimpleServer">
			<parameter name="index"/>
			<server id="SimpleServer-${index}" exe="./server" activation="on-demand">
				<adapter name="ChatServer" endpoints="tcp" register-process="true" replica-group="ReplicatedChatAdapter"/>
			</server>
		</server-template>
		<server-template id="Glacier2">
			<parameter name="instance-name" default="Glacier2"/>
			<parameter name="client-endpoints"/> 
			<parameter name="server-endpoints"/>
			<parameter name="session-timeout" default="30"/>
			<server id="${instance-name}" exe="glacier2router" activation="always">
				<properties>
					<property name="Glacier2.Client.Endpoints" value="${client-endpoints}"/>
					<property name="Glacier2.Server.Endpoints" value="${server-endpoints}"/>				
					<property name="Glacier2.InstanceName" value="${instance-name}"/>
					<property name="Glacier2.SessionTimeout" value="${session-timeout}"/>
					<property name="Glacier2.PermissionsVerifier" value="${instance-name}/NullPermissionsVerifier"/>
					<property name="Glacier2.SessionManager" value="ChatSessionManager"/>
					
				</properties>
			</server>
		</server-template>


		<replica-group id="ReplicatedChatAdapter">
			<load-balancing type="round-robin"/>
			<object identity="ChatSessionManager" type="::Demo::ChatSession"/>
		</replica-group>

		<node name="localhost">
			<server-instance template="SimpleServer" index="1"/>
			<server-instance template="SimpleServer" index="2"/>			
			<server-instance template="Glacier2" client-endpoints="tcp -p 10005" server-endpoints="tcp"/>
		</node>


	</application>

</icegrid>
config.grid

Code:
IceGrid.InstanceName=DemoIceGrid

#
# The IceGrid locator proxy.
#
Ice.Default.Locator=DemoIceGrid/Locator:default -h 192.168.1.104 -p 12000
#
# IceGrid registry configuration.
#
IceGrid.Registry.Client.Endpoints=default -p 12000
IceGrid.Registry.Server.Endpoints=default
IceGrid.Registry.Internal.Endpoints=default

IceGrid.Registry.Data=db/registry
IceGrid.Registry.PermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
IceGrid.Registry.AdminPermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
IceGrid.Registry.SSLPermissionsVerifier=DemoIceGrid/NullSSLPermissionsVerifier
IceGrid.Registry.AdminSSLPermissionsVerifier=DemoIceGrid/NullSSLPermissionsVerifier

#
# IceGrid node configuration.
#
IceGrid.Node.Name=localhost
IceGrid.Node.Endpoints=default
IceGrid.Node.Data=db/node
IceGrid.Node.CollocateRegistry=1

#
# Trace properties.
#
IceGrid.Node.Trace.Activator=2
IceGrid.Node.Trace.Adapter=2
IceGrid.Node.Trace.Server=2

#
# Dummy username and password for icegridadmin.
#
IceGridAdmin.Username=foo
IceGridAdmin.Password=bar
When I deploy this project
Code:
C:\Ice-3.2.1\demo\Glacier2\chat>icegridnode --Ice.Config=config.grid
[ 10/25/07 20:46:32.546 Server: changed server `Glacier2' state to `Inactive' ]
[ 10/25/07 20:46:32.546 Server: changed server `SimpleServer-1' state to `Inacti
ve' ]
[ 10/25/07 20:46:32.546 Server: changed server `SimpleServer-2' state to `Inacti
ve' ]
[ 10/25/07 20:46:33.046 Activator: activating server `Glacier2'
  path = C:\Ice-3.2.1\bin\glacier2router.exe
  pwd = C:\Ice-3.2.1\demo\Glacier2\chat
  args = C:\Ice-3.2.1\bin\glacier2router.exe --Ice.Config=C:\Ice-3.2.1\demo\Glacier2\chat/db/node/servers/Glacier2/config/config ]
[ 10/25/07 20:46:33.046 Server: changed server `Glacier2' state to `Active' ]
[ 10/25/07 20:46:33.125 Activator: activating server `SimpleServer-1'
  path = ./server
  pwd = C:\Ice-3.2.1\demo\Glacier2\chat
  args = ./server --Ice.Config=C:\Ice-3.2.1\demo\Glacier2\chat/db/node/serv
ers/SimpleServer-1/config/config ]
[ 10/25/07 20:46:33.187 Server: changed server `SimpleServer-1' state to `Active
' ]
[ 10/25/07 20:46:33.187 Adapter: server `SimpleServer-1' adapter `SimpleServer-1
.ChatServer' activated: dummy -t:tcp -h 192.168.1.104 -p 2635 ]
[ 10/25/07 20:47:11.109 Activator: activating server `SimpleServer-2'
  path = ./server
  pwd = D:\Copy of server_chatroom_c++_mobile
  args = ./server --Ice.Config=C:\Ice-3.2.1\demo\Glacier2\chat/db/node/serv
ers/SimpleServer-2/config/config ]
[ 10/25/07 20:47:11.171 Server: changed server `SimpleServer-2' state to `Active
' ]
[ 10/25/07 20:47:11.171 Adapter: server `SimpleServer-2' adapter `SimpleServer-2
.ChatServer' activated: dummy -t:tcp -h 192.168.1.104 -p 2651 ]
Code:
C:\Ice-3.2.1\demo\Glacier2\chat>client
This demo accepts any user-id / password combination.
user id: neons
password: neons
client: Outgoing.cpp:388: Ice::ObjectNotExistException:
object does not exist:
identity: `9d0a41ad-1dc3-4d3a-8b2f-f011a6cb7dbc'
facet:
operation: setCallback
----

But when i just delete a server-instance from application_with_replication.xml, it works well!

application_with_replication.xml (have changed)

Code:
<icegrid>
<application name="Simple">
... ...
<node name="localhost">			
<server-instance template="Glacier2" client-endpoints="tcp -p 10005" server-endpoints="tcp"/>
</node>
</application>
</icegrid>
Your answers will do me a good favour.
Reply With Quote