Re: CMS: Installed 3.0.1 but my existing code

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: CMS: Installed 3.0.1 but my existing code

by Timothy Bish :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2009-10-01 at 18:43 -0700, nmittal wrote:
> fails to run. The code has been running on ActiveMQ CPP 2.2.5. I recompiled
> the code with 3.0.1 but get the following error...
>
> No Matching Factory Registered for format := tcp
>         FILE: activemq/transport/TransportRegistry.cpp, LINE: 50
>         FILE: activemq/core/ActiveMQConnectionFactory.cpp, LINE: 154
>
> thanks for your help.
>

You need to call the initialize method for the AMQCPP library:

    activemq::library::ActiveMQCPP::initializeLibrary();

On shutdown you need to call the shutdown method as well to ensure all
the open resources are freed.

    activemq::library::ActiveMQCPP::shutdownLibrary();


Take a look at the examples in the 3.0.1 source distribution.

Regards
Tim.
--
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Re: CMS: Installed 3.0.1 but my existing code

by nmittal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Tim, as suggested, I added the lines but when I do a make I get the following errors... (the same code built fine with 2.2.5

$ make
make: Warning: File `../Libraries/ActiveMQ/activemq.cpp' has modification time 7 s in the future
g++ -g -ggdb -I. -I/usr/local/include/activemq-cpp-3.0.1 -I/usr/local/apr/include/apr-1 -I/usr/local/include/boost -c -o ../Libraries/ActiveMQ/activemq.o ../Libraries/ActiveMQ/activemq.cpp
../Libraries/ActiveMQ/activemq.cpp: In member function ‘void clAMQ::connect()’:
../Libraries/ActiveMQ/activemq.cpp:6: error: ‘auto_ptr’ was not declared in this scope
../Libraries/ActiveMQ/activemq.cpp:6: error: expected primary-expression before ‘>’ token
../Libraries/ActiveMQ/activemq.cpp:7: error: ‘connectionFactory’ was not declared in this scope
../Libraries/ActiveMQ/activemq.cpp: In constructor ‘clAMQ::clAMQ(std::string&)’:
../Libraries/ActiveMQ/activemq.cpp:706: error: ‘activemq::library’ has not been declared
../Libraries/ActiveMQ/activemq.cpp: In member function ‘void clAMQ::cleanup()’:
../Libraries/ActiveMQ/activemq.cpp:773: error: ‘activemq::library’ has not been declared
make: *** [../Libraries/ActiveMQ/activemq.o] Error 1

my header file has the following...

#include <activemq/util/Config.h>
#include <cms/Connection.h>
#include <cms/Session.h>
#include <cms/TextMessage.h>
#include <cms/BytesMessage.h>
#include <cms/MapMessage.h>
#include <cms/ExceptionListener.h>
#include <cms/MessageListener.h>
#include <string>

using namespace activemq;
using namespace activemq::core;
using namespace decaf;
using namespace decaf::lang;
using namespace decaf::util;
using namespace decaf::util::concurrent;
using namespace cms;
using namespace std;

thanks for your help.

Nishant


Timothy Bish wrote:
On Thu, 2009-10-01 at 18:43 -0700, nmittal wrote:
> fails to run. The code has been running on ActiveMQ CPP 2.2.5. I recompiled
> the code with 3.0.1 but get the following error...
>
> No Matching Factory Registered for format := tcp
>         FILE: activemq/transport/TransportRegistry.cpp, LINE: 50
>         FILE: activemq/core/ActiveMQConnectionFactory.cpp, LINE: 154
>
> thanks for your help.
>

You need to call the initialize method for the AMQCPP library:

    activemq::library::ActiveMQCPP::initializeLibrary();

On shutdown you need to call the shutdown method as well to ensure all
the open resources are freed.

    activemq::library::ActiveMQCPP::shutdownLibrary();


Take a look at the examples in the 3.0.1 source distribution.

Regards
Tim.
--
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/



Re: CMS: Installed 3.0.1 but my existing code

by nmittal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I fixed the errors by adding...
#include <memory>
#include <activemq/library/ActiveMQCPP.h>

thanks
Nishant


Hi Tim, as suggested, I added the lines but when I do a make I get the following errors... (the same code built fine with 2.2.5

$ make
make: Warning: File `../Libraries/ActiveMQ/activemq.cpp' has modification time 7 s in the future
g++ -g -ggdb -I. -I/usr/local/include/activemq-cpp-3.0.1 -I/usr/local/apr/include/apr-1 -I/usr/local/include/boost -c -o ../Libraries/ActiveMQ/activemq.o ../Libraries/ActiveMQ/activemq.cpp
../Libraries/ActiveMQ/activemq.cpp: In member function ‘void clAMQ::connect()’:
../Libraries/ActiveMQ/activemq.cpp:6: error: ‘auto_ptr’ was not declared in this scope
../Libraries/ActiveMQ/activemq.cpp:6: error: expected primary-expression before ‘>’ token
../Libraries/ActiveMQ/activemq.cpp:7: error: ‘connectionFactory’ was not declared in this scope
../Libraries/ActiveMQ/activemq.cpp: In constructor ‘clAMQ::clAMQ(std::string&)’:
../Libraries/ActiveMQ/activemq.cpp:706: error: ‘activemq::library’ has not been declared
../Libraries/ActiveMQ/activemq.cpp: In member function ‘void clAMQ::cleanup()’:
../Libraries/ActiveMQ/activemq.cpp:773: error: ‘activemq::library’ has not been declared
make: *** [../Libraries/ActiveMQ/activemq.o] Error 1

my header file has the following...

#include <activemq/util/Config.h>
#include <cms/Connection.h>
#include <cms/Session.h>
#include <cms/TextMessage.h>
#include <cms/BytesMessage.h>
#include <cms/MapMessage.h>
#include <cms/ExceptionListener.h>
#include <cms/MessageListener.h>
#include <string>

using namespace activemq;
using namespace activemq::core;
using namespace decaf;
using namespace decaf::lang;
using namespace decaf::util;
using namespace decaf::util::concurrent;
using namespace cms;
using namespace std;

thanks for your help.

Nishant


Timothy Bish wrote:
On Thu, 2009-10-01 at 18:43 -0700, nmittal wrote:
> fails to run. The code has been running on ActiveMQ CPP 2.2.5. I recompiled
> the code with 3.0.1 but get the following error...
>
> No Matching Factory Registered for format := tcp
>         FILE: activemq/transport/TransportRegistry.cpp, LINE: 50
>         FILE: activemq/core/ActiveMQConnectionFactory.cpp, LINE: 154
>
> thanks for your help.
>

You need to call the initialize method for the AMQCPP library:

    activemq::library::ActiveMQCPP::initializeLibrary();

On shutdown you need to call the shutdown method as well to ensure all
the open resources are freed.

    activemq::library::ActiveMQCPP::shutdownLibrary();


Take a look at the examples in the 3.0.1 source distribution.

Regards
Tim.
--
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/