cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: UPDATE: WS-Discovery does not work with a WCF discovery proxy (still NOT working)
Date Mon, 27 Jan 2014 14:58:13 GMT

Do you have any idea how long after you send the probe that you get this?   My gut feeling
is that the client is sending a probe, getting some responses (or none) back, returning to
the main, getting discarded and garbage collected, and then another response is coming in.
  The only reason the bus should be null is if destroy had been called on the client.

As a test, can you try sticking the ws-discovery client into a static or something so it doesn’t
get garbage collected?   I’d like to see if that helps.   That would help verify if that’s
the problem.


Dan


On Jan 27, 2014, at 9:39 AM, Pampolini Matteo <matteo.pampolini@selex-es.com> wrote:

> Hello Dan how are you?
> 
> Please excuse me for the very long delay of this answer, I was involved
> in other activities
> and I started plying again with this issue only few days ago.
> 
> I tried the unit test provided with 2.7.8 version and it works, of
> course. But if I disable the
> fake server and make a test on my real environment I still get an error.
> In particular I get
> an unhandled NullPointerException in method onMessage of ClientImpl
> class because bus
> is actually null and the subsequent call:
> 
>        PhaseManager pm = bus.getExtension(PhaseManager.class);
> 
> generates the error. I simply added the following lines of code:
> 
>        if (bus == null)
>        {
>            getConduitSelector().complete(message.getExchange());
>            return;
>        }
> 
> and everything works fine, but I guess if this is the right approach, I
> don't know if there'
> something else that must be released. Do you have an idea of why bus is
> null? I suspect
> that the SOAP fault sent by WCF Discovery Proxy is intercepted, but then
> the message
> goes on for further processing causing the error.
> 
> Many many thanks once again in advance for your kind support,
> 
> Matteo
> 
> On 24/10/2013 18:40, Daniel Kulp wrote:
>> I really don’t know what’s going on with this.
>> 
>> I just created a simple unit test using your exact messages and it seems to be OK:
>> 
>> http://svn.apache.org/viewvc?view=revision&revision=1535433
>> 
>> The fake service sends 3 messages, the first is the fault from your proxy and then
two “valid” messages.   The assertEquals(2, size) thing passes so there are properly two
responses.
>> 
>> 
>> Dan
>> 
>> 
>> 
>> 
>> On Oct 24, 2013, at 11:25 AM, Pampolini Matteo <matteo.pampolini@selex-es.com>
wrote:
>> 
>>> Sorry Dan,
>>> 
>>> I enabled exception stack trace prints in the wrong place, doing it in
>>> handleResponse gives me:
>>> 
>>> java.util.concurrent.ExecutionException:
>>> org.apache.cxf.binding.soap.SoapFault: Invalid SOAP fault conte
>>>        at
>>> org.apache.cxf.jaxws.JaxwsClientCallback$2.get(JaxwsClientCallback.java:99)
>>>        at
>>> org.apache.cxf.ws.discovery.WSDiscoveryClient$1.handleResponse(WSDiscoveryClient.java:357)
>>> 
>>> Matteo
>>> 
>>> On 24/10/2013 16:58, Daniel Kulp wrote:
>>>> On Oct 24, 2013, at 10:42 AM, Daniel Kulp <dkulp@apache.org> wrote:
>>>>> On Oct 24, 2013, at 10:05 AM, Pampolini Matteo <matteo.pampolini@selex-es.com>
wrote:
>>>>>> thanks for your reply, I downloaded and tested snapshot
>>>>>> 2.7.8-20131023.085812-20 but now, even with
>>>>>> WCF proxy stopped, I'm not able to find any device, am I doing anything
>>>>>> wrong?
>>>>> That’s not good.  Not sure what would cause that.  Can you wireshark
things to make sure things are responding properly?
>>>> Actually,   any chance you can put a breakpoint on line 356 of WSDiscoveryClient?
 I’d like to  know if the callback is at least being called.
>>>> 
>>>> If you cannot put breakpoint on the stuff in the jar, can you just grab the
source for that one class from:
>>>> 
>>>> http://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/WSDiscoveryClient.java
>>>> 
>>>> and add that to your project (and modify the package) and call that instead
of the CXF version?   I’d definitely like to make sure the handler is properly called. 
 If not, then I know the issue is down in the UDPConduit.   If it is called, I’d like to
