My apologies if this has been asked before, did a search and couldn't find
anything. My inbound transformers on a file endpoint do not seem to be
getting applied when I have a component specified.
Here's a simple example that demostrates this:
I have a inbound endpoint polling from a directory which has a FileToString
transformer on the endpoint. The message then gets passed to a custom
Component that does nothing useful - just writes to the log. Then I have an
outbound endpoint that just outputs the message using stdio.
If I do the above then the following is outputted to the screen:
MuleEvent: 3a6a1d9c-04b8-11de-8ce6-57f1fc5634e3, sync=false, stop
processing=fal
se, DefaultInboundEndpoint{endpointUri=file://./files/in,
connector=FileConnecto
r{this=bc0eba, started=true, initialised=true, name='fileConnector',
disposed=fa
lse, numberOfConcurrentTransactedReceivers=4,
createMultipleTransactedReceivers=
true, connected=true, supportedProtocols=[file], serviceOverrides=null},
transfo
rmer=[FileToString{this=b398da, name='fileToString', ignoreBadInput=false,
retur
nClass=class java.lang.String, sourceTypes=[interface java.io.Serializable,
clas
s java.io.InputStream, class java.lang.String, interface
org.mule.api.transport.
OutputHandler, class java.io.File, class [B]}],
name='endpoint.file.files.in', p
roperties={}, transactionConfig=Transaction{factory=null, action=NEVER,
timeout=
0}, filter=null, deleteUnacceptedMessages=false, securityFilter=null,
synchronou
s=false, initialState=started, remoteSync=false, remoteSyncTimeout=10000,
endpoi
ntEncoding=UTF-8}
Where as if I take out the component then I get the actual message contents
outputted to the screen.
<file:file-to-string-transformer name="fileToString"/>
<file:connector name="fileConnector"
moveToDirectory="./files/processed"
moveToPattern="#[ORIGINALNAME]"
streaming="false"
pollingFrequency="5000"/>
<model name="Test">
<service name="ToQueue">
<inbound>
<file:inbound-endpoint path="./files/in"
transformer-refs="fileToString" connector-ref="fileConnector"/>
</inbound>
<component class="test.MySampleComponent"/>
<outbound>
<pass-through-router>
<stdio:outbound-endpoint system="OUT"/>
</pass-through-router>
</outbound>
</service>
</model>
I've tried looking in the Mule source but having been able to find the
problem yet. I'm using Mule 2.1.3-SNAPSHOT but have also confirmed this
happens in Mule 2.1.1. Have yet to try Mule 2.2.0.
Any help would be much appreciated,
Kevin.
************************
This message has been delivered to the Internet by the Revenue Internet e-mail service (OP)
*************************
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
test.MySampleComponent
-----Original Message-----
From: Andrew Perepelytsya [mailto:aper...@gmail.com]
Sent: 27 February 2009 14:53
To: us...@mule.codehaus.org
Subject: Re: [mule-user] Imbound transformer is not getting applied
*************************************
This e-mail has been received by the Revenue Internet e-mail service. (IP)
*************************************
I have removed "implements Callable" from my class. However, I don't want to lose access to the MuleEventContext, so that's all I did. Left the onCall() method as it was.
When I tried to run this, my transformer was finally called (yay!) but now I have the error below, which includes the phrase: does not implement required interface "interface org.mule.api.lifecycle.Callable"
Is it possible to have a function that receives a MuleEventContext in a non-Callable, thus getting transformer setup done at the config level?
Also, why does Callable have to manually call transformers? How can I manually call all the configured transformers on my Callable from within onCall? The transformer stack is different from instance to instance.
Thanks,
Ben
ERROR 2009-05-20 00:26:11,469 [PageParser.2] org.mule.service.DefaultServiceExceptionStrategy:
********************************************************************************
Message : [
The required property "method" is not set on the event
CallableEntryPointResolver:Object "com.parser.CallableParentPageParser@4c21e59a" does not implement required interface "interface org.mule.api.lifecycle.Callable"
Could not find entry point on: "com..parser.CallableParentPageParser" with arguments: "{class [B}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"
Could not find entry point on: "com.parser.CallableParentPageParser" with arguments: "{class [B}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"
]
Type : org.mule.model.resolvers.EntryPointNotFoundException
Code : MULE_ERROR--2
JavaDoc : http://www.mulesource.org/docs/site/current2/apidocs/org/mule/model/resolvers/EntryPointNotFoundException.html
********************************************************************************
Exception stack is:
1. [
The required property "method" is not set on the event
CallableEntryPointResolver:Object "com.parser.CallableParentPageParser@4c21e59a" does not implement required interface "interface org.mule.api.lifecycle.Callable"
Could not find entry point on: "com.parser.CallableParentPageParser" with arguments: "{class [B}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"
Could not find entry point on: "com.parser.CallableParentPageParser" with arguments: "{class [B}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"
] (org.mule.model.resolvers.EntryPointNotFoundException)
org.mule.model.resolvers.DefaultEntryPointResolverSet:63 (http://www.mulesource.org/docs/site/current2/apidocs/org/mule/model/resolvers/EntryPointNotFoundException.html)
********************************************************************************
Root Exception stack trace:
org.mule.model.resolvers.EntryPointNotFoundException: [
The required property "method" is not set on the event
CallableEntryPointResolver:Object "com.parser.CallableParentPageParser@4c21e59a" does not implement required interface "interface org.mule.api.lifecycle.Callable"
Could not find entry point on: "com.parser.CallableParentPageParser" with arguments: "{class [B}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=true, acceptVoidMethods=false}"
Could not find entry point on: "com.parser.CallableParentPageParser" with arguments: "{class [B}" using resolver "ReflectionEntryPointResolver{ignoredMethods=[getClass, clone, equals, hashCode, getInvocationHandler, get*, wait, is*, notify, toString, notifyAll]{transformFirst=false, acceptVoidMethods=false}"
]
at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:63)
at org.mule.component.DefaultLifecycleAdapter.invoke(DefaultLifecycleAdapter.java:205)
at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:83)
at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaComponent.java:74)
at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:133)
at org.mule.component.AbstractComponent.invoke(AbstractComponent.java:161)
at org.mule.service.AbstractService.invokeComponent(AbstractService.java:929)
at org.mule.model.seda.SedaService.access$100(SedaService.java:56)
at org.mule.model.seda.SedaService$ComponentStageWorker.run(SedaService.java:574)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Thread.java:637)
********************************************************************************
If you still haven't come across this in the docs, it's trivial, call eventContext.transformMessage()
HTH,
Andrew
On May 20, 2009 3:35 AM, "Benjamin Cox" <mule.us...@mulesource.com> wrote:> > > > If I change my component to not implement Callable then they will be > > automatically appli...
--------------------------------------------------------------------- To unsubscribe from this list...