You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by JavyRocks <ja...@gmail.com> on 2013/04/09 01:44:20 UTC

No IConnectionFactory implementation found for connection URI: activemq:tcp://localhost:61616

*I still get the "No IConnectionFactory implementation found for connection
URI: activemq:tcp://localhost:61616" Error. I've paste and include in the
compile project the archive "nmsprovider-activemq.config" 
I'm Working with .NET 4.0 and the references are 
Apache.NMS-1.5.1-bin.zip\net-4.0\release

The code is very estandar and simple but I can't get throw the connection
error*

    using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Apache.NMS;
using Apache.NMS.Util;
using System.Collections;
using System.Reflection;
using System.IO;

namespace ConexionActiveMQ
{
    class Program
    {
        private static string[] GetConfigSearchPaths()
        {
            ArrayList pathList = new ArrayList();

            // Check the current folder first.
            pathList.Add("");
            AppDomain currentDomain = AppDomain.CurrentDomain;

            // Check the folder the assembly is located in.

           
pathList.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
            if (null != currentDomain.BaseDirectory)
            {
                pathList.Add(currentDomain.BaseDirectory);
            }

            if (null != currentDomain.RelativeSearchPath)
            {
                pathList.Add(currentDomain.RelativeSearchPath);
            }

            return (string[])pathList.ToArray(typeof(string));
        }

        static void Main(string[] args)
        {
            string[] direcciones;
            direcciones = GetConfigSearchPaths();
            // Example connection strings:
            //    activemq:tcp://localhost:61616
            //    stomp:tcp://activemqhost:61613
            //    ems:tcp://tibcohost:7222
            //    msmq://localhost

            Uri connecturi = new Uri("activemq:tcp://localhost:61616");

            Console.WriteLine("About to connect to " + connecturi);

            // NOTE: ensure the nmsprovider-activemq.config file exists in
the executable folder.
            IConnectionFactory factory = new
NMSConnectionFactory(connecturi);

            using (IConnection connection = factory.CreateConnection())
            using (ISession session = connection.CreateSession())
            {
                // Examples for getting a destination:
                //
                // Hard coded destinations:
                //    IDestination destination =
session.GetQueue("FOO.BAR");
                //    Debug.Assert(destination is IQueue);
                //    IDestination destination =
session.GetTopic("FOO.BAR");
                //    Debug.Assert(destination is ITopic);
                //
                // Embedded destination type in the name:
                //    IDestination destination =
SessionUtil.GetDestination(session, "queue://FOO.BAR");
                //    Debug.Assert(destination is IQueue);
                //    IDestination destination =
SessionUtil.GetDestination(session, "topic://FOO.BAR");
                //    Debug.Assert(destination is ITopic);
                //
                // Defaults to queue if type is not specified:
                //    IDestination destination =
SessionUtil.GetDestination(session, "FOO.BAR");
                //    Debug.Assert(destination is IQueue);
                //
                // .NET 3.5 Supports Extension methods for a simplified
syntax:
                //    IDestination destination =
session.GetDestination("queue://FOO.BAR");
                //    Debug.Assert(destination is IQueue);
                //    IDestination destination =
session.GetDestination("topic://FOO.BAR");
                //    Debug.Assert(destination is ITopic);

                IDestination destination =
SessionUtil.GetDestination(session, "queue://FOO.BAR");
                Console.WriteLine("Using destination: " + destination);

                // Create a consumer and producer
                using (IMessageConsumer consumer =
session.CreateConsumer(destination))
                using (IMessageProducer producer =
session.CreateProducer(destination))
                {
                    // Start the connection so that messages will be
processed.
                    connection.Start();
                    //producer.Persisten = true;

                    // Send a message
                    ITextMessage request = session.CreateTextMessage("Hello
World!");
                    request.NMSCorrelationID = "abc";
                    request.Properties["NMSXGroupID"] = "cheese";
                    request.Properties["myHeader"] = "Cheddar";

                    producer.Send(request);

                    // Consume a message
                    ITextMessage message = consumer.Receive() as
ITextMessage;
                    if (message == null)
                    {
                        Console.WriteLine("No message received!");
                    }
                    else
                    {
                        Console.WriteLine("Received message with ID:   " +
message.NMSMessageId);
                        Console.WriteLine("Received message with text: " +
message.Text);
                    }
                }
            }
        }
    }
}




--
View this message in context: http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: No IConnectionFactory implementation found for connection URI: activemq:tcp://localhost:61616

Posted by JavyRocks <ja...@gmail.com>.
Hola 
Quisiera dejar mi aporte ya que por más que busque no encontré una
documentación apropiada para mis necesidades especificas

Algo que me dijera cómo conectarme a ActiveMQ desde .NET usando VB y en
español

Uno de los problemas más comunes que encontré es que existen muchas
versiones y no se especifica de manera clara como se realizó el ejemplo

En el ejemplo iré especificando la versión de cada uno de los componentes 

Los pasos a seguir
Son

