[Users] Corba support with JBI4Corba in Petals

jmt petals-components at ebmwebsourcing.com
Wed Mar 16 10:32:47 CET 2011


Hi all again,

cdeneux, yes I don´t get any warning for the mismatch between WSDL and JBI Binding. I will be collecting all the issues.

I have continue testing and I have come across several problems:

1 - Once the SA is deployed, I get the follownig warning exception from EasyWSDL that doesn´t seem to affect the SA:

Code:

WARNING 2009-07-02 09:45:13,578 [Petals.JBI-Messaging.EndpointRegistryImpl]
    An error occurs during an update of a new endpoint
java.lang.NullPointerException
	at org.ow2.easywsdl.wsdl.api.abstractElmt.AbstractDescriptionImpl.getDocumentBaseURI(AbstractDescriptionImpl.java:430)
	at org.ow2.easywsdl.wsdl.impl.wsdl11.TypesImpl.<init>(TypesImpl.java:128)
	at org.ow2.easywsdl.wsdl.impl.wsdl11.DescriptionImpl.<init>(DescriptionImpl.java:144)
	at org.ow2.easywsdl.wsdl.impl.wsdl11.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:212)
	at org.ow2.easywsdl.wsdl.impl.wsdl11.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:195)
	at org.ow2.easywsdl.wsdl.impl.generic.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:174)
	at org.ow2.easywsdl.wsdl.impl.generic.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:150)
	at org.ow2.easywsdl.wsdl.impl.generic.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:180)
	at org.ow2.easywsdl.extensions.wsdl4complexwsdl.impl.inout.WSDL4ComplexWsdlReaderImpl.readWSDL4ComplexWSDL(WSDL4ComplexWsdlReaderImpl.java:138)
	at org.ow2.petals.jbi.messaging.registry.EndpointRegistryImpl.updateEndpointDescriptionAndInterfaces(EndpointRegistryImpl.java:1744)
	at org.ow2.petals.jbi.messaging.registry.EndpointRegistryImpl.access$1(EndpointRegistryImpl.java:1389)
	at org.ow2.petals.jbi.messaging.registry.EndpointRegistryImpl$UpdateLocalNewEndpointFuture.call(EndpointRegistryImpl.java:312)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
	at java.util.concurrent.FutureTask.run(FutureTask.java:123)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
	at java.lang.Thread.run(Thread.java:595)




   The error is due to missing "/" on the wsdl file location. When the wsdl is going to be processed the uri is = file:D:/xxx. Changing it to file:///D:/xxx allows easywsdl to read the file.
   I still have to find the source of the problem for this one.

2 - I have the Corba service exposed via SOAP. If I try to see the wsdl accesing "http://localhost:8084/petals/services/Hello?wsdl" i get the following error:


Code:

        at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Caused by: java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.ElementNSImpl
        at org.ow2.easywsdl.wsdl.impl.wsdl11.EndpointImpl.setAddress(EndpointImpl.java:112)
        at org.ow2.petals.binding.soap.listener.incoming.PetalsAxisService.printWSDL(PetalsAxisService.java:155)
        ... 18 more
2009-07-02 13:59:43.161::WARN:  /petals/services/Hello: org.apache.axis2.AxisFault: Server




The problem is related on how the wsdl needs to be constructed for the JBI4Corba component to get the required information.

In the WSDL we need to add the following to provide Corba related information:



Code:

<imolacorba:address name="Hello" localizationType="NameService">
<imolacorba:orb>
<imolacorba:property name="org.omg.CORBA.ORBInitialPort" value="1050"/>
<imolacorba:property name="org.omg.CORBA.ORBInitialHost" value="localhost"/>
</imolacorba:orb>
</imolacorba:address>





This piece of code in Petals :


Code:


org.ow2.easywsdl.wsdl.impl.wsdl11.EndpointImpl.java

