Problem with message routing using Camel SE in OpenESB

5 messages Options
Embed this post
Permalink
borislav72

Problem with message routing using Camel SE in OpenESB

Reply Threaded More More options
Print post
Permalink
Hello,

I am having problems with a simple message routing scenario using Camel SE in OpenESB. Basically I want to process a message from JBI endpoint and send it to file location. The concrete definitinion of the JBI endpoint is defined in a custom wsdl file. So here are my steps:

1) Create CamelJBI Module
2) in the Configure method of the RouteBuilder class I specify the following route:

         String jbiURI = "jbi:http://openesb.org/jbi2camel/TESTCamelJBIModule/TESTCamelJBIModule_service/jbi2camel_endpoint";

         from(jbiURI).to("file://c:/temp/messages/out");

3) Create composite application.

4) Under "Process files" in the Composite application, create new wsdl file with concrete binding information - Binding "FILE", type "Poll"

5) Add the CamelJBI Module as JBI module to the composite application.

6) In WSDL Ports of "Assembly Service" area in the Composite application try to load WSDL Port and select the port defined by the wsdl file. The port is recongnised as FILE binding component. Build and deploy.

7) Copy the test file at the receive location specified by the wsdl file. The file is read, but not delivered to the destination location. In the server log the following exception is thrown:


java.lang.NullPointerException
        at org.openesb.components.camelse.JBIWrapperUtil.removeJBIWrapperFromInMessage(JBIWrapperUtil.java:161)
        at org.openesb.components.camelse.CamelSEProviderMessageExchangeHandler.processMessageOnProvider(CamelSEProviderMessageExchangeHandler.java:138)
        at org.openesb.components.camelse.CamelSEProviderMessageExchangeHandler.processMessage(CamelSEProviderMessageExchangeHandler.java:111)
        at org.openesb.components.camelse.common.AbstractMessageExchangeHandler.processActive(AbstractMessageExchangeHandler.java:100)
        at org.openesb.components.camelse.common.AbstractMessageExchangeHandler.processMessageExchange(AbstractMessageExchangeHandler.java:130)
        at org.openesb.components.camelse.common.deployment.Endpoint.processMessageExchangeWithHandler(Endpoint.java:271)
        at org.openesb.components.camelse.CamelSEProviderEndpoint.messageExchangeReceived(CamelSEProviderEndpoint.java:99)
        at org.openesb.components.camelse.common.MessageExchangeSupport.fireMessageExchangeReceived(MessageExchangeSupport.java:130)
        at org.openesb.components.camelse.common.DefaultMessageExchangeReceiver$2.run(DefaultMessageExchangeReceiver.java:168)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
 

I am running on glassfishesb-v2.1, apache-camel-1.6.1 and the latest version of Camel SE.

Just to mention that the example works, if insted of JBI I use explicit file receive location in the routing configuration.

Any help is appreciated. Thank you.
Srinivasan Chikkala

Re: Problem with message routing using Camel SE in OpenESB

Reply Threaded More More options
Print post
Permalink
Hi,

What is the message defintion in your wsdl? There may be an issue in
camelse in handling any type message sent by file bc.  Send your wsdl
and  input file content to get more details about the issue.

regards,

