PDA

View Full Version : Can't find method


coffde
05-17-2010, 12:26 PM
Missing method:

Can't find method com.webreach.mirth.server.util.FileUtil.write....

OS = XP, Mirth version = Mirth Connect Administrator 1.8.2.4472

geraldb
05-17-2010, 04:28 PM
Can you provide more details how on you got this error? Did you drag-and-drop a reference list item?

coffde
05-18-2010, 01:14 PM
I did. The method was drug from the right side when trying to create a pre processor script.

Here is the preprocessor script...

FileUtil.write('test_file.dat', message);
return message;

Her eis the error text:


[2010-05-18 15:48:22,780] ERROR (com.webreach.mirth.connectors.file.FileMessageRec eiver:239): Unable to route.org.mule.umo.routing.RoutingException: Failed to transform message before applying the filter. Failed to route event via endpoint: ImmutableMuleEndpoint{connector=com.webreach.mirth .connectors.file.FileConnector@a99f35, endpointUri=file://C:/Documents%20and%20Settings/dec3227/My%20Documents/MIRTH%20Input%20Repository, transformer=Transformer{name='ByteArrayToString', returnClass=false, returnClass=false, sourceTypes=[class [B, class java.lang.String]}, name='_fileEndpoint#103652774', type='receiver', properties={}, transactionConfig=org.mule.impl.MuleTransactionCon fig@528f20, filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=true, initialState=started, createConnector=0}. Message payload is of type: java.lang.String

at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:64)

at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:83)

at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:493)

at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:272)

at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:231)

at com.webreach.mirth.connectors.file.FileMessageRece iver.processFile(FileMessageReceiver.java:233)

at com.webreach.mirth.connectors.file.FileMessageRece iver.poll(FileMessageReceiver.java:123)

at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:90)

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

at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)

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

at java.lang.Thread.run(Unknown Source)
Caused by: org.mule.umo.transformer.TransformerException: Can't find method com.webreach.mirth.server.util.FileUtil.write(stri ng,string). (1ac8ed51-baee-4e6e-a257-7ad46dfc4706#8) (org.mozilla.javascript.EvaluatorException)

at com.webreach.mirth.server.mule.transformers.JavaSc riptPreprocessor.doPreprocess(JavaScriptPreprocess or.java:167)

at com.webreach.mirth.server.mule.transformers.JavaSc riptPreprocessor.transform(JavaScriptPreprocessor. java:118)

at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)

at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)

at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)

at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)

at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:61)

... 11 more
Caused by: org.mozilla.javascript.EvaluatorException: Can't find method com.webreach.mirth.server.util.FileUtil.write(stri ng,string). (1ac8ed51-baee-4e6e-a257-7ad46dfc4706#8)

at org.mozilla.javascript.DefaultErrorReporter.runtim eError(DefaultErrorReporter.java:109)

at org.mozilla.javascript.Context.reportRuntimeError( Context.java:945)

at org.mozilla.javascript.Context.reportRuntimeError( Context.java:1001)

at org.mozilla.javascript.Context.reportRuntimeError1 (Context.java:964)

at org.mozilla.javascript.NativeJavaMethod.call(Nativ eJavaMethod.java:166)

at org.mozilla.javascript.optimizer.OptRuntime.call2( OptRuntime.java:76)

at org.mozilla.javascript.gen._1ac8ed51_baee_4e6e_a25 7_7ad46dfc4706_110._c_doPreprocess_3(1ac8ed51-baee-4e6e-a257-7ad46dfc4706:8)

at org.mozilla.javascript.gen._1ac8ed51_baee_4e6e_a25 7_7ad46dfc4706_110.call(1ac8ed51-baee-4e6e-a257-7ad46dfc4706)

at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:108)

at org.mozilla.javascript.gen._1ac8ed51_baee_4e6e_a25 7_7ad46dfc4706_110._c_script_0(1ac8ed51-baee-4e6e-a257-7ad46dfc4706:11)

at org.mozilla.javascript.gen._1ac8ed51_baee_4e6e_a25 7_7ad46dfc4706_110.call(1ac8ed51-baee-4e6e-a257-7ad46dfc4706)

at org.mozilla.javascript.ContextFactory.doTopCall(Co ntextFactory.java:426)

at org.mozilla.javascript.ScriptRuntime.doTopCall(Scr iptRuntime.java:3157)

at org.mozilla.javascript.gen._1ac8ed51_baee_4e6e_a25 7_7ad46dfc4706_110.call(1ac8ed51-baee-4e6e-a257-7ad46dfc4706)

at org.mozilla.javascript.gen._1ac8ed51_baee_4e6e_a25 7_7ad46dfc4706_110.exec(1ac8ed51-baee-4e6e-a257-7ad46dfc4706)

at com.webreach.mirth.server.mule.transformers.JavaSc riptPreprocessor.doPreprocess(JavaScriptPreprocess or.java:156)

... 17 more

geraldb
05-18-2010, 01:42 PM
Try this:

FileUtil.write('test_file.dat', true, message);

The append(true/false) means that you must specify either true or false for the option to append to the file (this is admittedly poor syntax that should be addressed in a future version).

Hope this helps.

coffde
05-18-2010, 02:12 PM
It works now! Thanks.