know what’s going on.   Likely some sort of exception, but not really sure.  (although,
looking at that, we probably SHOULD be at least saving the first exception and if size() is
0 at the end and there is an exception, throw it)  Need to think a bit more.    If ONE (or
more) services return a fault, but at least one service does not, what should be the right
behavior?   Return the one that didn’t and ignore the faults?   Maybe provide an optional
List<Exception> to record any faults?      Hmm…..
>>>> 
>>>> 
>>>> Dan
>>>> 
>>>> 
>>>>> Dan
>>>>> 
>>>>>> Regards, Matteo
>>>>>> 
>>>>>> On 23/10/2013 22:21, Daniel Kulp wrote:
>>>>>>> On Oct 23, 2013, at 8:37 AM, Pampolini Matteo <matteo.pampolini@selex-es.com>
wrote:
>>>>>>> 
>>>>>>>> Hi Dan,
>>>>>>>> 
>>>>>>>> did you find some time to look at this issue?
>>>>>>> Just fixed, I think.   Can you give the next snapshots a try?
>>>>>>> 
>>>>>>> Dan
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>>> Thanks, Matteo
>>>>>>>> 
>>>>>>>> 
>>>>>>>> -------- Original Message --------
>>>>>>>> Subject:     Re: WS-Discovery does not work with a WCF discovery
proxy (should be fixed in CXF Jira)
>>>>>>>> Date:        Wed, 16 Oct 2013 11:21:38 +0200
>>>>>>>> From:        Pampolini Matteo <matteo.pampolini@selex-es.com>
>>>>>>>> To:  users@cxf.apache.org <users@cxf.apache.org>
>>>>>>>> CC:  Daniel Kulp <dkulp@apache.org>
>>>>>>>> 
>>>>>>>> Hi Dan,
>>>>>>>> 
>>>>>>>> many thanks for your quick reply. Please find attached both
exceptions
>>>>>>>> traces (I had to enable them in WSDiscoveryClient code) and
Wireshark
>>>>>>>> captures. The address from which I start WS-Discovery is
172.19.121.75
>>>>>>>> while the proxy is hosted at 172.19.121.69. You can note
that the proxy
>>>>>>>> replies with SOAP fault messages, but after that all ONVIF
devices on
>>>>>>>> the network reply by themselves, then I expected my client
to receive
>>>>>>>> and process the replies anyway.
>>>>>>>> 
>>>>>>>> I also tried directly with the proxy without success.
>>>>>>>> 
>>>>>>>> Regards, Matteo
>>>>>>>> 
>>>>>>>> On 15/10/2013 18:58, Daniel Kulp wrote:
>>>>>>>>> On Oct 15, 2013, at 12:04 PM, Pampolini Matteo <matteo.pampolini@selex-es.com>
wrote:
>>>>>>>>> 
>>>>>>>>>> Hello there,
>>>>>>>>>> 
>>>>>>>>>> I'm using CXF WS-Discovery to find ONVIF devices
on my network.
>>>>>>>>>> 
>>>>>>>>>> After a patch from Dan, included from version 2.7.5,
that allows to set discovery version to 1.0 everything
>>>>>>>>>> was fine, but now I'm facing a new issue if a discovery
proxy developed with .NET WCF is in the same network,
>>>>>>>>>> I get some exceptions (I recompiled CXF with some
custom debug prints) and no device is found. Shutting down
>>>>>>>>>> the proxy everything works as expected.
>>>>>>>>> I'd likely need to at least see what the exceptions are.
   Ideally, could you wireshark the probe and responses and see what is coming back.
>>>>>>>>> 
>>>>>>>>> One thought is that the proxy is sending back a Hello
and thus the client is flipping to managed mode (to use the proxy), but the proxy isn't then
sending any information back or CXF isn't waiting for it and it's getting lost.   What happens
if you do a second probe with the same client?    In that case, the probe should ONLY go to
the proxy.
>>>>>>>>> 
>>>>>>>>> What happens if you force the client to use the proxy
right up front via the constructor that takes the address?   Use an address like  "soap.udp://proxy.hostname:3702".
   In that case, the probe should just go to the proxy immediately.   Does the proxy return