Srinivasan Chikkala
Open ESB Community (http://open-esb.org)



borislav72 wrote:

> Hello,
>
> I am having problems with a simple message routing scenario using Camel SE
> in OpenESB. Basically I want to process a message from JBI endpoint and send
> it to file location. The concrete definitinion of the JBI endpoint is
> defined in a custom wsdl file. So here are my steps:
>
> 1) Create CamelJBI Module
> 2) in the Configure method of the RouteBuilder class I specify the following
> route:
>
>          String jbiURI =
> "jbi:http://openesb.org/jbi2camel/TESTCamelJBIModule/TESTCamelJBIModule_service/jbi2camel_endpoint";
>
>          from(jbiURI).to("file://c:/temp/messages/out");
>
> 3) Create composite application.
>
> 4) Under "Process files" in the Composite application, create new wsdl file
> with concrete binding information - Binding "FILE", type "Poll"
>
> 5) Add the CamelJBI Module as JBI module to the composite application.
>
> 6) In WSDL Ports of "Assembly Service" area in the Composite application try
> to load WSDL Port and select the port defined by the wsdl file. The port is
> recongnised as FILE binding component. Build and deploy.
>
> 7) Copy the test file at the receive location specified by the wsdl file.
> The file is read, but not delivered to the destination location. In the
> server log the following exception is thrown:
>
>
> java.lang.NullPointerException
>         at
> org.openesb.components.camelse.JBIWrapperUtil.removeJBIWrapperFromInMessage(JBIWrapperUtil.java:161)
>         at
> org.openesb.components.camelse.CamelSEProviderMessageExchangeHandler.processMessageOnProvider(CamelSEProviderMessageExchangeHandler.java:138)
>         at
> org.openesb.components.camelse.CamelSEProviderMessageExchangeHandler.processMessage(CamelSEProviderMessageExchangeHandler.java:111)
>         at
> org.openesb.components.camelse.common.AbstractMessageExchangeHandler.processActive(AbstractMessageExchangeHandler.java:100)
>         at
> org.openesb.components.camelse.common.AbstractMessageExchangeHandler.processMessageExchange(AbstractMessageExchangeHandler.java:130)
>         at
> org.openesb.components.camelse.common.deployment.Endpoint.processMessageExchangeWithHandler(Endpoint.java:271)
>         at
> org.openesb.components.camelse.CamelSEProviderEndpoint.messageExchangeReceived(CamelSEProviderEndpoint.java:99)
>         at
> org.openesb.components.camelse.common.MessageExchangeSupport.fireMessageExchangeReceived(MessageExchangeSupport.java:130)
>         at
> org.openesb.components.camelse.common.DefaultMessageExchangeReceiver$2.run(DefaultMessageExchangeReceiver.java:168)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:619)
>  
>
> I am running on glassfishesb-v2.1, apache-camel-1.6.1 and the latest version
> of Camel SE.
>
> Just to mention that the example works, if insted of JBI I use explicit file
> receive location in the routing configuration.
>
> Any help is appreciated. Thank you.
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

borislav72

Re: Problem with message routing using Camel SE in OpenESB

Reply Threaded More More options
Print post
Permalink
Hello,

Thank you for looking into it! Attached and copied is the inFile.wsdl which defines the receive location for the FileBC.

As you can see from the wsdl, the input file is called input.xml. For my tests it contains just the word "Hello". I presume this is acceptable, since the definition in the wsdl specifies that the message is of type string.

Sorry to take your time with such a simple issue, but I just do not understand what I am doing wrong here.

Regards,

Borislav


<definitions name="inFile" targetNamespace="http://j2ee.netbeans.org/wsdl/caEdifact/inFile"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:file="http://schemas.sun.com/jbi/wsdl-extensions/file/" xmlns:tns="http://j2ee.netbeans.org/wsdl/caEdifact/inFile" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
    <types/>
    <message name="PollInputMessage">
        <part name="part1" type="xsd:string"/>
    </message>
    <portType name="FileInboundPortType">
        <operation name="poll">
            <input name="input1" message="tns:PollInputMessage"/>
        </operation>
    </portType>
    <binding name="FileInboundBinding" type="tns:FileInboundPortType">
        <file:binding/>
        <operation name="poll">
            <file:operation verb="poll"/>
            <input name="input1">
                <file:message fileName="input.xml" pollingInterval="1000" use="literal" part="part1"/>
            </input>
        </operation>
    </binding>
    <service name="FileInboundService">
        <port name="inFile_InboundPort" binding="tns:FileInboundBinding">
            <file:address fileDirectory="c:/temp/messages/in"/>
        </port>
    </service>
    <plnk:partnerLinkType name="inFile">
        <!-- A partner link type is automatically generated when a new port type is added. Partner link types are used by BPEL processes.
In a BPEL process, a partner link represents the interaction between the BPEL process and a partner service. Each partner link is associated with a partner link type.
A partner link type characterizes the conversational relationship between two services. The partner link type can have one or two roles.-->
        <plnk:role name="FileInboundPortTypeRole" portType="tns:FileInboundPortType"/>
    </plnk:partnerLinkType>
</definitions>







inFile.wsdl



Hi,

What is the message defintion in your wsdl? There may be an issue in
camelse in handling any type message sent by file bc.  Send your wsdl
and  input file content to get more details about the issue.

regards,

Srinivasan Chikkala
Open ESB Community (http://open-esb.org)
Srinivasan Chikkala

Re: Problem with message routing using Camel SE in OpenESB

Reply Threaded More More options
Print post
Permalink
Hi Borislav,
 
> 6) In WSDL Ports of "Assembly Service" area in the Composite
> application try
> to load WSDL Port and select the port defined by the wsdl file. The
> port is
> recongnised as FILE binding component. Build and deploy.
How did you connect the loaded file port to the camelse module provider
port ?   Most probably there is a mismatch between some parts of the
abstract interface ( message parts definition?) that the camelse module
provider uses and the the filebc wsdl. Check the wsdls in the camelse
module and see if they match with the file wsdl that you have loaded.