	1. Descargar el Java JDK desde el siguiente link
		http://www.oracle.com/technetwork/es/java/javase/downloads/index.html
	2. Instalarlo y configurar la variable global JAVA_HOME
	3. Descargar el servidor ActiveMQ 5.8
		http://activemq.apache.org/activemq-580-release.html
		a. Instalar según la guia
	4. Descargar las DLLs de interconexión .NET - ActiveMQ 
		a. NMS version 1.4.0
			i. http://activemq.apache.org/nms/apachenms-api-v140.html
	5. Crear un proyecto nuevo en el visual studio con framework 3.5
	6. En el proyecto se deben adicionar las siguientes referencias
		ActiveMQ 1.4\build\net-3.5\debug
		                             Apache.NMS.ActiveMQ.dll
		                 ActiveMQ 1.4\lib\Apache.NMS\net-3.5
		                             Apache.NMS.dll
		
	7. Usar el siguiente código fuente en VB
	
Module Module1

    Sub Main()
        Call Verificar_Reportes_ActiveMQ()
    End Sub

    Public Function Verificar_Reportes_ActiveMQ() As Boolean
        
Try


            Dim conConexion As Uri
            Dim cofConnector As IConnectionFactory
            conConexion = New Uri("activemq:tcp://localhost:61616")
            'conConexion = New Uri(Me.objGeneral.DireccionMQ & ":" &
Me.objGeneral.PuertoMQ)
            cofConnector = New NMSConnectionFactory(conConexion)

            console.Text = "About to connect to " + conConexion.ToString

            'Using objConexion As IConnection =
cofConnector.CreateConnection("admin", "admin")
            Using objConexion As IConnection =
cofConnector.CreateConnection()
                Using objSesion As ISession = objConexion.CreateSession()

                    Dim objDestino As IDestination =
SessionUtil.GetDestination(objSesion, "queue://FOO.BAR")

                    Using objConsumidor As IMessageConsumer =
objSesion.CreateConsumer(objDestino)
                        Using objProductor As IMessageProducer =
objSesion.CreateProducer(objDestino)
                            objConexion.Start()

                            Dim objSolicitud As ITextMessage =
objSesion.CreateTextMessage("SoftTools Colombia Bogota")
                            objSolicitud.NMSCorrelationID = "abc"
                            objSolicitud.Properties("NMSXGroupID") =
"Javier"
                            objSolicitud.Properties("myHeader") =
"Castañeda"

                            objProductor.Send(objSolicitud)

                            Dim objMensajeRespuesta As ITextMessage =
objConsumidor.Receive

                            If Not IsNothing(objMensajeRespuesta) Then
                                MsgBox("Mensaje Recibido = " &
objMensajeRespuesta.Text)
                            End If

                        End Using
                    End Using
                End Using
            End Using

            Return True
        Catch ex As Exception
            MsgBox("Error" & ex.Message)
            Return False
        End Try
    End Function
End Module




--
View this message in context: http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743p4665863.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: No IConnectionFactory implementation found for connection URI: activemq:tcp://localhost:61616

Posted by JavyRocks <ja...@gmail.com>.
Active MQ
Hi Every One

I Hope this would help someone

In order to connect to an ActiveMQ Broker from .NET aplication using VB
language for really newbies 

Follow this Steps

1. Download Java JDK from this link 
http://www.oracle.com/technetwork/es/java/javase/downloads/index.html

2. Install and configure the JAVA_HOME variable

3. Download the ActiveMQ Server  5.8
http://activemq.apache.org/activemq-580-release.html
4. Follow the installation guide

5 Download the NMS DLLs 1.4.0
http://activemq.apache.org/nms/apachenms-api-v140.html


6. Start the server

7. Create a new project in Visual Studio targetting the 3.5 FrameWork

8. Add these References to the project
                 ActiveMQ 1.4\build\net-3.5\debug
                             Apache.NMS.ActiveMQ.dll
                 ActiveMQ 1.4\lib\Apache.NMS\net-3.5
                             Apache.NMS.dll

Use this code

Imports Apache.NMS
Imports Apache.NMS.ActiveMQ
Imports Apache.NMS.Util

Module Module1

    Sub Main()
        Call Verificar_Reportes_ActiveMQ()
    End Sub

    Public Function Verificar_Reportes_ActiveMQ() As Boolean
Try


            Dim conConexion As Uri
            Dim cofConnector As IConnectionFactory
            conConexion = New Uri("activemq:tcp://localhost:61616")
            'conConexion = New Uri(Me.objGeneral.DireccionMQ & ":" &
