[mule-user] Rules in mule

2 views
Skip to first unread message

Anish P. Issac

unread,
Jun 6, 2007, 8:09:26 AM6/6/07
to us...@mule.codehaus.org

Hi,

 

How can we possible to create rules in Mule. Currently I am using Mule 1.3.3 and is any need to upgrade to 1.4?.

 

Thanks and Regards,

 

Anish P Isaac

 


*************************DISCLAIMER******************************************
The information contained in this e-mail message and any attached files
are confidential information and intended solely for the use of the
individual or entity to whom they are addressed.This transmission may
contain information that is privileged,confidential or exempt from
disclosure under applicable law. If you have received this e-mail in error,
please notify the sender immediately and delete all copies. If you are not
the intended recipient, any disclosure,copying, distribution, or use of the
information contained herein is STRICTLY PROHIBITED.
Path accepts no responsibility for any errors ,omissions computer viruses
and other defects.
*****************************************************************************

Andrew Perepelytsya

unread,
Jun 6, 2007, 9:32:59 AM6/6/07
to us...@mule.codehaus.org
Anish,

Can you be more specific in your requirements? Also have a look at http://prova.ws/csp/?q=taxonomy/term/7

Andrew

Anish P. Issac

unread,
Jun 6, 2007, 10:03:47 AM6/6/07
to us...@mule.codehaus.org

Hi Andrew,

 

Thank you for quick your response.

 

I am totally new to Mule. But I have already gone through the examples provided by mule.

Our requirement is to implement some business logic in mule. Suppose I need to convert one xml file to some other format. So where I can implement my business logic in mule?.

Also could u please please tell me “vm://component” endpoints and here what is mean by “component”.

 

Thanks and Regards,

Anish.

 

 

 


Andrew Perepelytsya

unread,
Jun 6, 2007, 10:36:10 AM6/6/07
to us...@mule.codehaus.org
The component is a plain Java class with your business logic. This is also the location you should implement your logic in. It really has nothing Mule-specific.

Anish P. Issac

unread,
Jun 6, 2007, 11:31:20 AM6/6/07
to us...@mule.codehaus.org

Hi Andrew,

 

Yes you r right.  But we are going to implement the ESB system in our existing application and we are planning to use Mule as the ESB.

In mule I want to parse one xml file to an object and I tried with the following configuration file. But it is showing the following exception.

 

 

INFO  2007-06-06 18:03:12,779 [main] org.mule.MuleServer: Mule Server initialized.

ERROR 2007-06-06 18:04:02,966 [xmlParser.2] org.mule.impl.DefaultComponentExceptionStrategy: Caught exception in Exception Strategy for: xmlParser: org.mule.umo.ComponentException: Failed to invoke xml.parse.XmlConvertor. Component that caused exception is: xmlParser. Message payload is of type: [B

org.mule.umo.ComponentException: Failed to invoke xml.parse.XmlConvertor. Component that caused exception is: xmlParser. Message payload is of type: [B

      at org.mule.impl.DefaultLifecycleAdapter.intercept(DefaultLifecycleAdapter.java:207)

      at org.mule.impl.InterceptorsInvoker.execute(InterceptorsInvoker.java:47)

      at org.mule.impl.model.DefaultMuleProxy.run(DefaultMuleProxy.java:475)

      at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)

      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)

      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)

      at java.lang.Thread.run(Unknown Source)

Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: note : note

      at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:49)

      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

      at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:72)

      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

      at com.thoughtworks.xstream.mapper.CGLIBMapper.realClass(CGLIBMapper.java:40)

 

 

 

My configuration xml file is

 

<mule-configuration id="RouterSelection-config" version="1.0">

 

      <description>

            Configuration for the the "RouterSelection" project

      </description>

 

      <connector name="TcpNormalConnector" className="org.mule.providers.tcp.TcpConnector"></connector>

     

      <transformers>

      <transformer name="XmlToObject" className="org.mule.transformers.xml.XmlToObject" returnClass="java.lang.Object">

      </transformer>

      </transformers>

 

 

      <model name="RouterSelection">

            <mule-descriptor name="xmlParser" implementation="xml.parse.XmlConvertor">

            <inbound-router>

            <endpoint address="tcp://localhost:2000" transformers="XmlToObject" connector="TcpNormalConnector">

            </endpoint>

            </inbound-router>

            </mule-descriptor>

      </model>

 

</mule-configuration>

 

Thanks

 

Anish

Andrew Perepelytsya

unread,
Jun 6, 2007, 11:42:50 AM6/6/07
to us...@mule.codehaus.org
What Mule version are you using? My impression was the error messages have been improved post 1.4 for things like:


Message payload is of type: [B

It really means you are missing an extra transformation step, as the incoming message is a byte array. ObjectToXml transformer cannot find a conversion for it. Depending on your config, you may need to add, e.g. ByteArrayToSerializable transformer before xml conversion.

Andrew

On 6/6/07, Anish P. Issac < AIs...@path-solutions.com> wrote:

Hi Andrew,

 

Yes you r right.  But we are going to implement the ESB system in our existing application and we are planning to use Mule as the ESB.

In mule I want to parse one xml file to an object and I tried with the following configuration file. But it is showing the following exception.

 

 

INFO  2007-06-06 18:03:12,779 [main] org.mule.MuleServer: Mule Server initialized.

ERROR 2007-06-06 18:04:02,966 [xmlParser.2] org.mule.impl.DefaultComponentExceptionStrategy: Caught exception in Exception Strategy for: xmlParser: org.mule.umo.ComponentException : Failed to invoke xml.parse.XmlConvertor. Component that caused exception is: xmlParser. Message payload is of type: [B

org.mule.umo.ComponentException : Failed to invoke xml.parse.XmlConvertor. Component that caused exception is: xmlParser. Message payload is of type: [B

      at org.mule.impl.DefaultLifecycleAdapter.intercept(DefaultLifecycleAdapter.java:207 )

      at org.mule.impl.InterceptorsInvoker.execute(InterceptorsInvoker.java:47 )

      at org.mule.impl.model.DefaultMuleProxy.run(DefaultMuleProxy.java:475 )

      at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310 )

      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987 )

      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528 )

      at java.lang.Thread.run(Unknown Source)

Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: note : note

      at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:49 )

      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26 )

      at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:72 )

      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26 )

      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26 )

      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26 )

      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26 )

      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26 )

      at com.thoughtworks.xstream.mapper.CGLIBMapper.realClass(CGLIBMapper.java:40 )

 

 

 

My configuration xml file is

 

< mule-configuration id ="RouterSelection-config" version= "1.0">

 

      < description >

            Configuration for the the "RouterSelection" project

      </ description >

 

      < connector name= "TcpNormalConnector" className ="org.mule.providers.tcp.TcpConnector" ></connector >

     

      < transformers >

      < transformer name= "XmlToObject" className ="org.mule.transformers.xml.XmlToObject" returnClass= "java.lang.Object">

      </ transformer >

      </ transformers >

 

 

      < model name= "RouterSelection">

            <mule-descriptor name= "xmlParser" implementation ="xml.parse.XmlConvertor" >

            <inbound-router >

            <endpoint address= "tcp://localhost:2000" transformers ="XmlToObject" connector= "TcpNormalConnector">

Reply all
Reply to author
Forward
0 new messages