Attached is the zip file contains the working composite app(s) and camel
module project(s) that shows your scenarios ( jbi(file) -> camel(file)
).  First example (jbifile2camel) uses the message definition that has a
single part with element attribute set and the second example
(jbifile2camel2) uses the message definition that has a single part with
type attribute set.

Hope that helps,

regards,

Srinivasan Chikkala
Open ESB Community (http://open-esb.org)



borislav72 wrote:

> Hello,
>
> Thank you for looking into it! Attached and copied is the inFile.wsdl which
> defines the receive location for the FileBC.
>
> As you can see from the wsdl, the input file is called input.xml. For my
> tests it contains just the word "Hello". I presume this is acceptable, since
> the definition in the wsdl specifies that the message is of type string.
>
> Sorry to take your time with such a simple issue, but I just do not
> understand what I am doing wrong here.
>
> Regards,
>
> Borislav
>
>
> <definitions name="inFile"
> targetNamespace="http://j2ee.netbeans.org/wsdl/caEdifact/inFile"
>     xmlns="http://schemas.xmlsoap.org/wsdl/"
>     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>     xmlns:file="http://schemas.sun.com/jbi/wsdl-extensions/file/"
> xmlns:tns="http://j2ee.netbeans.org/wsdl/caEdifact/inFile"
> xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
>     <types/>
>     <message name="PollInputMessage">
>         <part name="part1" type="xsd:string"/>
>     </message>
>     <portType name="FileInboundPortType">
>         <operation name="poll">
>             <input name="input1" message="tns:PollInputMessage"/>
>         </operation>
>     </portType>
>     <binding name="FileInboundBinding" type="tns:FileInboundPortType">
>         <file:binding/>
>         <operation name="poll">
>             <file:operation verb="poll"/>
>             <input name="input1">
>                 <file:message fileName="input.xml" pollingInterval="1000"
> use="literal" part="part1"/>
>             </input>
>         </operation>
>     </binding>
>     <service name="FileInboundService">
>         <port name="inFile_InboundPort" binding="tns:FileInboundBinding">
>             <file:address fileDirectory="c:/temp/messages/in"/>
>         </port>
>     </service>
>     <plnk:partnerLinkType name="inFile">
>         <!-- A partner link type is automatically generated when a new port
> type is added. Partner link types are used by BPEL processes.
> In a BPEL process, a partner link represents the interaction between the
> BPEL process and a partner service. Each partner link is associated with a
> partner link type.
> A partner link type characterizes the conversational relationship between
> two services. The partner link type can have one or two roles.-->
>         <plnk:role name="FileInboundPortTypeRole"
> portType="tns:FileInboundPortType"/>
>     </plnk:partnerLinkType>
> </definitions>
>
>
>
>
>
>
>
> http://n2.nabble.com/file/n3840790/inFile.wsdl inFile.wsdl
>
>
>
> Hi,
>
> What is the message defintion in your wsdl? There may be an issue in
> camelse in handling any type message sent by file bc.  Send your wsdl
> and  input file content to get more details about the issue.
>
> regards,
>
> Srinivasan Chikkala
> Open ESB Community (http://open-esb.org)
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

jbifile2camel-examples.zip (183K) Download Attachment
borislav72

Re: Problem with message routing using Camel SE in OpenESB

Reply Threaded More More options
Print post
Permalink
Indeed, I have messed up with the BC wsdl definition. The example is quite clear.

Many thanks,

Borislav



Hi Borislav,
 
> 6) In WSDL Ports of "Assembly Service" area in the Composite
> application try
> to load WSDL Port and select the port defined by the wsdl file. The
> port is
> recongnised as FILE binding component. Build and deploy.
How did you connect the loaded file port to the camelse module provider
port ?   Most probably there is a mismatch between some parts of the
abstract interface ( message parts definition?) that the camelse module
provider uses and the the filebc wsdl. Check the wsdls in the camelse
module and see if they match with the file wsdl that you have loaded.

Attached is the zip file contains the working composite app(s) and camel
module project(s) that shows your scenarios ( jbi(file) -> camel(file)
).  First example (jbifile2camel) uses the message definition that has a
single part with element attribute set and the second example
(jbifile2camel2) uses the message definition that has a single part with
type attribute set.

Hope that helps,

regards,

Srinivasan Chikkala
Open ESB Community (http://open-esb.org)