Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [bpel-dev] Test case for WSDLUtil.resolveBPELPartnerLinkType bug

Hi Mike,

 

I am very sorry, but unfortunately this doesn’t really help that much, so I will try to explain the problem more clearly and ask one final question about this. Further clarifications/confusions are inlined below.

 

Calling this

 

bpelPartnerLink.getPartnerLinkType();

 

where bpelPartnerLink is an org.eclipse.bpel.model.PartnerLink, we get back a PartnerLinkTypeProxy in case the PLT is defined in one of these *Artifacts.wsdl files. Then, when we try to get the value of any of the fields of the PartnerLinkType, we just get null.

 

This is not very good as the code generating a deployment descriptor is not very imaginative and doesn’t really know how to turn null into useful output ;-)

 

You can create a simple process using the editor and cause it to generate an artifacts file and try this out yourself.

 

My (maybe) final question: Why is it reasonable to get a proxy back in response to calling the getter (which then tries to resolve the BPEL partnerlinkType) in the scenario involving an *Artifacts file?

If there is a good reason why we should get back a proxy in this scenario, then I promise to solve the problem differently and leave you in peace.

 

Feel free to skype me.

 

-- Bruno

 

 

 


From: Michal Chmielewski [mailto:michal.chmielewski@xxxxxxxxxx]
Sent: 28 February 2007 02:03
To: B.Wassermann; BPEL Designer project developer discussions.
Subject: Re: [bpel-dev] Test case for WSDLUtil.resolveBPELPartnerLinkType bug

 

Bruno,

1) The only way you will get a stack overflow exception as it stands, is if the WSDLs include each other (cyclic includes) ... and that in fact does happen (the stack overflow).

 

The stack overflow occurred due to the try-catch that I added (as described) due to looking at the same Definition over and over again (the BPEL definition, if I remember correctly, which was in a list of three objects, one of which would have been the WSDL the code should have looked at to make me happy).

Nevertheless, the check you put in to prevent looking at the same definition over and over again definitely makes good sense.

2) I was able to create this and I re-wrote some of the code in WSDLUtil to make sure that includes like this do not cause a problem anymore. I've checked it in ... so update and check your code to see if that exception still happens or not.

3) Regarding the partner link type definition in the model, they use
      http://schemas.xmlsoap.org/ws/2003/05/partner-link/

So rewriting the PLT would not solve the problem as you hope ....

 

Pity



4) In WSDL and BPEL, on the import, the targetNamepsace of the WSDL must be the same as the namespace attribute on the import. That's just required. If you need types from another namespace, you will need to import them into the BPEL process separately (as another import).

 

Agreed. But this doesn’t mean that you can only import “stuff” into a WSDL (tns A) from a WSDL with the same namespace (tns A). Or does it? In the example below we want to import something from gridsam.wsdl and the ns on the import matches the tns of gridsam.wsdl.

 

However, I am not 100% certain anymore whether the code actually supplied the wrong namespaceURI or not. Would need to debug it again to see L



5) You may be really wanting to lookup (or resolve) things like portTypes, types, element, partner links, etc. from the perspective of the BPEL process. WSDLUtil only allows you to look them up from the WSDL being the starting point. At some point, you may want to ask, given a process defn, does a portType "foo:bar" exist for example, or does a partnerLinkType "bar:foo" exists within all the imports.

 

I am (in my code) just calling a getter on a org.eclipse.bpel.model.PartnerLink (i.e. getPartnerLinkType()). That’s all. I didn’t use WSDLUtil or BPELUtil directly; during the course of debugging this problem I just realized that, to do the resolution, the methods in WSDLUtil were called for (ECoreUtil.resolve(), etc.) (if you run the test case and follow the stack trace…). I was just trying to illuminate matters a bit.


So I added a simple BPELUtils.lookup() method that should take care of this. Not sure if this is what you need or want, but perhaps it will solve the problem you are facing ...

Thank you. I think I should be able to do some DOM/XPath processing (because as described above we can’t get, for example, a QName from the model when the artifacts scenario is present) that would then allow me to get all the parameters I need to use that method. I was just hoping that as the getter (getPartnerLinkType()) was doing resolution, I wouldn’t have to resort to do that.

 



I hope that covers it.

-m

Bruno Wassermann wrote:

Just a quick thought. What do you think?
 
For example, in jobmanager.wsdl:
- update plnk schema to http://schemas.xmlsoap.org/ws/2004/03/partner-link/
- change partnerLinkType definitions to this format:
<plnk:partnerLinkType name="jobmanagerPartner">
     <plnk:role name="jobmanagerProvider">
       <plnk:portType name="tns:jobmanager"/>
     </plnk:role>
   </plnk:partnerLinkType>
 
Would this solve the problem (in part)?
 
-- Bruno
 
 
-----Original Message-----
From: bpel-dev-bounces@xxxxxxxxxxx [mailto:bpel-dev-bounces@xxxxxxxxxxx] On
Behalf Of Bruno Wassermann
Sent: 24 February 2007 14:59
To: 'BPEL Designer project developer discussions.'
Subject: RE: [bpel-dev] Test case for WSDLUtil.resolveBPELPartnerLinkType
bug
 
