You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Radha Manickam <ra...@gmail.com> on 2011/06/07 14:03:37 UTC

Connection problem in using Activemq-CPP

Hi All,

I am using activemq-cpp 3.4.0, apache-log4cxx 0.10.0, apr 1.3.8, apr-util
1.3.9 in my library.

And i am using HPUX 11iV2 and aCC for compiling.

I am successfully compiled the above said libraries and also my library.
But when i executed a sample using my library, I am not able to get the
connection.

Can anyone help me in solving this issue?

Thanks,
Radha.

--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-problem-in-using-Activemq-CPP-tp3579368p3579368.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Connection problem in using Activemq-CPP

Posted by Radha Manickam <ra...@gmail.com>.
Hi Tim,

The broker is running in the specified port.
But the sample given with activemq-cpp is running fine.
The only difference is that my sample is an executable. The activemq sample
output is in text format.

Thanks,
Radha.

On Thu, Jun 9, 2011 at 8:13 PM, Timothy Bish [via ActiveMQ] <
ml-node+3585765-1108352484-139431@n4.nabble.com> wrote:

> On Wed, 2011-06-08 at 21:38 -0700, Radha Manickam wrote:
>
> > Hi Tim,
> >
> > I didnt get any error. But the sample application i hanging somewhere.
> > So I have added some debug strings in the activemq library and tried.
> >
> > It is hanging in the method Connection->Start.
> > After some debugging i found that it got struck in the method syncRequest
> in
> > the ActiveMQConnection class(while getting the response from the
> transport.
> >
> > I have pasted the code with the debug strings that i have added:
> >
> > Pointer<Response> ActiveMQConnection::syncRequest( Pointer<Command>
> command,
> > unsigned int timeout ) {
> >
> >     try {
> > cout << "Entering sycnRequest\n";
> >         checkClosedOrFailed();
> > cout << "Checked if closed or failed\n";
> >         Pointer<Response> response;
> > cout << "Checking for the timeout value\n";
> >         if( timeout == 0 ) {
> > cout << "Timeout is zero\n";
> >             response = this->config->transport->request( command );
> >         } else {
> > cout << "Timeout is non-zero\n";
> >             response = this->config->transport->request( command, timeout
> );
> >         }
> > cout << "Creating the exception response\n";
> >         commands::ExceptionResponse* exceptionResponse =
> >             dynamic_cast&lt;ExceptionResponse*&gt;( response.get() );
> > cout << "Created\n";
> >         if( exceptionResponse != NULL ) {
> > cout << "Exception response is not null\n";
> >             // Create an exception to hold the error information.
> >             BrokerException exception( __FILE__, __LINE__,
> > exceptionResponse->getException().get() );
> > cout << "throwing the the exception response\n";
> >             // Throw the exception.
> >             throw exception;
> >         }
> > cout << "Leaving and returning the response\n";
> >         return response;
> >     }
> >     AMQ_CATCH_RETHROW( ActiveMQException )
> >     AMQ_CATCH_EXCEPTION_CONVERT( IOException, ActiveMQException )
> >     AMQ_CATCH_EXCEPTION_CONVERT(
> > decaf::lang::exceptions::UnsupportedOperationException, ActiveMQException
> )
> >     AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
> >     AMQ_CATCHALL_THROW( ActiveMQException )
> > }
> >
> >
> > The output i got is as follows:
> >
> > Pinging the broker
> > Entering sycnRequest
> > Checked if closed or failed
> > Checking for the timeout value
> > Timeout is zero
> >
> > After this line the application got hanged.
> >
> >
>
>
> That sounds like normal behavior when the client is attempting to
> connect but there is no broker available and you have the failover
> transport enabled.  Is there a broker running on the ip / port you've
> specified?
>
> Regards
>
> --
> Tim Bish
> ------------
> FuseSource
> Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=3585765&i=0>
> Web: http://fusesource.com
> Twitter: tabish121
> Blog: http://timbish.blogspot.com/
>
>
>
>
>
> ------------------------------
>   If you reply to this email, your message will be added to the discussion
> below:
>
> http://activemq.2283324.n4.nabble.com/Connection-problem-in-using-Activemq-CPP-tp3579368p3585765.html
>   To unsubscribe from Connection problem in using Activemq-CPP, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3579368&code=cmFkaGFtYW5pY2thbUBnbWFpbC5jb218MzU3OTM2OHwtMTc1OTA2NDE2Ng==>.
>
>


--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-problem-in-using-Activemq-CPP-tp3579368p3587402.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Connection problem in using Activemq-CPP

Posted by Timothy Bish <ta...@gmail.com>.
On Wed, 2011-06-08 at 21:38 -0700, Radha Manickam wrote:
> Hi Tim,
> 
> I didnt get any error. But the sample application i hanging somewhere.
> So I have added some debug strings in the activemq library and tried.
> 
> It is hanging in the method Connection->Start. 
> After some debugging i found that it got struck in the method syncRequest in
> the ActiveMQConnection class(while getting the response from the transport.
> 
> I have pasted the code with the debug strings that i have added:
> 
> Pointer<Response> ActiveMQConnection::syncRequest( Pointer<Command> command,
> unsigned int timeout ) {
> 
>     try {
> 		cout << "Entering sycnRequest\n";
>         checkClosedOrFailed();
> 		cout << "Checked if closed or failed\n";
>         Pointer<Response> response;
> 		cout << "Checking for the timeout value\n";
>         if( timeout == 0 ) {
> 			cout << "Timeout is zero\n";
>             response = this->config->transport->request( command );
>         } else {
> 			cout << "Timeout is non-zero\n";
>             response = this->config->transport->request( command, timeout );
>         }
> 		cout << "Creating the exception response\n";
>         commands::ExceptionResponse* exceptionResponse =
>             dynamic_cast&lt;ExceptionResponse*&gt;( response.get() );
> 		cout << "Created\n";
>         if( exceptionResponse != NULL ) {
> 			cout << "Exception response is not null\n";
>             // Create an exception to hold the error information.
>             BrokerException exception( __FILE__, __LINE__,
> exceptionResponse->getException().get() );
> 			cout << "throwing the the exception response\n";
>             // Throw the exception.
>             throw exception;
>         }
> 		cout << "Leaving and returning the response\n";
>         return response;
>     }
>     AMQ_CATCH_RETHROW( ActiveMQException )
>     AMQ_CATCH_EXCEPTION_CONVERT( IOException, ActiveMQException )
>     AMQ_CATCH_EXCEPTION_CONVERT(
> decaf::lang::exceptions::UnsupportedOperationException, ActiveMQException )
>     AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
>     AMQ_CATCHALL_THROW( ActiveMQException )
> }
> 
> 
> The output i got is as follows:
> 
> Pinging the broker
> Entering sycnRequest
> Checked if closed or failed
> Checking for the timeout value
> Timeout is zero
> 
> After this line the application got hanged.
> 
> 


That sounds like normal behavior when the client is attempting to
connect but there is no broker available and you have the failover
transport enabled.  Is there a broker running on the ip / port you've
specified?

Regards

-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/




Re: Connection problem in using Activemq-CPP

Posted by Radha Manickam <ra...@gmail.com>.
Hi Tim,

I didnt get any error. But the sample application i hanging somewhere.
So I have added some debug strings in the activemq library and tried.

It is hanging in the method Connection->Start. 
After some debugging i found that it got struck in the method syncRequest in
the ActiveMQConnection class(while getting the response from the transport.

I have pasted the code with the debug strings that i have added:

Pointer<Response> ActiveMQConnection::syncRequest( Pointer<Command> command,
unsigned int timeout ) {

    try {
		cout << "Entering sycnRequest\n";
        checkClosedOrFailed();
		cout << "Checked if closed or failed\n";
        Pointer<Response> response;
		cout << "Checking for the timeout value\n";
        if( timeout == 0 ) {
			cout << "Timeout is zero\n";
            response = this->config->transport->request( command );
        } else {
			cout << "Timeout is non-zero\n";
            response = this->config->transport->request( command, timeout );
        }
		cout << "Creating the exception response\n";
        commands::ExceptionResponse* exceptionResponse =
            dynamic_cast&lt;ExceptionResponse*&gt;( response.get() );
		cout << "Created\n";
        if( exceptionResponse != NULL ) {
			cout << "Exception response is not null\n";
            // Create an exception to hold the error information.
            BrokerException exception( __FILE__, __LINE__,
exceptionResponse->getException().get() );
			cout << "throwing the the exception response\n";
            // Throw the exception.
            throw exception;
        }
		cout << "Leaving and returning the response\n";
        return response;
    }
    AMQ_CATCH_RETHROW( ActiveMQException )
    AMQ_CATCH_EXCEPTION_CONVERT( IOException, ActiveMQException )
    AMQ_CATCH_EXCEPTION_CONVERT(
decaf::lang::exceptions::UnsupportedOperationException, ActiveMQException )
    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
    AMQ_CATCHALL_THROW( ActiveMQException )
}


The output i got is as follows:

Pinging the broker
Entering sycnRequest
Checked if closed or failed
Checking for the timeout value
Timeout is zero

After this line the application got hanged.


Thanks,
Radha.

--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-problem-in-using-Activemq-CPP-tp3579368p3584424.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Connection problem in using Activemq-CPP

Posted by Timothy Bish <ta...@gmail.com>.
On Tue, 2011-06-07 at 21:43 -0700, Radha Manickam wrote:
> Hi Tim,
> 
> I am using in the sameway that in the sample given in activemq-cpp.
> 
> I am attaching the Makefile for the library with this reply.
> And the arguments for Makefile is as follows:
> 
> make OS=hp-ux ARCH=64 VERSION=6.0.0.20000 FLAGS=-mlp64 OSDEF=HPUX CXXCH=aCC
> INSTALLPATH=/kla-tencor/udb/KTFL/Libraries/
> 
> 
> This is how i am compiling the sample:
> 
> aCC -DPIC +Maked -DHPUX11 -D_REENTRANT  -D_HPUX_SOURCE -mt -c +DD64
> -I/kla-tencor/udb/KTFL/Libraries/64bit/include
> -I/kla-tencor/udb/KTFL/Libraries/64bit/include/apr-1 
> -I/kla-tencor/udb/KTFL/Libraries/64bit/include/activemq-cpp-3.4.0
> -I/kla-tencor/udb/KTFL/Libraries/64bit/include
> -I/kla-tencor/udb/KTFL/Libraries/64bit/include/log4cxx
> -I/kla-tencor/udb/KTFL/Libraries/64bit/include/LMClient -o LMClientImpl.o
> LMClientImpl.cpp
> 
> aCC -DPIC +Maked -DHPUX11 -D_REENTRANT  -D_HPUX_SOURCE -mt -c +DD64
> -I/kla-tencor/udb/KTFL/Libraries/64bit/include
> -I/kla-tencor/udb/KTFL/Libraries/64bit/include/apr-1
> -I/kla-tencor/udb/KTFL/Libraries/64bit/include/activemq-cpp-3.4.0
> -I/kla-tencor/udb/KTFL/Libraries/64bit/include
> -I/kla-tencor/udb/KTFL/Libraries/64bit/include/log4cxx
> -I/kla-tencor/udb/KTFL/Libraries/64bit/include/LMClient -o main.o main.cpp
> 
> aCC -DHPUX11 -D_REENTRANT -D_HPUX_SOURCE +DD64 -mt +DD64 -o LMClient
> LMClientImpl.o main.o -L/kla-tencor/udb/KTFL/Libraries/64bit/lib -lapr-1
> -laprutil-1 -lactivemq-cpp -llog4cxx -lLMClient -mt -Wl,+b
> -Wl,/kla-tencor/udb/KTFL/Libraries/64bit/lib
> 
> 

You still haven't defined what sort of error you are seeing when trying
to connect so I still don't have any suggestions, if its building that's
a good sign.  Have you built and run the unit tests?


-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/




Re: Connection problem in using Activemq-CPP

Posted by Radha Manickam <ra...@gmail.com>.
Hi Tim,

I am using in the sameway that in the sample given in activemq-cpp.

I am attaching the Makefile for the library with this reply.
And the arguments for Makefile is as follows:

make OS=hp-ux ARCH=64 VERSION=6.0.0.20000 FLAGS=-mlp64 OSDEF=HPUX CXXCH=aCC
INSTALLPATH=/kla-tencor/udb/KTFL/Libraries/


This is how i am compiling the sample:

aCC -DPIC +Maked -DHPUX11 -D_REENTRANT  -D_HPUX_SOURCE -mt -c +DD64
-I/kla-tencor/udb/KTFL/Libraries/64bit/include
-I/kla-tencor/udb/KTFL/Libraries/64bit/include/apr-1 
-I/kla-tencor/udb/KTFL/Libraries/64bit/include/activemq-cpp-3.4.0
-I/kla-tencor/udb/KTFL/Libraries/64bit/include
-I/kla-tencor/udb/KTFL/Libraries/64bit/include/log4cxx
-I/kla-tencor/udb/KTFL/Libraries/64bit/include/LMClient -o LMClientImpl.o
LMClientImpl.cpp

aCC -DPIC +Maked -DHPUX11 -D_REENTRANT  -D_HPUX_SOURCE -mt -c +DD64
-I/kla-tencor/udb/KTFL/Libraries/64bit/include
-I/kla-tencor/udb/KTFL/Libraries/64bit/include/apr-1
-I/kla-tencor/udb/KTFL/Libraries/64bit/include/activemq-cpp-3.4.0
-I/kla-tencor/udb/KTFL/Libraries/64bit/include
-I/kla-tencor/udb/KTFL/Libraries/64bit/include/log4cxx
-I/kla-tencor/udb/KTFL/Libraries/64bit/include/LMClient -o main.o main.cpp

aCC -DHPUX11 -D_REENTRANT -D_HPUX_SOURCE +DD64 -mt +DD64 -o LMClient
LMClientImpl.o main.o -L/kla-tencor/udb/KTFL/Libraries/64bit/lib -lapr-1
-laprutil-1 -lactivemq-cpp -llog4cxx -lLMClient -mt -Wl,+b
-Wl,/kla-tencor/udb/KTFL/Libraries/64bit/lib


Thanks & Regards,
Radha.

http://activemq.2283324.n4.nabble.com/file/n3581623/Makefile Makefile 

--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-problem-in-using-Activemq-CPP-tp3579368p3581623.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Connection problem in using Activemq-CPP

Posted by Timothy Bish <ta...@gmail.com>.
On Tue, 2011-06-07 at 05:03 -0700, Radha Manickam wrote:
> Hi All,
> 
> I am using activemq-cpp 3.4.0, apache-log4cxx 0.10.0, apr 1.3.8, apr-util
> 1.3.9 in my library.
> 
> And i am using HPUX 11iV2 and aCC for compiling.
> 
> I am successfully compiled the above said libraries and also my library.
> But when i executed a sample using my library, I am not able to get the
> connection.
> 
> Can anyone help me in solving this issue?
> 
> Thanks,
> Radha.
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Connection-problem-in-using-Activemq-CPP-tp3579368p3579368.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

We'd need to see some info on what the actual connection problems you
seeing are, exceptions, error messages etc.  Some sample code to show
how you are using the lib would help.  I can't really say from the above
info what could be going wrong.

Regards

-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/