Me.objGeneral.PuertoMQ)
            cofConnector = New NMSConnectionFactory(conConexion)

            console.Text = "About to connect to " + conConexion.ToString

            'Using objConexion As IConnection =
cofConnector.CreateConnection("admin", "admin")
            Using objConexion As IConnection =
cofConnector.CreateConnection()
                Using objSesion As ISession = objConexion.CreateSession()

                    Dim objDestino As IDestination =
SessionUtil.GetDestination(objSesion, "queue://FOO.BAR")

                    Using objConsumidor As IMessageConsumer =
objSesion.CreateConsumer(objDestino)
                        Using objProductor As IMessageProducer =
objSesion.CreateProducer(objDestino)
                            objConexion.Start()

                            Dim objSolicitud As ITextMessage =
objSesion.CreateTextMessage("Javy Rocks")
                            objSolicitud.NMSCorrelationID = "abc"
                            objSolicitud.Properties("NMSXGroupID") =
"Javier"
                            objSolicitud.Properties("myHeader") =
"Castañeda"

                            objProductor.Send(objSolicitud)

                            Dim objMensajeRespuesta As ITextMessage =
objConsumidor.Receive

                            If Not IsNothing(objMensajeRespuesta) Then
                                MsgBox("Mensaje Recibido = " &
objMensajeRespuesta.Text)
                            End If

                        End Using
                    End Using
                End Using
            End Using

            Return True
        Catch ex As Exception
            MsgBox("Error" & ex.Message)
            Return False
        End Try




--
View this message in context: http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743p4665862.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: No IConnectionFactory implementation found for connection URI: activemq:tcp://localhost:61616

Posted by Jim Gomes <e....@gmail.com>.
If you are compiling with .NET 4.0, you can't use the Client Profile.
 You'll need to use the full version of .NET 4.0.

I check out the source and build the whole library myself, and everything
seems to work for me.  The NMSConnectionFactory.cs is part of the main
Apache.NMS project, not the Apache.NMS.ActiveMQ project.


On Tue, Apr 9, 2013 at 1:33 PM, JavyRocks <ja...@gmail.com> wrote:

> Hi
>
> I Finally make it Work
>
> But I have to changed it to Framework 3.5
>
> and Using the Apache.NMS-1.4.0-bin.zip
>
> The references was
>
> Apache.NMS
> Apache.NMS.ActiveMQ
>
>
> In my humble opinion theres something wrong with the 1.5 release
>
> I would put my whole code in VB.NET
> as soon as I finished it'd be my contribution
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743p4665787.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: No IConnectionFactory implementation found for connection URI: activemq:tcp://localhost:61616

Posted by JavyRocks <ja...@gmail.com>.
Hi

I Finally make it Work

But I have to changed it to Framework 3.5

and Using the Apache.NMS-1.4.0-bin.zip

The references was

Apache.NMS
Apache.NMS.ActiveMQ


In my humble opinion theres something wrong with the 1.5 release 

I would put my whole code in VB.NET 
as soon as I finished it'd be my contribution 



--
View this message in context: http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743p4665787.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: No IConnectionFactory implementation found for connection URI: activemq:tcp://localhost:61616

Posted by JavyRocks <ja...@gmail.com>.
I have a question

Which version are you using ?
For the DLLs

I just create an empty project try to do your same exercise and just before
getting the error de Visual Studio open a window asking for this file
NMSConnectionFactory.cs location 
I try to give it but it doesn't apear anyware in the source I have
Downloaded too

What its interesting is that in the test folder it does apear

<http://activemq.2283324.n4.nabble.com/file/n4665785/ActiveMQ_Error.png> 




--
View this message in context: http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743p4665785.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: No IConnectionFactory implementation found for connection URI: activemq:tcp://localhost:61616

Posted by Jim Gomes <e....@gmail.com>.
Here is the list of files that I have in my output folder:

Apache.NMS.ActiveMQ.dll
Apache.NMS.dll
Ionic.Zlib.dll
NMSFactoryTest.exe      (This is the name of project I created using your
sample code.)
NMSFactoryTest.exe.config   (This only has a declaration to use .NET 4.0
runtime.)


That's all that's needed to run, but they all must be in the same folder
together.



On Tue, Apr 9, 2013 at 10:56 AM, JavyRocks <ja...@gmail.com> wrote:

