Bug 780509 (SOA-2938)

Summary: BPEL process deployed on SOA-P 5.1 with CXF stack configured exposes an invalid WSDL
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Noel O'Connor <noel.oconnor>
Component: JBossWS, riftsawAssignee: Gary Brown <gbrown>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: asoldano, cyu, ema, gary.pi4tech, mbaluch, noel.oconnor
Target Milestone: ---   
Target Release: 5.2.0.ER6   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-2938
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Java(TM) SE Runtime Environment (build 1.6.0_21-b06), Fedora 14 32-bit, using
Last Closed: 2011-11-05 08:35:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
sayHello.tar none

Description Noel O'Connor 2011-02-23 03:02:58 UTC
project_key: SOA

I created a very simple BPEL process using Jboss tools 3.2GA on JBDS 4 and deployed it to a clean installation of SOA-P 5.1 configured with the apache CXF stack.
When I try and access using SOAP-UI 2.5.1 the WSDL exposed by the BPEL process I get the following error 

"Tue Feb 22 21:28:27 EST 2011:ERROR:Error importing wsdl: java.lang.Exception: javax.wsdl.WSDLException: WSDLException (at /definitions/types/schema): faultCode=INVALID_WSDL: Encountered illegal extension element '{http://schemas.xmlsoap.org/wsdl/}schema' in the context of a 'javax.wsdl.Types'. Extension elements must be in a namespace other than WSDL's. 
Tue Feb 22 21:28:27 EST 2011:ERROR:An error occured [javax.wsdl.WSDLException: WSDLException (at /definitions/types/schema): faultCode=INVALID_WSDL: Encountered illegal extension element '{http://schemas.xmlsoap.org/wsdl/}schema' in the context of a 'javax.wsdl.Types'. Extension elements must be in a namespace other than WSDL's.], see error log for details "

I suspect that the error is in the default namespace of the types section in the WSDL

Comment 1 Marek Baluch 2011-02-23 08:10:48 UTC
Hi Noel,

can you please attach your JBDS project? I haven't managed to reproduce your issue. I created a simple HalloWorld process but it deploys and runs just fine.

Many thanks
Marek

Comment 2 Marek Baluch 2011-02-23 08:21:56 UTC
Can you try a newer version of SOAP-UI? I used during my testing SOA-UI 3.0.1.

Comment 3 Jeff Yu 2011-02-23 09:29:19 UTC
I am not sure about Noel's soapui version. 
With soapui-2.5 in my case, I've seen the same error as Noel.
Will try to upgrade the soapui now.

Comment 4 Jeff Yu 2011-02-23 10:00:36 UTC
same error with soapui-3.6.1, :(

Comment 5 Jeff Yu 2011-02-23 10:02:29 UTC
This is the example that I used in the bpel editor.

Comment 6 Jeff Yu 2011-02-23 10:02:29 UTC
Attachment: Added: sayHello.tar


Comment 7 Marek Baluch 2011-02-23 10:29:19 UTC
Got the exception too.

Comment 8 Gary Brown 2011-02-24 16:42:45 UTC
Looks like a jbossws-cxf issue. Using the 'say_hello' riftsaw quickstart, the WSDL being deployed with the JAX-WS service (that provides the WS interface to the BPEL service) has:

    <types>

        <schema attributeFormDefault="unqualified" elementFormDefault="qualified" 

                targetNamespace="http://www.jboss.org/bpel/examples" 

                xmlns="http://www.w3.org/2001/XMLSchema">


but the WSDL presented through the jbossws web console shows

  <types>
<schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.jboss.org/bpel/examples" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.jboss.org/bpel/examples">



Comment 9 Gary Brown 2011-02-24 16:45:30 UTC
Alessio - can you give your opinion on this issue. The default namespace on the schema element seems to be changed.

Comment 10 Jim Ma 2011-02-28 07:37:15 UTC
I've locally reproduced this error. From the ode code, there is org.apache.ode.bpel.compiler.wsdl.XMLSchemaTypeSerializer to copy the wsdl's namespace into schema element during bepl is compiled. I am not familiar with the ode code base , if there is some static thing  registered in the WSDLFactory's ExtensionRegsitry when ode starts up,  and it caused WSDL is parsed and wrote to the servlet response in the CXF with these wrong added namespaces later? Gary and Jeff, can you point me which ode or riftsaw classes should I look at to find out ? 
This could be the answer why jbossws native does not share this issue: in jbossws native stack , the customized WSDLFactory(JBossWSDLFactoryImpl) is used to parse and write the wsdl. CXF directly uses the WSDLFactory.newInstance() to fetch the WSDLFactory. This is the only difference between jbossws-cxf and jbossws-native to server the wsdl query request. 

I continue to investigate this issue . Let me know if you have thoughts about the current findings.  

Comment 11 Gary Brown 2011-02-28 09:08:30 UTC
No, don't know if ODE registers anything - we will check.

However if this is the case, then if you were to deploy any other JAXWS service, while ODE is installed, then it should cause the same error - is it possible for you to give this a try?


Comment 12 Jim Ma 2011-03-01 07:49:40 UTC
Actually I already tried to deploy a standalone JAXWS service which packaged in a war file(not dynamically generated by riftsaw), the generated wsdl file is correct. 
JBossWS CXF relies on  this method Transfomer.transform(DomSource, StreamResult) to output wsdl content, but the strange thing is javax.xml.transform.Transformer always generate wrong xmlns attribute( the wrong value: http://schemas.xmlsoap.org/wsdl/) of schema element in the whole bepl_say_hello example deploy process. And more interesting thing is when I debug the schema element before transform to stream result, the xmlns attribute is correct and it is "http://www.w3.org/2001/XMLSchema". This morning I already excluded the causes by transformer implements (xalan.jar) and jaxp implmentation(xerces.jar). Can you see any other jar file, settings or code in riftsaw or ode may cause this strang behavior ?     

Comment 13 Gary Brown 2011-03-01 09:17:53 UTC
Not that I know of, but will have a look.

Comment 14 Gary Brown 2011-03-01 09:41:32 UTC
First wanted to check whether it happens with ODE in Tomcat, and it doesn't - so its something about the ODE integration in jboss :(

Comment 15 Gary Brown 2011-03-01 10:05:11 UTC
There is a WSDLFactory implementation in runtime/engine module of riftsaw, which has some extensions related to handling the BPEL elements (partner links) that can be defined in the WSDL.


Comment 16 Gary Brown 2011-03-01 15:47:32 UTC
Thanks Jim for chasing this one down - it turned out to be the saxon transformer impl version (9.1.0.8). Version 9.2 looks fine.


Comment 17 Gary Brown 2011-03-02 16:16:50 UTC
Just a quick update, version 9.2 solves this particular problem but introduces some other issues - so started looking at whether it was really necessary to bundle the saxon impl, and unfortunately ODE is quite tightly coupled to it (i.e. variable resolve that returns Saxon specific classes to represent the values).

Next step (which won't be until next week probably) will be to investigate how easy it is to fix the 9.2 issues impacting the riftsaw integration tests.

If this is problematic, then the only other option may be to find a way to include a version of the Saxon artifacts without the META-INF/services information, so that jbossws uses the standard transformer implementation - and ODE still picks up Saxon as it explicitly instantiates the factories - not ideal though as it would mean having a separate slightly disabled version of the saxon artifacts in a different part of Nexus.


Comment 18 Gary Brown 2011-03-03 10:52:22 UTC
Link: Added: This issue is related to RIFTSAW-352


Comment 19 Gary Brown 2011-03-03 12:05:41 UTC
Fix was to change saxon jars in riftsaw.sar/lib with single saxonhe version 9.2 jar.

Comment 20 David Le Sage 2011-09-01 23:54:39 UTC
Release Notes Docs Status: Added: Documented as Resolved Issue
Writer: Added: dlesage
Release Notes Text: Added: https://issues.jboss.org/browse/SOA-2938

If the user  deployed a BPEL process on SOA-P 5.1 with the CXF stack configured, the WSDL would be invalid, leading to an java.lang.Exception: javax.wsdl.WSDLException.   To fix this problem, the Saxon JARs found in the riftsaw.sar/lib were replaced with single a saxon version 9.2 jar. As a result, users will no longer encounter this exception.


Comment 21 Marek Baluch 2011-11-05 08:35:58 UTC
Verified in SOA 5.2 ER6, CXF, JBDS 4.1.1.

CXF generated WSDL documents can now be consumed be SOAPUI and other clients without problems.