tags:

views:

224

answers:

2

After some months I am finally back to using nservicebus and started to test it out on a server. Unfortunately I am getting this exception

 The queue does not exist or you do not have sufficient permissions to perform the operation.

I've checked using computer manager and the queue does exist and I have granted everybody full control over the queue however this problem persists. What am I doing wrong?

I am using

  var bus = NServiceBus.Configure.With()
                  .SpringBuilder()
                  .XmlSerializer()
                  .MsmqTransport()
                      .IsTransactional(true)
                      .PurgeOnStartup(false)
                  .UnicastBus()
                      .ImpersonateSender(false)
                      .LoadMessageHandlers()
                  .CreateBus()
              .Start();

and

 <MsmqTransportConfig
  InputQueue="ListenQueue"
  ErrorQueue="error"
  NumberOfWorkerThreads="1"
  MaxRetries="5"
  />

I works just fine on my dev box. The full stack trace (which doesn't seem all that useful) looks like

System.Messaging.MessageQueueException was unhandled
  Message=The queue does not exist or you do not have sufficient permissions to perform the operation.
  Source=NServiceListener
  ErrorCode=-2147467259
  StackTrace:
       at NServiceListener.Program.Main(String[] args) in C:\temp\NServiceListener\NServiceListener\Program.cs:line 35
       at System.AppDomain._nExecuteAssembly(Assembly 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.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
A: 

Please include the full exception details, relevant logs, etc.

Udi Dahan
Thanks for helping, Udi. I've added a stacktrace which is pretty much all the extra information I have. Server is win 2K8 RC2 and my desktop win7.
stimms
What account is the process running under?
Udi Dahan
I have tried both my normal account and the administrator account, although my normal account probably has admin rights. Is there some restriction on writing to a queue as administrator?
stimms
Oh frick, I'm stupid. I was writing to a queue which doesn't exist.
stimms
A: 

As it turns out I'm an idiot and Udi would have solved this in a second had I posted all the required information. My config file contains

<MsmqTransportConfig
  InputQueue="ListenQueue"
  ErrorQueue="error"
  NumberOfWorkerThreads="1"
  MaxRetries="5"
  />

  <UnicastBusConfig>
    <MessageEndpointMappings>

      <add Messages="EnformMessages" Endpoint="EnformMessages" />
    </MessageEndpointMappings>
  </UnicastBusConfig>

As you can see I'm attempting to listen to messages on a non-existent queue called EnformMessages. Changing that to the InputQueue name or changing the InputQueue name to EnformMessages solved the problem. I am embarrassed by my stupidity

stimms