Hi,
 
I have come across at what looks like another issue in the resolveX methods
in WSDLUtil. 
This time it tries to resolveBPELRole, which in turn uses
resolveBPELPartnerLinkType. 
 
Here is the WSDL that causes it to trip up:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="jobmanager"
targetNamespace="http://sse.cs.ucl.ac.uk/omii-bpel/2.0.0/polymorph/jobmanage
r" xmlns:tns="http://sse.cs.ucl.ac.uk/omii-bpel/2.0.0/polymorph/jobmanager"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:gridsam="http://www.icenigrid.org/service/gridsam"
xmlns="http://schemas.xmlsoap.org/wsdl/"> 
  <import namespace="http://www.icenigrid.org/service/gridsam"
location="gridsam.wsdl"/>
  <!-- 
  <portType name="jobmanager">
    <operation name="submitjob">
      <input message="gridsam:SubmitJobRequest"/>
      <output message="gridsam:GetJobStatusResponse"/>
    </operation>
  </portType>
    <plnk:partnerLinkType name="jobmanagerPartner">
      <plnk:role name="jobmanagerProvider" portType="tns:jobmanager"/>
   </plnk:role>
</plnk:partnerLinkType>
 -->
</definitions>
 
As you can see the messages in the operation make use of types defined in
another WSDL via an import (gridsam.wsdl).
 
 
In resolveBPELPartnerLinkType(), when trying to get the imports of the
jobmanager.wsdl definition (see attachment), it will do
DefinitionImpl.getImports. In line 947 of DefinitionImpl only adds an Import
(for resolveBPELPartnerLinkType to do its magic on) if the namespace of the
WSDL definition (jobmanager.wsdl) matches that of the import. 
 
In this scenario though the import we need to look at to resolve correctly
is in a different namespace?
 
My question: does the check on namespaces in DefinitionImpl make good sense
and is it just a case of bad, bad WSDL or is this a bug? Do I need to change
the WSDL or do I need to change the code? 
 
Wrt the WSDLUtil issues I am currently at a loss; I am not 100% certain
whether it is my code exercising WSDLUtil, the resources I am using it on or
whether we have some genuine bugs in there. 
 
 
-- Bruno
 
 
-----Original Message-----
From: bpel-dev-bounces@xxxxxxxxxxx [mailto:bpel-dev-bounces@xxxxxxxxxxx] On
Behalf Of Bruno Wassermann
Sent: 24 February 2007 14:45
To: 'BPEL Designer project developer discussions.'
Subject: [bpel-dev] Test case for WSDLUtil.resolveBPELPartnerLinkType bug
 
Hi Mike,
 
I tried to send this to you, but the mail keeps bouncing back (maybe it
doesn't like the attachments?), so I am trying to get this to you via the
list. 
 
Maybe it's not a bug and is just due to the resources I am using or due to
the way I exercising the code, but in case it's not, here is what I have
figured out so far.
 
In its current form, the code in question will throw a NPE. We have
discussed the reasons for that already (it's to do with the bpws:import with
null location, I think). 
 
If I take care of this by catching the exception, like that:
 
public static PartnerLinkType resolveBPELPartnerLinkType(Definition
definition, QName qname)
 
{
. 
// second for loop
for (Iterator.) {
 
  ImportImpl imp = (ImportImpl) impIterator.next();
 
 
  try {
 
    imp.importDefinitionOrSchema(); // if (location == null) will throw NPE
when trying to create URI
  
 
  } catch (NullPointerException e) {
 
    continue;
 
  }
 
  Definition importedDefinition = (Definition) imp.getDefinition();
  .
  // enter recursion on importedDefinition
  .
}
 
The result will be a StackOverflowException. And the reason for this seems
to be that importedDefinition always represents the BPEL file! It never
actually represents the definition that is being imported (and imp seems to
represent the correct WSDL resource), but just the same resource over and
over again. 
 
I haven't had time to figure out why this happens. Maybe the stack trace
will reveal an answer to you. So far it hasn't for me.  
 
Take care,
 
-- Bruno
 
P.S.:
I am using
Java 1.5.0_07
Eclipse 3.2.1
EMF 2.2.0
WST 1.5.1
Revision of org.eclipse.bpel.model.util.WSDLUtil is 1.2
 
 
 
 
______________________________________________
Bruno Wassermann 
           
Research Student                
                               
University College London      Tel: +44 (0)20 7679 0369 (Direct Dial)
Dept. of Computer Science      Fax: +44 (0)20 7387 1397
Gower Street                  
London WC1E 6BT                http://www.cs.ucl.ac.uk/staff/B.Wassermann
United Kingdom 
______________________________________________
  
 
_______________________________________________
bpel-dev mailing list
bpel-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/bpel-dev
  




-- 
Michal Chmielewski, CMTS, Oracle Corp, 
W:650-506-5952 / M:408-209-9321 
 
"Manuals ?! What manuals ? Son, it's Unix, you just gotta know." 

Back to the top