Archived

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

basic freeze problem

Hello:

I,m traying make a basic application with evictor, when a link it:

TiendaWebApplication.o(.gnu.linkonce.t._ZN12TiendaWebApp9runFreezeEiPPcRKN11IceInternal6HandleIN6Freeze13DBEnvironmentEEE+0x179): In function `TiendaWebApp::runFreeze(int, char**, IceInternal::Handle<Freeze::DBEnvironment> const&)':
: undefined reference to `WebServices::TiendaWebI::_adapter'

TiendaWebApplication.o(.gnu.linkonce.t._ZN12TiendaWebApp9runFreezeEiPPcRKN11IceInternal6HandleIN6Freeze13DBEnvironmentEEE+0x4a7): In function `TiendaWebApp::runFreeze(int, char**, IceInternal::Handle<Freeze::DBEnvironment> const&)':
: undefined reference to `WebServices::TiendaWebI::_evictor'

class TiendaWebI : virtual public TiendaWeb
{
public:
TiendaWebI(const ObjectAdapterPtr& , const DBPtr& , const EvictorPtr& );
virtual ProductViewPrx createProduct(const Ice::Current &);
virtual Products getProducts ( const Ice::Current &) const;
void removeProduct(const Ice::Current &);

static Ice::ObjectAdapterPtr _adapter;
static Freeze::DBPtr _db;
static Freeze::EvictorPtr _evictor;
static ProductPersistentMap _objectsMap;
};


TiendaWebApplication virtual int runFreeze(int, char *[],const Freeze::DBEnvironmentPtr & dbEnv)
{
Freeze::DBPtr db = dbEnv->openDB("tiendaWebFs",true);
// Create an object adapter
TiendaWebI::_adapter=communicator()->createObjectAdapterWithEndpoints("TiendaWebService","default -p 10000");
Ice::ObjectFactoryPtr factory = new TiendaWebFactory();
communicator()->addObjectFactory(factory, ProductView::ice_staticId() );
Freeze::PersistenceStrategyPtr strategy= db->createEvictionStrategy();
TiendaWebI::_evictor=db->createEvictor(strategy);
TiendaWebI::_adapter->addServantLocator(TiendaWebI::_evictor,"");
TiendaWebI::_adapter->activate();
communicator()->waitForShutdown();
if(interrupted())
{
cerr<<appName()<<": received signal, shutting down"<<endl;
}
};

thanks, and congratulations for Ice , i'd like pay you when sombody pay me :D , thanks

Comments

  • mes
    mes California
    Hi,

    Did you remember to define your static members for TiendaWebI?

    For example:

    Ice::ObjectAdapterPtr TiendaWebI::_adapter;
    Freeze::DBPtr TiendaWebI::_db;
    Freeze::EvictorPtr TiendaWebI::_evictor;
    ProductPersistentMap TiendaWebI::_objectsMap;

    If you're still having trouble, it would help us to see more of your code.

    Take care,
    - Mark