@SuppressWarnings("unchecked")
    public void setAddress(final String address) {
    	boolean find = false;
        for (final Object element : this.model.getAny()) {
            if (((JAXBElement) element).getValue() instanceof org.ow2.easywsdl.wsdl.org.xmlsoap.schemas.wsdl.soap.TAddress) {
                ((org.ow2.easywsdl.wsdl.org.xmlsoap.schemas.wsdl.soap.TAddress) ((JAXBElement) element)
                        .getValue()).setLocation(address);
                find = true;
                break;
            }
            if (((JAXBElement) element).getValue() instanceof org.ow2.easywsdl.wsdl.org.xmlsoap.schemas.wsdl.soap12.TAddress) {
                ((org.ow2.easywsdl.wsdl.org.xmlsoap.schemas.wsdl.soap12.TAddress) ((JAXBElement) element)
                        .getValue()).setLocation(address);
                find = true;
                break;
            }
            if (((JAXBElement) element).getValue() instanceof org.ow2.easywsdl.wsdl.org.xmlsoap.schemas.wsdl.http.AddressType) {
                ((org.ow2.easywsdl.wsdl.org.xmlsoap.schemas.wsdl.http.AddressType) ((JAXBElement) element)
                        .getValue()).setLocation(address);
                find = true;
                break;
            }
        }





The code is expecting a JAXBElement and not an ElementNSImpl that represents the "address" part of the wsdl defined by the jbi4corba:
It does not seem to be easy to extract a properly defined wsdl for soap using the wsdl file in the JBI4Corba SU. 

3 - The previous error shouldn´t block me to run a test, so I went one step further and created a proper wsdl for the SOAP service:


Code:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Hello" targetNamespace="http://Hello" xmlns:tns="http://Hello" xmlns:imolacorba="uri://schemas.imola.it/jbi/wsdl-extensions/corba/" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://HelloApp.Hello" xmlns="http://HelloApp.Hello" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="sayHello">
        <xs:complexType>
            <xs:sequence/>
        </xs:complexType>
    </xs:element>
    <xs:element name="sayHelloResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="return" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="shutdown">
        <xs:complexType>
            <xs:sequence/>
        </xs:complexType>
    </xs:element>
</xs:schema>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://HelloApp.Hello" xmlns="http://HelloApp.Hello" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="sayHello">
        <xs:complexType>
            <xs:sequence/>
        </xs:complexType>
    </xs:element>
    <xs:element name="sayHelloResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="return" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="shutdown">
        <xs:complexType>
            <xs:sequence/>
        </xs:complexType>
    </xs:element>
</xs:schema>
  </wsdl:types>
  <wsdl:message name="sayHelloResponse">
    <wsdl:part name="parameters" element="tns:sayHelloResponse">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="sayHello">
    <wsdl:part name="parameters" element="tns:sayHello">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="shutdown">
    <wsdl:part name="parameters" element="tns:shutdown">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="HelloPortType">
    <wsdl:operation name="sayHello">
      <wsdl:input name="sayHello" message="tns:sayHello">
    </wsdl:input>
      <wsdl:output name="sayHelloResponse" message="tns:sayHelloResponse">
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="shutdown">
      <wsdl:input name="shutdown" message="tns:shutdown">
    </wsdl:input>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="HelloCorbaBinding" type="tns:HelloPortType">
		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="sayHello">
      <wsdl:input name="sayHello">
      </wsdl:input>
      <wsdl:output name="sayHelloResponse">
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="shutdown">
      <wsdl:input name="shutdown">
      </wsdl:input>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="Hello">
    <wsdl:port name="HelloCorbaPort" binding="tns:HelloCorbaBinding">
    	<soap:address location="http://localhost:8084/petals/services/Hello"/>
    </wsdl:port>
  </wsdl:service>
<plnk:partnerLinkType name="Hello">
<plnk:role name="HelloPortTypeRole" portType="tns:Hello"/>
</plnk:partnerLinkType>
</wsdl:definitions>




- I loaded into soapui and send a test message:


Code:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://Hello">
   <soapenv:Header/>
   <soapenv:Body>
      <hel:sayHello/>
   </soapenv:Body>
</soapenv:Envelope>




And I got the following error:


Code:

Caused by: javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: Premature end of file.
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:673)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:300)
        at it.imolinfo.jbi4corba.jbi.processor.MessageDenormalizer.denormalize(MessageDenormalizer.java:172)
        ... 8 more
Caused by: org.xml.sax.SAXParseException: Premature end of file.
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1269)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:579)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:661)
        ... 10 more




Debugging a bit more, I didn´t see any problem with the normalised message. The content is a StreamSource containing a ByteArrayInputStream with the
message, that seems fine:
<hel:sayHello xmlns:hel="http://Hello" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" />

This is passed to a parser  (inside com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform) by the JBI4Corba MessageDenormalizer.java[172] that generates an error when trying to parse.

This is as far as went, but still no luck.

Anybody got any idea to solve the "SAXParseException: Premature end of file."?

jmt




-------------------- m2f --------------------

Read this forum topic online here:
http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=805#805

-------------------- m2f --------------------


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://forum-list.petalslink.org/pipermail/users/attachments/20110316/65a3cc88/attachment.htm>


More information about the Users mailing list