Archived
Where do I put my IceBox service library when deploying to CentOS7, Ice3.6, IceGrid
I continually get this message when starting the IceBox service (using icegridgui)
!! 04/24/16 12:22:55.970 IceBox: error: ServiceManager: unable to load entry point `IxxonService:create': libIxxonService++11.so: cannot open shared object file: No such file or directory
I even set the working directory of the icebox server property to : /var/lib/ice/icegrid/node1/servers/IceBox but putting my library in this directory still coughs up the "no such file or directory" error.
[chow@localhost IceBox]$ pwd
/var/lib/ice/icegrid/node1/servers/IceBox
[chow@localhost IceBox]$ ls
config dbs distrib libIxxonService++11.so revision
Here is my application.xml:
<?xml version="1.0" encoding="UTF-8" ?>
Ixxon GameMaster Services
Ixxon ${name} service application
IceBox server
LANG=en
Comments
-
<?xml version="1.0" encoding="UTF-8" ?> <!-- This file was written by IceGrid Admin --> <icegrid> <application name="Ixxon"> <description>Ixxon GameMaster Services</description> <service-template id="IxxonService"> <parameter name="name"/> <service name="${name}" entry="IxxonService:create"> <description>Ixxon ${name} service application</description> <properties> <properties refid="mx"/> <property name="Ixxon.Identity" value="gamemaster"/> </properties> <adapter name="Ixxon-${name}" endpoints="default -h localhost" id="Ixxon-${name}"/> </service> </service-template> <properties id="mx"> <property name="IceMX.Metrics.Debug.GroupBy" value="id"/> <property name="IceMX.Metrics.Debug.Disabled" value="1"/> <property name="IceMX.Metrics.ByParent.GroupBy" value="parent"/> <property name="IceMX.Metrics.ByParent.Disabled" value="1"/> </properties> <node name="node1"> <icebox id="IceBox" activation="manual" exe="icebox"> <description>IceBox server</description> <env>LANG=en</env> <properties> <properties refid="mx"/> <property name="IceBox.Trace.ServiceObserver" value="1"/> </properties> <service-instance template="IxxonService" name="GameMaster"> <properties> <property name="Ixxon.Database.Name" value="Ixxon"/> <property name="Ixxon.Database.Host" value="localhost"/> <property name="Ixxon.Database.Username" value="ixxon"/> <property name="Ixxon.Database.Password" value="ixxon"/> <property name="Ixxon.Database.Port" value="3066"/> <property name="Ixxon.Database.TimeCapsule" value=""/> <property name="Ixxon.Trace.Level" value="0"/> <property name="IceBox.Trace.Network" value="1"/> </properties> </service-instance> </icebox> </node> </application> </icegrid>
0 -
I'd like to add that I have tried putting the libIxxonService+11.so file in /usr/lib and still get the same error. I followed my nose in the source code to this line:
_hnd = dlopen(lib.c_str(), flags);
and looked in the man pages for dlopen and /lib and /usr/lib are supposed to be searched.0 -
And last but not least, I have tried installing the lib where Ice libs reside:
[chow@localhost c++11]$ pwd
/usr/lib64/c++11
[chow@localhost c++11]$ ls -la
total 148
drwxr-xr-x. 2 root root 4096 Apr 24 19:13 .
dr-xr-xr-x. 159 root root 102400 Apr 24 19:11 ..
lrwxrwxrwx. 1 root root 22 Apr 19 11:51 libFreeze.so -> ../libFreeze++11.so.36
lrwxrwxrwx. 1 root root 24 Apr 19 11:51 libGlacier2.so -> ../libGlacier2++11.so.36
lrwxrwxrwx. 1 root root 22 Apr 19 11:51 libIceBox.so -> ../libIceBox++11.so.36
lrwxrwxrwx. 1 root root 28 Apr 19 11:51 libIceDiscovery.so -> ../libIceDiscovery++11.so.36
lrwxrwxrwx. 1 root root 23 Apr 19 11:51 libIceGrid.so -> ../libIceGrid++11.so.36
lrwxrwxrwx. 1 root root 35 Apr 19 11:51 libIceLocatorDiscovery.so -> ../libIceLocatorDiscovery++11.so.36
lrwxrwxrwx. 1 root root 25 Apr 19 11:51 libIcePatch2.so -> ../libIcePatch2++11.so.36
lrwxrwxrwx. 1 root root 19 Apr 19 11:51 libIce.so -> ../libIce++11.so.36
lrwxrwxrwx. 1 root root 22 Apr 19 11:51 libIceSSL.so -> ../libIceSSL++11.so.36
lrwxrwxrwx. 1 root root 24 Apr 19 11:51 libIceStorm.so -> ../libIceStorm++11.so.36
lrwxrwxrwx. 1 root root 23 Apr 19 11:51 libIceUtil.so -> ../libIceUtil++11.so.36
lrwxrwxrwx. 1 root root 21 Apr 24 19:13 libIxxonService++11.so -> ../libIxxonService.so0 -
One more go at it, set the executable back to icebox (as opposed to icebox++11) and now the service is starting up. Looks like for CentOS7, the place to put one's IceBox service library is /usr/lib64/.
I am unclear as to why it is not working with icebox++11, so if anyone has a good idea, I'd love to hear it.
0 -
icebox++11 must be used with libraries build with --std=c++11, for C++98 libraries use icebox
The library location depends on the entry point specification, if you just set the library name, the library need to be in the system LD_LIBRARY_PATH, you can also use a path relative to the working directory in your entry point entry="./IxxonService:create"
0 -
I did put the c+11 in the eclipse properties, but I'm not going to worry about that now. HAve you had any luck using the SessionFacotryHelper and SessionHelper classes? Now I am stuck on not getting a createdCommunicator event thrown, though I can see in the glacier2router log that a session is active.
0 -
Hi Brian,
On RHEL / CentOS 7, we provide two set of libraries: the ++11 libraries, built with
--std=c++11
, and the suffix-less libraries built without this flag. All these libraries are installed in the default system location,/usr/lib64
for 64-bit libraries.As Jose wrote above,
icebox
is/should be used for IceBox services built without--std=c++11
, whereasicebox++11
should be used for IceBox services built with--std=c++11
(or equivalent).Are you building your IceBox service with
--std=c++11
?If yes, then you need to use the
++11
suffix for your shared library name, but not in your Ice entry point configuration. Ice built in C++11 mode, and in particularicebox++11
, adds this suffix automatically when dynamically loading shared libraries. See https://github.com/zeroc-ice/ice/blob/3.6/cpp/src/Ice/DynamicLibrary.cpp around line 93.Conversely, if you are building without
--std=c++11
, please useicebox
and don't add a++11
suffix to your library name.Hope it's clearer now.
Bernard
0 -
I got past that problem. this is my main form load function:
public frmMain() { Ice.InitializationData initData = new Ice.InitializationData(); initData.properties = Ice.Util.createProperties(); initData.properties.load("config.client"); _factory = new Glacier2.SessionFactoryHelper(initData, this); _factory.setProtocol("tcp"); _factory.setUseCallbacks(false); _session = _factory.connect("", ""); InitializeComponent(); }
I see in the debugger after the factory.connect that createdCommunicator does get called. But now I get a connectFailed event (I was messing with glacier2router settings for Session Management - icegrid docs I found said to not use both session management and IceDefaultRouter).
Does anyone have a working glacier2router.conf, icegridregistry.conf, icegridnode.conf, and application.xml for deploying on linux a Glacier2->IceGrid->IceBox->custom service?
0 -
I see the above code that the connect event gets triggered, but I am unable to create an object proxy. Here is my glacier2router.conf pertinent details:
Glacier2.InstanceName=Glacier2
Glacier2.Client.Endpoints=tcp -h 192.168.0.11 -p 4063
Glacier2.Server.Endpoints=configure for use with IceGrid
Ice.Default.Locator=IceGrid/Locator:tcp -h localhost -p 4061
Glacier2.SessionManager=IceGrid/SessionManager
Glacier2.SSLSessionManager=IceGrid/SSLSessionManager
In the SessionCallback.connected event I try to obtain a proxy:
try { _ixxon = IxxonGM.GameMasterPrxHelper.uncheckedCast(_session.session()); if (_ixxon == null) { throw new ApplicationException("Invalid proxy"); } } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Server Connection Failure", MessageBoxButtons.OK, MessageBoxIcon.Error); Environment.Exit(0); }
which throws a Glacier2.SessionNotExistException even though I see a SessionCallback.createdCommunicator after _session = _factory.connect("", "");
0 -
turns out I had eclipse 4.1.1 on the test server and I was using the > 4.1.1 c++ preprocessor dialet option to select c++11.
0