The fact that some applications can use the ReceiveString method in your
DLL without problems indicates that the problem is not, in fact, with the
ReceiveString method but with something else (e.g. in the environment or in
the calling application). I don't see any evidence that NMS is causing
problems.

I've never used PowerBuilder so I can't help there.


Justin


On Wed, Sep 20, 2023 at 9:23 AM Torgeir Lund <torgeir.l...@vitecsoftware.com>
wrote:

> Hi Justin.
>
> No it is'nt. I have on the same server startet two simple console (C#)
> applikation as consumer where I use the same DLL and call the
> ReceiveString(). I don't get the same Error.
>
> The application that experience the problem when it calls the
> receiveString() is a PowerBuilder 2022 application, so it can be an issue
> with PowerBuilder calling a .net dll and waiting for it to respond I don't
> know what the problem is since the PowerBuilder app catches the
> Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL). Nothing in
> windows event viewer either.
>
> I have to look at PowerBuilder perhaps
>
> Code snippet frm PB: IT is the Throwable that is cathced
>
> String ls_xml
> String ls_caller
> ls_caller = Classname() +" ue_nmsReceive"
>
> inv_error.of_plplog( inv_error.PLPDEBUG, ls_caller,"","Begin
> ReceiveString")
>
> TRY
> ls_xml = ipbamq.ReceiveString(queue_in)
> IF ISNULL(ls_xml) THEN
> inv_error.of_plplog( inv_error.pf2_fejl,ls_caller,"", "nmsReceive Error
> Type: " + string(ipbamq.il_errortype) + " Error Code: "  + string(
> ipbamq.il_errornumber) + " Error text: " + ipbamq.is_errortext )
> END IF
> CATCH (Exception ce)
> inv_error.of_plplog( inv_error.pf2_fejl,ls_caller,"", "nmsReceive ce " +
> ce.getMessage() )
> RETURN ce.getMessage()
> CATCH (Throwable t)
> inv_error.of_plplog( inv_error.pf2_fejl,ls_caller,"", "nmsReceive t " +
> t.getMessage() )
> RETURN t.getMessage()
> END TRY
>
> inv_error.of_plplog( inv_error.PLPDEBUG, ls_caller,"", "ue_nmsReceive end
> ")
> RETURN ls_xml
>
>
>
> Best regards
>
> Torgeir Sjur Lund
> Software Developer
> Vitec Aloc
>
> torgeir.l...@vitecsoftware.com<mailto:torgeir.l...@vitecsoftware.com>
> +45 29 99 71 22
>
>
> ________________________________
> Fra: Justin Bertram <jbert...@apache.org>
> Sendt: 19. september 2023 15:56
> Til: users@activemq.apache.org <users@activemq.apache.org>
> Emne: Re: Receive error
>
> [Du får ikke ofte mails fra jbert...@apache.org. Få mere at vide om,
> hvorfor dette er vigtigt, på https://aka.ms/LearnAboutSenderIdentification
> ]
>
> I did a quick search on the web and I found this [1]. It looks like the
> error you're getting is just some generic problem. Is there any logging
> from you application which indicates the problem is with the NMS code?
>
>
> Justin
>
> [1]
>
> https://learn.microsoft.com/en-us/windows/win32/seccrypto/common-hresult-values
>
> On Sat, Sep 16, 2023 at 10:29 AM Torgeir Lund <
> torgeir.l...@vitecsoftware.com> wrote:
>
> > Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)
> >
> > We have createt a C# Dll using ActiveMq.NMS
> >
> > We create a connection
> >
> >  public void Init(string amqUrl)
> >         {
> >             try
> >             {
> >                 ConnectionFactory connectionFactory = new
> > ConnectionFactory(amqUrl);
> >                 _connection = connectionFactory.CreateConnection();
> >                 _session =
> > _connection.CreateSession(AcknowledgementMode.ClientAcknowledge);
> >                 _connection.Start();
> >             }
> >             catch (NMSException e)
> >             {
> >                 Console.WriteLine(e);
> >                 throw;
> >             }
> >             catch (Exception e)
> >             {
> >                 Console.WriteLine(e);
> >                 throw;
> >             }
> >         }
> >
> >
> > We then create a consumer
> >  public void CreateConsumer(string queueName)
> >         {
> >             if (!consumerDictionary.ContainsKey(queueName))
> >             {
> >                 try
> >                 {
> >                    IDestination destination =
> _session.GetQueue(queueName);
> >                    IMessageConsumer consumer =
> > _session.CreateConsumer(destination);
> >                    consumerDictionary.Add(queueName, consumer);
> >                 }
> >                 catch (NMSException e)
> >                 {
> >                     Console.WriteLine(e);
> >                     throw;
> >                 }
> >                 catch (Exception e)
> >                 {
> >                     Console.WriteLine(e);
> >                     throw;
> >                 }
> >             }
> >
> >         }
> > Then we calle receivestring and wait for  a message
> >  public string ReceiveString(string consumerName)
> >         {
> >             if (consumerDictionary.ContainsKey(consumerName))
> >             {
> >                 try
> >                 {
> >                     IMessageConsumer consumer =
> > (MessageConsumer)consumerDictionary[consumerName];
> >                     _message = consumer.Receive();
> >                     if (_message is Message)
> >                     {
> >                         ITextMessage msg = (ITextMessage)_message;
> >                         return msg.Text;
> >                     }
> >
> >                     return null;
> >
> >                 }
> >                 catch (NMSException e)
> >                 {
> >                     Console.WriteLine(e);
> >                     throw;
> >                 }
> >                 catch (Exception e)
> >                 {
> >                     Console.WriteLine(e);
> >                     throw;
> >                 }
> >
> >             }
> >
> >             return null;
> >         }
> >  After an our an exception occurs as follows
> >
> > Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)
> >
> > Have anybody experienced similar problem?
> >
> >
> > Torgeir Sjur Lund, System Developer
> > Vitec Aloc
> > Telefon +45 2999 7122
> >
> > Sendt fra min mobiltelefon
> >
> NOTE: This email originated from outside of the Vitec organisation.
>
>

Reply via email to