> Hellow a lot thanks for the attetion and Help so far
>
> But It doesn't work
>
> summering up
>
> I'm Developing for .Net 4.0
> I have the ActiveMQ Broker version 5.8 running
>
> I've downloaded the latest version Apache.NMS.ActiveMQ-1.5.6-bin.zip but
> this one doesn't come with the whole DLLs Just come with Apache.NMS and
> Apache.NMS.Test
>
> So I changed to work with the   Apache.NMS.ActiveMQ-1.5.5-bin.zip from this
> Link http://activemq.apache.org/nms/apachenmsactivemq-v155.html
>
> this one in particular has for the FrameWork 4.0
> the folowing DLLs
>
> Lib
>          Ionic.Zlib.dll
>          Apache.NMS.dll
>          Apache.NMS.Test.dll
>          nunit.framework.dll
> Build
>          Apache.NMS.ActiveMQ.dll
>          Apache.NMS.ActiveMQ.Test.dll
>
> Also I've included in my proyect the file
>        nmsprovider-activemq.config
>              Changed the property to copy always (To be included in the
> output)
>
> Still get the error in the line
>
> IConnectionFactory factory = new NMSConnectionFactory(connecturi);
>
>
> I've tried all the sugestions,
> According to JGomes I put those DLLs in the project and change the property
> to "copy if Newer"
> Got the error
> Changed to reference directly and also the error
>
>
> If U like I'd give remote access I kind of desperated
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743p4665777.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: No IConnectionFactory implementation found for connection URI: activemq:tcp://localhost:61616

Posted by JavyRocks <ja...@gmail.com>.
Hellow a lot thanks for the attetion and Help so far

But It doesn't work

summering up 

I'm Developing for .Net 4.0
I have the ActiveMQ Broker version 5.8 running 

I've downloaded the latest version Apache.NMS.ActiveMQ-1.5.6-bin.zip but
this one doesn't come with the whole DLLs Just come with Apache.NMS and
Apache.NMS.Test

So I changed to work with the 	Apache.NMS.ActiveMQ-1.5.5-bin.zip from this
Link http://activemq.apache.org/nms/apachenmsactivemq-v155.html

this one in particular has for the FrameWork 4.0 
the folowing DLLs 

Lib
         Ionic.Zlib.dll
         Apache.NMS.dll
         Apache.NMS.Test.dll
         nunit.framework.dll
Build
         Apache.NMS.ActiveMQ.dll
         Apache.NMS.ActiveMQ.Test.dll

Also I've included in my proyect the file
       nmsprovider-activemq.config
             Changed the property to copy always (To be included in the
output)

Still get the error in the line

IConnectionFactory factory = new NMSConnectionFactory(connecturi);


I've tried all the sugestions, 
According to JGomes I put those DLLs in the project and change the property
to "copy if Newer"
Got the error
Changed to reference directly and also the error


If U like I'd give remote access I kind of desperated










--
View this message in context: http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743p4665777.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: No IConnectionFactory implementation found for connection URI: activemq:tcp://localhost:61616

Posted by Jim Gomes <e....@gmail.com>.
Hello,

Your sample code works.  Here's what you need in order to run.


   1. The nmsprovider-activemq.config file is not necessary, since you are
   using the standard assemblies, so you can get rid of this if you want.
    It's an optional file, and I suggest not using it unless you are doing
   something advanced.
   2. You need to have Apache.NMS.dll, Apache.NMS.ActiveMQ.dll, and
   Ionic.Zlib.dll in your execution folder.  These are required.

I suspect that you are missing the Ionic.Zlib.dll.  The way I set up my
project is that I add a reference to Apache.NMS.dll.  I then add the
Apache.NMS.ActiveMQ.dll and Ionic.Zlib.dll as content files that are copied
to the output folder if they are newer, but I don't reference them directly.

Best,
Jim



On Tue, Apr 9, 2013 at 8:28 AM, JavyRocks <ja...@gmail.com> wrote:

