Archived

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

Unable to load IceBox CPP Demo Server

Windows 7 x64
Visual Studio 2008
Ice 3.4.1


I extracted the demos.zip from the install package into a subdir of the install for Ice. I loaded the sln for cpp, and built IceBox.Hello.Server.

When I attempted to load the server dll into IceBox all I would get is the following error message.

icebox: error: ServiceManager: unable to load entry point `helloservice:create'

Any help is greatly appreciated!

Jon

Comments

  • mes
    mes California
    Hi Jon,

    When dynamically loading a DLL (as IceBox is doing), it's critical that you use the correct build configuration and run-time environment. There are unfortunately many subtle ways to get it wrong.

    For example, perhaps you built the demo in debug mode (thereby generating HelloServiced.dll) but you're using the release executable (icebox.exe) and not the debug executable (iceboxd.exe).

    Another possibility is that you built the demo DLL in 64-bit mode, but you're using the 32-bit version of icebox.exe.

    So, check your PATH to verify whether you're using the 32- or 64-bit executable by default, and check your build configuration.

    Let us know if you're still having trouble.

    Regards,
    Mark
  • I did build a debug win32 version of the demo, I changed the output file so it is not appended with a d. Is it possible to run the release version of icebox, with a debug version of the dll that is not appended with d?

    Funny thing you mention the 32/64 bit versions, I am on a 64 bit platform, and the directions stated you had to add the bin/x64 dir to your path in order for bzip to work correctly. Now when I do a where icebox.exe it shows both locations, bin and bin/x64, how do I ensure I am using the 32 bit version of icebox?

    I'm going to revert the appending of the d, and run with iceboxd, will let you know how it goes.

    Jon
  • Well hell, when I run iceboxd I get an sxs error... I don't think ICE likes me :(

    I think I'm starting to see my issue... It seems as tho you are unable to have a system configured for using both C++ and C# versions of ICE on a 64bit platform, I think a solution to this would be to move third party dependencies to their own bin folder.
  • mes
    mes California
    The d suffix is required for debug builds. This convention is used for Ice plug-ins as well as for IceBox services.

    The simplest way to guarantee that you are using the 32-bit version of the IceBox executable is to specify the full path on the command line. For example, assuming you are using a debug build:

    > set ICE_HOME=C:\Program Files (x86)\ZeroC\Ice-3.4.1
    > "%ICE_HOME%\bin\iceboxd.exe" --Ice.Config=config.icebox

    Keep in mind however that dependent DLLs (such as ice34d.dll) will be resolved by searching your PATH, so it's a good idea to put the 32-bit bin directory at the head of your PATH:

    > set ICE_HOME=C:\Program Files (x86)\ZeroC\Ice-3.4.1
    > set PATH=%ICE_HOME%\bin;%PATH%
    > "%ICE_HOME%\bin\iceboxd.exe" --Ice.Config=config.icebox

    Regards,
    Mark
  • Yup, that was it! Thanks for the help, nothing like good old versioning issues!

    Thanks again!

    Jon
  • IceBox Problems

    I'm having similar problems getting my icebox service to start successfully.

    I'm running Windows 7 x64, using Visual Studio 2010 with ice plugin....

    I set my path variable to only point to the \bin folder rather than to also include the 64-bit versions.

    Visual studio successfully builds the .dll in either Release or Debug mode.

    When I attempt to run iceboxd I get an error saying "The application has failed to start because its side-by-side configuration is incorrect", which I have no idea how to debug.

    When I attempt to run with icebox.exe I get an access violation which seems to occur when the start method is invoked within the icebox service.


    Here is the code defining the service:
    void DataSourceSimService::start(const std::string& name, const Ice::CommunicatorPtr& communicator, const Ice::StringSeq& args){
    	std::cout << "starting data source sim service" <<std::endl;
    	_adapter = communicator->createObjectAdapter(name);
    	std::cout << "object adapter created" << std::endl;
    	Ice::ObjectPtr object = new QuoteServer::DataSourceSim();
    	std::cout << "dataSourceSim instantiated" <<std::endl;
    	_adapter->add(object, communicator->stringToIdentity("DataSourceSim"));
    	std::cout << "DataSourceSim object added to adapter" << std::endl;
    	_adapter->activate();
    	std::cout << "finished starting service";
    }
    void DataSourceSimService::stop(){
    	_adapter->deactivate();
    }
    
    //Based on example in manual
    extern "C" {
    DATASOURCESIM_API IceBox::Service*
    create(Ice::CommunicatorPtr communicator){
    	return new DataSourceSimService;
    }
    }
    
    #include <IceBox/IceBox.h>
    
    #if defined(_WIN32) //Manual version only
    #	define DATASOURCESIM_API __declspec(dllexport)
    #else
    #	define DATASOURCESIM_API
    #endif
    
    class DATASOURCESIM_API DataSourceSimService : public IceBox::Service{
    public:
    	virtual void start(const std::string&, const Ice::CommunicatorPtr&, const Ice::StringSeq&);
    	virtual void stop();
    
    private:
    	Ice::ObjectAdapterPtr _adapter;
    };
    

    Here is the output from icebox.exe:
    starting data source sim service
    -- 03/10/11 13:39:07.748 icebox-DataSourceSim: Network: accepting tcp connections at 0.0.0.0:9997
        local interfaces: 192.168.1.110, 127.0.0.1
    -- 03/10/11 13:39:07.769 icebox-DataSourceSim: Network: published endpoints for object adapter 'DataSourceSim':
       tcp -h 192.168.1.110 -p 9997
    object adapter created
    dataSourceSim instantiated
    

    So I'm not really sure where to go from here. Since I can't get the debug version to work I'm not sure how to debug this....Any help would be greatly appreciated.
  • bernard
    bernard Jupiter, FL
    Hi Noah,

    Are you using the correct binaries?

    Since you are using Visual Studio 2010, you need to use the binaries in the bin\vc10 or bin\vc10\x64 directory, and not the binaries in the main bin directory (or bin\x64) (these binaries are for Visual Studio 2008).

    Best regards,
    Bernard
  • I only have a vc100 directory, and not a vc10 directory, but setting my path variable to point here seems to have done it. Thanks for the help.