Archived

This forum has been archived. Please start a new discussion on GitHub.

Error with IceWS in IceJS on a browser

Dear all,

I’m trying to use ICEJS in a browser and I need to configure the web socket in a server :
Ice.Plugin.IceWS=IceWS:/opt/IceJS-0.1.0/lib/IceWS:createIceWS
and
:ws -h 0.0.0.0 -p 11000

But I have an error:
PluginManagerI.cpp:356: Ice::PluginInitializationException:
plug-in initialization failed: unable to load entry point `IceWS:/opt/IceJS-0.1.0/lib/IceWS:createIceWS': IceWS:/opt/IceJS-0.1.0/lib/libIceWS.so.35: cannot open shared object file: No such file or directory

The output of ldd is:
libIce.so.35 => /opt/IceJS-0.1.0/lib/libIce.so.35 (0x00007fdffe004000)
	libIceStorm.so.35 => /opt/Ice-3.5.1/lib/libIceStorm.so.35 (0x00007fdffdd82000)
	libIceUtil.so.35 => /opt/IceJS-0.1.0/lib/libIceUtil.so.35 (0x00007fdffdb09000)


In bashrc i have:
# Ice35
export ICE_HOME=/opt/Ice-3.5.1
export LD_LIBRARY_PATH=${ICE_HOME}/lib:${LD_LIBRARY_PATH}
export PATH=${ICE_HOME}/bin:${PATH}

export CPLUS_INCLUDE_PATH=${ICE_HOME}/include:/opt/jderobot35/include

# icejs
export ICE_JS_HOME=/opt/IceJS-0.1.0
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ICE_JS_HOME}/lib
export PATH=${PATH}:${ICE_JS_HOME}/bin

export CPLUS_INCLUDE_PATH=${ICE_JS_HOME}/include

I don't know what happened because It should work.

Have I to install IceWS?

I work in Ubuntu 14.04, ice3.5 and installed ice and icejs from source.

Thanks so much,

regards,

Iván

Comments

  • xdm
    xdm La Coruña, Spain
    Hey,

    The IceWS plug-in configuration seems bogus, if IceJS lib directory is in your library path that should be enough
    Ice.Plugin.IceWS=IceWS:createIceWS
    

    For the correct format of the Ice.Plugin. property see Ice.Plugin doc.

    Also you must put IceJS before Ice in your library path.
    export LD_LIBRARY_PATH=${ICE_JS_HOME}/lib:${LD_LIBRARY_PATH}
    

    Anyway at this point you should consider upgrading to Ice-3.6 IceWS has been integrated in Ice core and is not longer a separate plug-in.
  • Thank you Jose,

    Putting the ICE JS before in my Library path It works.

    I'll take a look, I use a old apps that with 3.5 works fine, if 3.6 is 100% compatible I think I will upgrade.

    Thanks again!!

    Iván
  • I have another error and I think is similar than previously, but I can't solve it. Now, when I use Ice for python, when Ice.py calls Icepy I got this error:
    File "/usr/lib/python2.7/dist-packages/Ice.py", line 47, in <module>
        import IcePy
    ImportError: /usr/lib/python2.7/dist-packages/IcePy.so: undefined symbol: _ZN7IceUtil4TimeC1Ex
    


    If I do ldd:
    ldd /usr/lib/python2.7/dist-packages/IcePy.so
        linux-vdso.so.1 =>  (0x00007ffc80eb4000)
        libIce.so.35 => /opt/IceJS-0.1.0/lib/libIce.so.35 (0x00007f99ee473000)
        libSlice.so.35 => /opt/IceJS-0.1.0/lib/libSlice.so.35 (0x00007f99ee087000)
        libIceUtil.so.35 => /opt/IceJS-0.1.0/lib/libIceUtil.so.35 (0x00007f99ede0e000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f99edb0a000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f99ed8f4000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f99ed6d6000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f99ed311000)
        libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f99ed101000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f99ecefd000)
        libmcpp.so.0 => /usr/lib/x86_64-linux-gnu/libmcpp.so.0 (0x00007f99ecc74000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f99eca6c000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f99ec766000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f99ef062000)
    

    I thougth the problem is that It should Ice35 files and I did
    export ICE_HOME=/opt/Ice-3.5.1
    export LD_LIBRARY_PATH=${ICE_HOME}/lib:${LD_LIBRARY_PATH}
    export PATH=${ICE_HOME}/bin:${PATH}
    

    But the problem persists and with ldd I have following output:
    ldd /usr/lib/python2.7/dist-packages/IcePy.so
        linux-vdso.so.1 =>  (0x00007ffc961f1000)
        libIce.so.35 => /opt/Ice-3.5.1/lib/libIce.so.35 (0x00007fcbca4b2000)
        libSlice.so.35 => /opt/Ice-3.5.1/lib/libSlice.so.35 (0x00007fcbca0cd000)
        libIceUtil.so.35 => /opt/Ice-3.5.1/lib/libIceUtil.so.35 (0x00007fcbc9e54000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fcbc9b50000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fcbc993a000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fcbc971c000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcbc9357000)
        libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007fcbc9147000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fcbc8f43000)
        libmcpp.so.0 => /usr/lib/x86_64-linux-gnu/libmcpp.so.0 (0x00007fcbc8cba000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fcbc8ab2000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcbc87ac000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fcbcb099000)
    

    Thanks so much!
  • xdm
    xdm La Coruña, Spain
    Hi,

    Seems to me that you are using Ice for Python package from Ubuntu repository, and with your configuration IcePy try to load dynamic libraries from your Ice/IceJs build that are not compatible.

    Not sure why you are using a custom Ice-3.5.1 build, you can use the ZeroC binary packages from https://zeroc.com/download_3_5_1.html those should work with the IceJS-0.1.0 (https://zeroc.com/labs/icejs/download.html) .


    Upgrading to 3.6 maybe simpler as WS transport is now integrated in Ice core and you can use JavaScript packages directly from npm or bower.
  • I installed both Ice3.5 and IceJS compiling from source code. Is there anyway to clean up all ice from the computer and reinstall it?
  • xdm
    xdm La Coruña, Spain
    Hi,

    To remove Ice-3.5 and IceJS installed from source just remove the install directory, /opt/IceJS-0.1.0 and /opt/Ice-3.5.1

    To remove Ubuntu packages you need to use apt-get remove --purge <package-name>

    The 3.5 package names for ZeroC Ice package are here, https://doc.zeroc.com/display/Ice35/Using+the+Linux+Binary+Distributions#UsingtheLinuxBinaryDistributions-DEBPackages

    If you are using 3.5 packages from Ubuntu repository, that has different names, see http://packages.ubuntu.com/source/trusty/zeroc-ice
  • I've deleted every package and I've reinstall Ice35 (I need 3.5 version) and everything is OK.

    When i install jderobot packets (apps with I am working) and execute the app I hace a similar error than before:
    File "/usr/local/share/jderobot/python/introrob_py/main.py", line 21, in <module>
        from MyAlgorithm import MyAlgorithm
      File "/usr/local/share/jderobot/python/introrob_py/MyAlgorithm.py", line 1, in <module>
        from sensors import sensor
      File "/usr/local/share/jderobot/python/introrob_py/sensors/sensor.py", line 19, in <module>
        import sys, traceback, Ice
      File "/usr/lib/python2.7/dist-packages/Ice.py", line 47, in <module>
        import IcePy
    ImportError: /usr/lib/python2.7/dist-packages/IcePy.so: undefined symbol: _ZN7IceUtil4TimeC1Ex
    


    I've seen when I install jderobot the shell said that:
    The following packages will be REMOVED:
      ice ice-utils ice3.5-common libice3.5-python libice3.5-ruby
    The following NEW packages will be installed:
      ice35-slice ice35-translators jderobot python-zeroc-ice
    

    If I try to reinstall ice or trying to reinstall ice ice-utils ice3.5-common libice3.5-python libice3.5-ruby then jderobot is removed and I can't execute the app...

    The following packages will be REMOVED:
      ice35-slice ice35-translators jderobot python-zeroc-ice
    The following NEW packages will be installed:
      ice ice-utils ice3.5-common libice3.5-python libice3.5-ruby
    


    If this a jderobot sorry and I'll find how to solve by myself, but not sure if there is an option for a correct execution of IcePy.so


    Thanks so muck!!!

  • xdm
    xdm La Coruña, Spain
    Seems that jderobot has a dependency on python-zeroc-ice package from Ubuntu repository and you have installed the Ice python package from ZeroC Ice repository that has a different name libice3.5-python.

    You cannot install both as this packages conflicts with each other, the best for using jdrobot will be to remove the packages from ZeroC repository and use the packages from Ubuntu repository, this means that you will not be able to use our IceJS binary packages, and you will need to build IceJS from sources.

    The core problem is that ZeroC and Debian packages for Ice use different naming and that is problematic when resolving dependencies, with 3.6 we have upgrade the naming scheme to be compatible with Debian guidelines and hopefully this new naming is picked by Debian Ice 3.6 packages.

  • edit: Duplicate
  • Hi!,

    uninstalling ice from Zerocr epository and installing from Ubuntu repository that problem is solved. But I still have the problem with IcePy.so:
    [FONT=Helvetica]
    File "/usr/local/share/jderobot/python/introrob_py/sensors/sensor.py", line 19, in <module>[/FONT]
      [FONT=Helvetica]    import sys, traceback, Ice[/FONT]
      [FONT=Helvetica]  File "/usr/lib/python2.7/dist-packages/Ice.py", line 47, in <module>[/FONT]
      [FONT=Helvetica]    import IcePy[/FONT]
      [FONT=Helvetica]ImportError: /usr/lib/python2.7/dist-packages/IcePy.so: undefined symbol: _ZN7IceUtil4TimeC1Ex[/FONT]
      [FONT=Helvetica] [/FONT]
      [FONT=Helvetica] [/FONT]
    

    Thanks for your help!
  • xdm
    xdm La Coruña, Spain
    Can you pate the output of ldd /usr/lib/python2.7/dist-packages/IcePy.so command with your current setup, seems you are still using an IceUtil library that isn't compatible with the Ubuntu packages.
  • This is the output:
    ldd /usr/lib/python2.7/dist-packages/IcePy.so
        linux-vdso.so.1 =>  (0x00007ffd7e1f1000)
        libIce.so.35 => /opt/IceJS-0.1.0/lib/libIce.so.35 (0x00007f3b10281000)
        libSlice.so.35 => /opt/IceJS-0.1.0/lib/libSlice.so.35 (0x00007f3b0fe95000)
        libIceUtil.so.35 => /opt/IceJS-0.1.0/lib/libIceUtil.so.35 (0x00007f3b0fc1c000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f3b0f918000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f3b0f702000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3b0f4e4000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3b0f11f000)
        libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f3b0ef0f000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3b0ed0b000)
        libmcpp.so.0 => /usr/lib/x86_64-linux-gnu/libmcpp.so.0 (0x00007f3b0ea82000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f3b0e87a000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3b0e574000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f3b10e70000)
    

    Maybe It's a incompability with the IceJs ld_library_path?
  • xdm
    xdm La Coruña, Spain
    Hi,

    As I wrote above you will not be able to use IceJS binary distribution with Ubuntu packages and you will need to build IceJS from sources
  • Maybe I'm wrong but I think I've installed it compiling from source. I've followed this link https://doc.zeroc.com/display/JS/Building+Ice+for+JavaScript+on+Linux

    Thanks so much!
  • irodmar wrote: »
    Maybe I'm wrong but I think I've installed it compiling from source. I've followed this link https://doc.zeroc.com/display/JS/Building+Ice+for+JavaScript+on+Linux

    Thanks so much!

    can anyone confirm me if the above link is the one to build IceJS from sources and do compatible ICeJs with Ice installed from ubuntu repository please?

  • xdm
    xdm La Coruña, Spain
    Hi,
    can anyone confirm me if the above link is the one to build IceJS from sources and do compatible ICeJs with Ice installed from ubuntu repository please?

    Yes that is the right link, you need to downloaded IceJS-0.1.0.tar.gz build and install it.

    You need to ensure you are not mixing packages from ZeroC and Ubuntu repositories, if you are going to use packages from Ubuntu repository, the best is to uninstall all Ice related packages, remove ZeroC repository and re install the packages you need.

    Once you have Ice for Python working from Ubuntu repository try to install IceJS from source. If this doesn't work can you paste the steps you use to install and test this, so we can try to reproduce the issue.

    Cheers,
    José
  • Sorry for the delay Jose,

    I’ve removed all Ice packets from ubuntu and zeroc repositories and reinstall Ice from Ubuntu repositories. At the moment Ice for python works perfect without any error.

    I’ve installed IceJS from source as follows:

    In /cpp/config/Make.rules I set:

    [/FONT]
      [COLOR=#323333][FONT=Arial]create_runpath_symlink    ?= yes[/FONT][/COLOR]
      [FONT=Helvetica]
    


    in cpp/ :

    [/FONT]
      [COLOR=#323333][FONT=Arial]make[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]make test —> everything OK[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]sudo make install[/FONT][/COLOR]
      [FONT=Helvetica]
    


    Then:

    [/FONT]
      [COLOR=#323333][FONT=Arial]cd ../js[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial] [/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]make[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]make test —> everything OK[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]sudo make install[/FONT][/COLOR]
      [FONT=Helvetica]
    


    After this if i don’t add IceJs to LD_LIBRARY_PATH still works fine, but when added the plugin to the server:

    [/FONT]
      [COLOR=#323333][FONT=Arial]Ice.Plugin.IceWS=IceWS:createIceWS (just this, i don’t add any ws endpoint)[/FONT][/COLOR]
      [FONT=Helvetica]
    


    I got this error:
    [/FONT]
      [COLOR=#323333][FONT=Arial]PluginManagerI.cpp:356: Ice::PluginInitializationException:[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]plug-in initialization failed: unable to load entry point `IceWS:createIceWS': libIceWS.so.35: cannot open shared object file: No such file or directory[/FONT][/COLOR]
      [FONT=Helvetica]
    


    If I set in bashrc:

    [/FONT]
      [COLOR=#323333][FONT=Arial]export ICE_JS_HOME=/opt/IceJS-0.1.0[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]export LD_LIBRARY_PATH=${ICE_JS_HOME}/lib:${LD_LIBRARY_PATH}[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]export PATH=${PATH}:${ICE_JS_HOME}/bin[/FONT][/COLOR]
      [FONT=Helvetica]
    


    The server runs without error but the client fails because ICE for python is using IceJs path. I’ve solved exporting iceJS to LD_LIBRARY_PATH just in the server shell, but then I got this error:

    In the client:
    [/FONT]
      [COLOR=#323333][FONT=Arial]ConnectionRefusedException: Ice.ConnectionRefusedException:[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]Connection refused[/FONT][/COLOR]
      [FONT=Helvetica]
    


    And in the server:
    [/FONT]
      [COLOR=#323333][FONT=Arial]gzserver: symbol lookup error: /usr/local/lib/jderobot/libJderobotInterfaces.so: undefined symbol: _ZN11IceInternal11BasicStream5writeEx[/FONT][/COLOR]
      [FONT=Helvetica]
    


    I don’t know why using IceWS fails because I think libJderobotInterfaces.so doesn’t use any Ice or IceJS file.

    [/FONT]
      [COLOR=#323333][FONT=Arial]ldd /usr/local/lib/jderobot/libJderobotInterfaces.so[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial] [/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]    linux-vdso.so.1 =>  (0x00007ffc02ebd000)[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f63c0c1d000)[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f63c0a07000)[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f63c0642000)[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f63c033c000)[/FONT][/COLOR]
      [COLOR=#323333][FONT=Arial]    /lib64/ld-linux-x86-64.so.2 (0x00007f63c1420000)[/FONT][/COLOR]
      [FONT=Helvetica]
    


    I hope the explanation is not confusing.

    Thank you Jose


    Iván
  • xdm
    xdm La Coruña, Spain
    Hey,

    I have been testing Ubuntu 14.02 x86_64 and I think I now know what are the issues:

    1) Ubuntu packages are compiled with C++11 enabled , you will need to do the same for IceJS

    2) Ice sources from Ubuntu include and patch for IceUtil\Config.h that breaks compatibility with ZeroC sources. The problem is that with this patch ICE_64 is not being defined in 64 bits builds. The patch in question is archs.path from zeroc-ice_3.5.1-6build2.debian.tar.gz

    I managed to get things working with Ubuntu packages by using the same patch with IceJS sources and building IceJS wit C++11 enabled:
    apt-get source zeroc-ice
    cp zeroc-ice-3.5.1/cpp/include/IceUtil/Config.h IceJS-0.1.0/cpp/include/IceUtil/
    cd IceJS-0.1.0/cpp/include/IceUtil/
    sudo make CPP11=yes OPTIMIZE=yes install
    
  • Thanks so much Jose!!

    With this everything is working without issues!!!