> Hi
> It doesn't work either
>
> still get the same error
> This is the stack trace
>
>  at Apache.NMS.NMSConnectionFactory.CreateConnectionFactory(Uri
> uriProvider,
> Object[] constructorParams) in
> c:\dev\NMS\src\main\csharp\NMSConnectionFactory.cs:line 123
>    at Apache.NMS.NMSConnectionFactory..ctor(Uri uriProvider, Object[]
> constructorParams)
>
> in c:\dev\NMS\src\main\csharp\NMSConnectionFactory.cs:line 86
>    at ConexionActiveMQ.Program.Main(String[] args)
>
> in C:\Users\Administrator\documents\visual studio
> 2010\Projects\ConexionActiveMQ\ConexionActiveMQ\Program.cs:line 54
>    at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[]
> args)
>    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
> assemblySecurity, String[] args)
>    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
>    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
>    at System.Threading.ExecutionContext.RunInternal(ExecutionContext
> executionContext, ContextCallback callback, Object state, Boolean
> preserveSyncCtx)
>    at System.Threading.ExecutionContext.Run(ExecutionContext
> executionContext, ContextCallback callback, Object state, Boolean
> preserveSyncCtx)
>    at System.Threading.ExecutionContext.Run(ExecutionContext
> executionContext, ContextCallback callback, Object state)
> tabish121@gmail.com wrote
> > You need the Apache ActiveMQ NMS Provider.
> > http://activemq.apache.org/nms/apachenmsactivemq-v156.html
> >
> >
> > On 04/08/2013 07:44 PM, JavyRocks wrote:
> >> *I still get the "No IConnectionFactory implementation found for
> >> connection
> >> URI: activemq:tcp://localhost:61616" Error. I've paste and include in
> the
> >> compile project the archive "nmsprovider-activemq.config"
> >> I'm Working with .NET 4.0 and the references are
> >> Apache.NMS-1.5.1-bin.zip\net-4.0\release
> >>
> >> The code is very estandar and simple but I can't get throw the
> connection
> >> error*
> >>
> >>      using System;
> >> using System.Collections.Generic;
> >> using System.Linq;
> >> using System.Text;
> >> using Apache.NMS;
> >> using Apache.NMS.Util;
> >> using System.Collections;
> >> using System.Reflection;
> >> using System.IO;
> >>
> >> namespace ConexionActiveMQ
> >> {
> >>      class Program
> >>      {
> >>          private static string[] GetConfigSearchPaths()
> >>          {
> >>              ArrayList pathList = new ArrayList();
> >>
> >>              // Check the current folder first.
> >>              pathList.Add("");
> >>              AppDomain currentDomain = AppDomain.CurrentDomain;
> >>
> >>              // Check the folder the assembly is located in.
> >>
> >>
> >>
> pathList.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
> >>              if (null != currentDomain.BaseDirectory)
> >>              {
> >>                  pathList.Add(currentDomain.BaseDirectory);
> >>              }
> >>
> >>              if (null != currentDomain.RelativeSearchPath)
> >>              {
> >>                  pathList.Add(currentDomain.RelativeSearchPath);
> >>              }
> >>
> >>              return (string[])pathList.ToArray(typeof(string));
> >>          }
> >>
> >>          static void Main(string[] args)
> >>          {
> >>              string[] direcciones;
> >>              direcciones = GetConfigSearchPaths();
> >>              // Example connection strings:
> >>              //    activemq:tcp://localhost:61616
> >>              //    stomp:tcp://activemqhost:61613
> >>              //    ems:tcp://tibcohost:7222
> >>              //    msmq://localhost
> >>
> >>              Uri connecturi = new Uri("activemq:tcp://localhost:61616");
> >>
> >>              Console.WriteLine("About to connect to " + connecturi);
> >>
> >>              // NOTE: ensure the nmsprovider-activemq.config file exists
> >> in
> >> the executable folder.
> >>              IConnectionFactory factory = new
> >> NMSConnectionFactory(connecturi);
> >>
> >>              using (IConnection connection = factory.CreateConnection())
> >>              using (ISession session = connection.CreateSession())
> >>              {
> >>                  // Examples for getting a destination:
> >>                  //
> >>                  // Hard coded destinations:
> >>                  //    IDestination destination =
> >> session.GetQueue("FOO.BAR");
> >>                  //    Debug.Assert(destination is IQueue);
> >>                  //    IDestination destination =
> >> session.GetTopic("FOO.BAR");
> >>                  //    Debug.Assert(destination is ITopic);
> >>                  //
> >>                  // Embedded destination type in the name:
> >>                  //    IDestination destination =
> >> SessionUtil.GetDestination(session, "queue://FOO.BAR");
> >>                  //    Debug.Assert(destination is IQueue);
> >>                  //    IDestination destination =
> >> SessionUtil.GetDestination(session, "topic://FOO.BAR");
> >>                  //    Debug.Assert(destination is ITopic);
> >>                  //
> >>                  // Defaults to queue if type is not specified:
> >>                  //    IDestination destination =
> >> SessionUtil.GetDestination(session, "FOO.BAR");
> >>                  //    Debug.Assert(destination is IQueue);
> >>                  //
> >>                  // .NET 3.5 Supports Extension methods for a simplified
> >> syntax:
> >>                  //    IDestination destination =
> >> session.GetDestination("queue://FOO.BAR");
> >>                  //    Debug.Assert(destination is IQueue);
> >>                  //    IDestination destination =
> >> session.GetDestination("topic://FOO.BAR");
> >>                  //    Debug.Assert(destination is ITopic);
> >>
> >>                  IDestination destination =
> >> SessionUtil.GetDestination(session, "queue://FOO.BAR");
> >>                  Console.WriteLine("Using destination: " + destination);
> >>
> >>                  // Create a consumer and producer
> >>                  using (IMessageConsumer consumer =
> >> session.CreateConsumer(destination))
> >>                  using (IMessageProducer producer =
> >> session.CreateProducer(destination))
> >>                  {
> >>                      // Start the connection so that messages will be
> >> processed.
> >>                      connection.Start();
> >>                      //producer.Persisten = true;
> >>
> >>                      // Send a message
> >>                      ITextMessage request =
> >> session.CreateTextMessage("Hello
> >> World!");
> >>                      request.NMSCorrelationID = "abc";
> >>                      request.Properties["NMSXGroupID"] = "cheese";
> >>                      request.Properties["myHeader"] = "Cheddar";
> >>
> >>                      producer.Send(request);
> >>
> >>                      // Consume a message
> >>                      ITextMessage message = consumer.Receive() as
> >> ITextMessage;
> >>                      if (message == null)
> >>                      {
> >>                          Console.WriteLine("No message received!");
> >>                      }
> >>                      else
> >>                      {
> >>                          Console.WriteLine("Received message with ID:
> "
> >> +
> >> message.NMSMessageId);
> >>                          Console.WriteLine("Received message with text:
> "
> >> +
> >> message.Text);
> >>                      }
> >>                  }
> >>              }
> >>          }
> >>      }
> >> }
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743.html
> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >>
> >
> >
> >
> >
> > --
> > Tim Bish
> > Sr Software Engineer | RedHat Inc.
>
> > tim.bish@
>
> >  | www.fusesource.com | www.redhat.com
> > skype: tabish121 | twitter: @tabish121
> > blog: http://timbish.blogspot.com/
>
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743p4665767.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: No IConnectionFactory implementation found for connection URI: activemq:tcp://localhost:61616

Posted by JavyRocks <ja...@gmail.com>.
Hi
It doesn't work either

still get the same error
This is the stack trace

 at Apache.NMS.NMSConnectionFactory.CreateConnectionFactory(Uri uriProvider,
Object[] constructorParams) in
c:\dev\NMS\src\main\csharp\NMSConnectionFactory.cs:line 123
   at Apache.NMS.NMSConnectionFactory..ctor(Uri uriProvider, Object[]
constructorParams) 

in c:\dev\NMS\src\main\csharp\NMSConnectionFactory.cs:line 86
   at ConexionActiveMQ.Program.Main(String[] args) 

in C:\Users\Administrator\documents\visual studio
2010\Projects\ConexionActiveMQ\ConexionActiveMQ\Program.cs:line 54
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[]
args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
tabish121@gmail.com wrote
> You need the Apache ActiveMQ NMS Provider.
> http://activemq.apache.org/nms/apachenmsactivemq-v156.html
> 
> 
> On 04/08/2013 07:44 PM, JavyRocks wrote:
>> *I still get the "No IConnectionFactory implementation found for
>> connection
>> URI: activemq:tcp://localhost:61616" Error. I've paste and include in the
>> compile project the archive "nmsprovider-activemq.config"
>> I'm Working with .NET 4.0 and the references are
>> Apache.NMS-1.5.1-bin.zip\net-4.0\release
>>
>> The code is very estandar and simple but I can't get throw the connection
>> error*
>>
>>      using System;
>> using System.Collections.Generic;
>> using System.Linq;
>> using System.Text;
>> using Apache.NMS;
>> using Apache.NMS.Util;
>> using System.Collections;
>> using System.Reflection;
>> using System.IO;
>>
>> namespace ConexionActiveMQ
>> {
>>      class Program
>>      {
>>          private static string[] GetConfigSearchPaths()
>>          {
>>              ArrayList pathList = new ArrayList();
>>
>>              // Check the current folder first.
>>              pathList.Add("");
>>              AppDomain currentDomain = AppDomain.CurrentDomain;
>>
>>              // Check the folder the assembly is located in.
>>
>>             
>> pathList.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
>>              if (null != currentDomain.BaseDirectory)
>>              {
>>                  pathList.Add(currentDomain.BaseDirectory);
>>              }
>>
>>              if (null != currentDomain.RelativeSearchPath)
>>              {
>>                  pathList.Add(currentDomain.RelativeSearchPath);
>>              }
>>
>>              return (string[])pathList.ToArray(typeof(string));
>>          }
>>
>>          static void Main(string[] args)
>>          {
>>              string[] direcciones;
>>              direcciones = GetConfigSearchPaths();
>>              // Example connection strings:
>>              //    activemq:tcp://localhost:61616
>>              //    stomp:tcp://activemqhost:61613
>>              //    ems:tcp://tibcohost:7222
>>              //    msmq://localhost
>>
>>              Uri connecturi = new Uri("activemq:tcp://localhost:61616");
>>
>>              Console.WriteLine("About to connect to " + connecturi);
>>
>>              // NOTE: ensure the nmsprovider-activemq.config file exists
>> in
>> the executable folder.
>>              IConnectionFactory factory = new
>> NMSConnectionFactory(connecturi);
>>
>>              using (IConnection connection = factory.CreateConnection())
>>              using (ISession session = connection.CreateSession())
>>              {
>>                  // Examples for getting a destination:
>>                  //
>>                  // Hard coded destinations:
>>                  //    IDestination destination =
>> session.GetQueue("FOO.BAR");
>>                  //    Debug.Assert(destination is IQueue);
>>                  //    IDestination destination =
>> session.GetTopic("FOO.BAR");
>>                  //    Debug.Assert(destination is ITopic);
>>                  //
>>                  // Embedded destination type in the name:
>>                  //    IDestination destination =
>> SessionUtil.GetDestination(session, "queue://FOO.BAR");
>>                  //    Debug.Assert(destination is IQueue);
>>                  //    IDestination destination =
>> SessionUtil.GetDestination(session, "topic://FOO.BAR");
>>                  //    Debug.Assert(destination is ITopic);
>>                  //
>>                  // Defaults to queue if type is not specified:
>>                  //    IDestination destination =
>> SessionUtil.GetDestination(session, "FOO.BAR");
>>                  //    Debug.Assert(destination is IQueue);
>>                  //
>>                  // .NET 3.5 Supports Extension methods for a simplified
>> syntax:
>>                  //    IDestination destination =
>> session.GetDestination("queue://FOO.BAR");
>>                  //    Debug.Assert(destination is IQueue);
>>                  //    IDestination destination =
>> session.GetDestination("topic://FOO.BAR");
>>                  //    Debug.Assert(destination is ITopic);
>>
>>                  IDestination destination =
>> SessionUtil.GetDestination(session, "queue://FOO.BAR");
>>                  Console.WriteLine("Using destination: " + destination);
>>
>>                  // Create a consumer and producer
>>                  using (IMessageConsumer consumer =
>> session.CreateConsumer(destination))
>>                  using (IMessageProducer producer =
>> session.CreateProducer(destination))
>>                  {
>>                      // Start the connection so that messages will be
>> processed.
>>                      connection.Start();
>>                      //producer.Persisten = true;
>>
>>                      // Send a message
>>                      ITextMessage request =
>> session.CreateTextMessage("Hello
>> World!");
>>                      request.NMSCorrelationID = "abc";
>>                      request.Properties["NMSXGroupID"] = "cheese";
>>                      request.Properties["myHeader"] = "Cheddar";
>>
>>                      producer.Send(request);
>>
>>                      // Consume a message
>>                      ITextMessage message = consumer.Receive() as
>> ITextMessage;
>>                      if (message == null)
>>                      {
>>                          Console.WriteLine("No message received!");
>>                      }
>>                      else
>>                      {
>>                          Console.WriteLine("Received message with ID:   "
>> +
>> message.NMSMessageId);
>>                          Console.WriteLine("Received message with text: "
>> +
>> message.Text);
>>                      }
>>                  }
>>              }
>>          }
>>      }
>> }
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
> 
> 
> 
> 
> -- 
> Tim Bish
> Sr Software Engineer | RedHat Inc.

> tim.bish@

>  | www.fusesource.com | www.redhat.com
> skype: tabish121 | twitter: @tabish121
> blog: http://timbish.blogspot.com/





--
View this message in context: http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743p4665767.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: No IConnectionFactory implementation found for connection URI: activemq:tcp://localhost:61616

Posted by Timothy Bish <ta...@gmail.com>.
You need the Apache ActiveMQ NMS Provider.
http://activemq.apache.org/nms/apachenmsactivemq-v156.html


On 04/08/2013 07:44 PM, JavyRocks wrote:
> *I still get the "No IConnectionFactory implementation found for connection
> URI: activemq:tcp://localhost:61616" Error. I've paste and include in the
> compile project the archive "nmsprovider-activemq.config"
> I'm Working with .NET 4.0 and the references are
> Apache.NMS-1.5.1-bin.zip\net-4.0\release
>
> The code is very estandar and simple but I can't get throw the connection
> error*
>
>      using System;
> using System.Collections.Generic;
> using System.Linq;
> using System.Text;
> using Apache.NMS;
> using Apache.NMS.Util;
> using System.Collections;
> using System.Reflection;
> using System.IO;
>
> namespace ConexionActiveMQ
> {
>      class Program
>      {
>          private static string[] GetConfigSearchPaths()
>          {
>              ArrayList pathList = new ArrayList();
>
>              // Check the current folder first.
>              pathList.Add("");
>              AppDomain currentDomain = AppDomain.CurrentDomain;
>
>              // Check the folder the assembly is located in.
>
>             
> pathList.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
>              if (null != currentDomain.BaseDirectory)
>              {
>                  pathList.Add(currentDomain.BaseDirectory);
>              }
>
>              if (null != currentDomain.RelativeSearchPath)
>              {
>                  pathList.Add(currentDomain.RelativeSearchPath);
>              }
>
>              return (string[])pathList.ToArray(typeof(string));
>          }
>
>          static void Main(string[] args)
>          {
>              string[] direcciones;
>              direcciones = GetConfigSearchPaths();
>              // Example connection strings:
>              //    activemq:tcp://localhost:61616
>              //    stomp:tcp://activemqhost:61613
>              //    ems:tcp://tibcohost:7222
>              //    msmq://localhost
>
>              Uri connecturi = new Uri("activemq:tcp://localhost:61616");
>
>              Console.WriteLine("About to connect to " + connecturi);
>
>              // NOTE: ensure the nmsprovider-activemq.config file exists in
> the executable folder.
>              IConnectionFactory factory = new
> NMSConnectionFactory(connecturi);
>
>              using (IConnection connection = factory.CreateConnection())
>              using (ISession session = connection.CreateSession())
>              {
>                  // Examples for getting a destination:
>                  //
>                  // Hard coded destinations:
>                  //    IDestination destination =
> session.GetQueue("FOO.BAR");
>                  //    Debug.Assert(destination is IQueue);
>                  //    IDestination destination =
> session.GetTopic("FOO.BAR");
>                  //    Debug.Assert(destination is ITopic);
>                  //
>                  // Embedded destination type in the name:
>                  //    IDestination destination =
> SessionUtil.GetDestination(session, "queue://FOO.BAR");
>                  //    Debug.Assert(destination is IQueue);
>                  //    IDestination destination =
> SessionUtil.GetDestination(session, "topic://FOO.BAR");
>                  //    Debug.Assert(destination is ITopic);
>                  //
>                  // Defaults to queue if type is not specified:
>                  //    IDestination destination =
> SessionUtil.GetDestination(session, "FOO.BAR");
>                  //    Debug.Assert(destination is IQueue);
>                  //
>                  // .NET 3.5 Supports Extension methods for a simplified
> syntax:
>                  //    IDestination destination =
> session.GetDestination("queue://FOO.BAR");
>                  //    Debug.Assert(destination is IQueue);
>                  //    IDestination destination =
> session.GetDestination("topic://FOO.BAR");
>                  //    Debug.Assert(destination is ITopic);
>
>                  IDestination destination =
> SessionUtil.GetDestination(session, "queue://FOO.BAR");
>                  Console.WriteLine("Using destination: " + destination);
>
>                  // Create a consumer and producer
>                  using (IMessageConsumer consumer =
> session.CreateConsumer(destination))
>                  using (IMessageProducer producer =
> session.CreateProducer(destination))
>                  {
>                      // Start the connection so that messages will be
> processed.
>                      connection.Start();
>                      //producer.Persisten = true;
>
>                      // Send a message
>                      ITextMessage request = session.CreateTextMessage("Hello
> World!");
>                      request.NMSCorrelationID = "abc";
>                      request.Properties["NMSXGroupID"] = "cheese";
>                      request.Properties["myHeader"] = "Cheddar";
>
>                      producer.Send(request);
>
>                      // Consume a message
>                      ITextMessage message = consumer.Receive() as
> ITextMessage;
>                      if (message == null)
>                      {
>                          Console.WriteLine("No message received!");
>                      }
>                      else
>                      {
>                          Console.WriteLine("Received message with ID:   " +
> message.NMSMessageId);
>                          Console.WriteLine("Received message with text: " +
> message.Text);
>                      }
>                  }
>              }
>          }
>      }
> }
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>




-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Re: No IConnectionFactory implementation found for connection URI: activemq:tcp://localhost:61616

Posted by Rafael Pileggi <ch...@hotmail.com>.
This work for me:

Download from here: 

http://ftp.unicamp.br/pub/apache/activemq/apache-nms/1.6.0/Apache.NMS.ActiveMQ-1.6.2-bin.zip
http://ftp.unicamp.br/pub/apache/activemq/5.9.1/apache-activemq-5.9.1-bin.zip

Put this on import clause:

using Apache.NMS.ActiveMQ;
using Apache.NMS.Util;
using Apache.NMS;

And connect like this:

        private void EnviarObjeto(string fila, object objeto, string
identificador)
        {
            Uri uriConexao = new Uri("activemq:tcp://127.0.0.1:61616");
            Apache.NMS.ActiveMQ.ConnectionFactory fabrica = new
ConnectionFactory(uriConexao);

            using (IConnection conexao = fabrica.CreateConnection())
            {
                using (ISession sessao = conexao.CreateSession())
                {
                    IDestination destino =
SessionUtil.GetDestination(sessao, "queue://" + fila);
                    using (IMessageProducer producer =
sessao.CreateProducer(destino))
                    {
                        conexao.Start();

                        IObjectMessage objMensagem =
sessao.CreateObjectMessage(objeto);
                        objMensagem.NMSCorrelationID = identificador;
                        producer.Send(objMensagem);
                    }
                }
            }
        }

Bilubilu tetéia!



--
View this message in context: http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743p4680252.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.