the right information?
>>>>>>>>> 
>>>>>>>>> Not sure what else to suggest at this point. Would really
need to the packets and stack traces.
>>>>>>>>> 
>>>>>>>>> Dan
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>>> It seems a similar, not to say equal, issue was opened
on CXF Jira with number 4955 that should be fixed now,
>>>>>>>>>> but this is not my case. Since in issue description
the WS-Discover version mentioned is 1.1, could it be that
>>>>>>>>>> the issue is still present when setting version 1.0,
as requested by ONVIF specs?
>>>>>>>>>> 
>>>>>>>>>> Any help is very appreciated, thanks in advance,
>>>>>>>>>> 
>>>>>>>>>> Matteo
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> This email and any attachments are confidential to
the intended recipient and may also be privileged. If you are not the intended recipient please
delete it from your system and notify the sender. You should not copy it or use it for any
purpose nor disclose or distribute its contents to any other person.
>>>>>>>>>> Questa e-mail e tutti i suoi allegati sono da intendersi
inviati in via riservata all'effettivo destinatario e possono essere soggetti a restrizioni
legali. Se non siete l'effettivo destinatario o avete ricevuto il messaggio per errore siete
pregati di cancellarlo dal vostro sistema e di avvisare il mittente. E' vietata la duplicazione,
l'uso a qualsiasi titolo, la divulgazione o la distribuzione dei contenuti di questa e-mail
a qualunque altro soggetto.
>>>>>>>>>> 
>>>>>>>>>> Prima di stampare questa comunicazione consideratene,
per favore, l'impatto ambientale
>>>>>>>>>> Please consider the environment before printing this
email
>>>>>>>> 
>>>>>>>> This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended recipient please delete
it from your system and notify the sender. You should not copy it or use it for any purpose
nor disclose or distribute its contents to any other person.
>>>>>>>> Questa e-mail e tutti i suoi allegati sono da intendersi
inviati in via riservata all'effettivo destinatario e possono essere soggetti a restrizioni
legali. Se non siete l'effettivo destinatario o avete ricevuto il messaggio per errore siete
pregati di cancellarlo dal vostro sistema e di avvisare il mittente. E' vietata la duplicazione,
l'uso a qualsiasi titolo, la divulgazione o la distribuzione dei contenuti di questa e-mail
a qualunque altro soggetto.
>>>>>>>> 
>>>>>>>> Prima di stampare questa comunicazione consideratene, per
favore, l'impatto ambientale
>>>>>>>> Please consider the environment before printing this email
>>>>>>>> <discovery.zip>
>>>>>> This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please delete it from your
system and notify the sender. You should not copy it or use it for any purpose nor disclose
or distribute its contents to any other person.
>>>>>> Questa e-mail e tutti i suoi allegati sono da intendersi inviati
in via riservata all'effettivo destinatario e possono essere soggetti a restrizioni legali.
Se non siete l'effettivo destinatario o avete ricevuto il messaggio per errore siete pregati
di cancellarlo dal vostro sistema e di avvisare il mittente. E' vietata la duplicazione, l'uso
a qualsiasi titolo, la divulgazione o la distribuzione dei contenuti di questa e-mail a qualunque
altro soggetto.
>>>>>> 
>>>>>> Prima di stampare questa comunicazione consideratene, per favore,
l'impatto ambientale
>>>>>> Please consider the environment before printing this email
>>>>> --
>>>>> Daniel Kulp
>>>>> dkulp@apache.org - http://dankulp.com/blog
>>>>> Talend Community Coder - http://coders.talend.com
>>> This email and any attachments are confidential to the intended recipient and
may also be privileged. If you are not the intended recipient please delete it from your system
and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute
its contents to any other person.
>>> Questa e-mail e tutti i suoi allegati sono da intendersi inviati in via riservata
all'effettivo destinatario e possono essere soggetti a restrizioni legali. Se non siete l'effettivo
destinatario o avete ricevuto il messaggio per errore siete pregati di cancellarlo dal vostro
sistema e di avvisare il mittente. E' vietata la duplicazione, l'uso a qualsiasi titolo, la
divulgazione o la distribuzione dei contenuti di questa e-mail a qualunque altro soggetto.
>>> 
>>> Prima di stampare questa comunicazione consideratene, per favore, l'impatto ambientale
>>> Please consider the environment before printing this email
>> --
>> Daniel Kulp
>> dkulp@apache.org - http://dankulp.com/blog
>> Talend Community Coder - http://coders.talend.com
>> 
>> .
>> 
> 
> This email and any attachments are confidential to the intended recipient and may also
be privileged. If you are not the intended recipient please delete it from your system and
notify the sender. You should not copy it or use it for any purpose nor disclose or distribute
its contents to any other person.
> Questa e-mail e tutti i suoi allegati sono da intendersi inviati in via riservata all'effettivo
destinatario e possono essere soggetti a restrizioni legali. Se non siete l'effettivo destinatario
o avete ricevuto il messaggio per errore siete pregati di cancellarlo dal vostro sistema e
di avvisare il mittente. E' vietata la duplicazione, l'uso a qualsiasi titolo, la divulgazione
o la distribuzione dei contenuti di questa e-mail a qualunque altro soggetto.
> 
> Prima di stampare questa comunicazione consideratene, per favore, l'impatto ambientale
> Please consider the environment before printing this email

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Mime
View raw message