errors while executing Java code in Mirth

mardi 2 septembre 2014

I have a java code snippet where am processing individual text files and append them to make a batch file and the code also contains few sql updates and insert queries. The problem is its working perfectly when am executing it in eclipse IDE but when am importing it as a jar file and executing it in the mirth its throwing errors.



The java code starts of and executes initially but at a point where the files are read its throwing errors at that point.

The below is the error log:



[2014-09-02 18:02:35,156] ERROR (org.mule.impl.DefaultComponentExceptionStrategy:9 5): Caught exception in Exception Strategy for: 158c3715-fcee-412c-b11d-ac8eeceb2ffd: org.mule.umo.routing.RoutingException: Failed to transform message before applying the filter. Failed to route event via endpoint: ImmutableMuleEndpoint{connector=com.mirth.connect. connectors.js.JavaScriptConnector@1a8de42, endpointUri=js://sink, transformer=Transformer{name='ResultMapToXML', returnClass=false, returnClass=false, sourceTypes=[interface java.util.Map, class java.lang.String]}, name='_jsEndpoint#-2106111788', type='receiver', properties={}, transactionConfig=org.mule.impl.MuleTransactionCon fig@10c0d32, filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=true, initialState=started, createConnector=0}. Message payload is of type: java.lang.String

org.mule.umo.routing.RoutingException: Failed to transform message before applying the filter. Failed to route event via endpoint: ImmutableMuleEndpoint{connector=com.mirth.connect. connectors.js.JavaScriptConnector@1a8de42, endpointUri=js://sink, transformer=Transformer{name='ResultMapToXML', returnClass=false, returnClass=false, sourceTypes=[interface java.util.Map, class java.lang.String]}, name='_jsEndpoint#-2106111788', type='receiver', properties={}, transactionConfig=org.mule.impl.MuleTransactionCon fig@10c0d32, 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:79)

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

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

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

at com.mirth.connect.connectors.js.JavaScriptMessageR eceiver.processMessage(JavaScriptMessageReceiver.j ava:102)

at com.mirth.connect.connectors.js.JavaScriptMessageR eceiver.poll(JavaScriptMessageReceiver.java:83)

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

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

at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor.runWorker(ThreadPoolExecutor.java: 1061)

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

at java.lang.Thread.run(Unknown Source)Caused by: org.mule.umo.transformer.TransformerException: CHANNEL:

nsmhajavaCONNECTOR:

sourceConnectorSCRIPT SOURCE:

SOURCE CODE:

1081: function doFilter() { phase = 'filter'; return true; }function doTransform() { phase = 'transformer'; logger = Packages.org.apache.log4j.Logger.getLogger(phase); 1082: 1083: 1084: importPackage(Packages.org.nsmha.finalfile);1085: var customsort = new CustomSorting();1086: var customs = customsort.customs("C:/Users/mahakalab/Desktop/RSNFiles/RSN-Single-Files", "C:/Users/mahakalab/Desktop/RSNFiles/RSN-Final-File", "C:/Users/mahakalab/Desktop/RSNFiles/RSN-Append-Files", "C:/Users/mahakalab/Desktop/RSNFiles/single processed files");1087: 1088: }LINE NUMBER:

1086DETAILS:

Wrapped java.lang.NullPointerException (com.mirth.connect.server.MirthJavascriptTransform erException) (org.mule.umo.transformer.TransformerException)

at com.mirth.connect.server.mule.transformers.JavaScr iptTransformer.transform(JavaScriptTransformer.jav a:316)

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.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 moreCaused by: org.mule.umo.transformer.TransformerException: CHANNEL:

nsmhajavaCONNECTOR:

sourceConnectorSCRIPT SOURCE:

SOURCE CODE:

1081: function doFilter() { phase = 'filter'; return true; }function doTransform() { phase = 'transformer'; logger = Packages.org.apache.log4j.Logger.getLogger(phase); 1082: 1083: 1084: importPackage(Packages.org.nsmha.finalfile);1085: var customsort = new CustomSorting();1086: var customs = customsort.customs("C:/Users/mahakalab/Desktop/RSNFiles/RSN-Single-Files", "C:/Users/mahakalab/Desktop/RSNFiles/RSN-Final-File", "C:/Users/mahakalab/Desktop/RSNFiles/RSN-Append-Files", "C:/Users/mahakalab/Desktop/RSNFiles/single processed files");1087: 1088: }LINE NUMBER:

1086DETAILS:

Wrapped java.lang.NullPointerException (com.mirth.connect.server.MirthJavascriptTransform erException)

at com.mirth.connect.server.mule.transformers.JavaScr iptTransformer.evaluateScript(JavaScriptTransforme r.java:410)

at com.mirth.connect.server.mule.transformers.JavaScr iptTransformer.transform(JavaScriptTransformer.jav a:296)

... 17 moreCaused by: com.mirth.connect.server.MirthJavascriptTransforme rException: CHANNEL:

nsmhajavaCONNECTOR:

sourceConnectorSCRIPT SOURCE:

SOURCE CODE:

1081: function doFilter() { phase = 'filter'; return true; }function doTransform() { phase = 'transformer'; logger = Packages.org.apache.log4j.Logger.getLogger(phase); 1082: 1083: 1084: importPackage(Packages.org.nsmha.finalfile);1085: var customsort = new CustomSorting();1086: var customs = customsort.customs("C:/Users/mahakalab/Desktop/RSNFiles/RSN-Single-Files", "C:/Users/mahakalab/Desktop/RSNFiles/RSN-Final-File", "C:/Users/mahakalab/Desktop/RSNFiles/RSN-Append-Files", "C:/Users/mahakalab/Desktop/RSNFiles/single processed files");1087: 1088: }LINE NUMBER:

1086DETAILS:

Wrapped java.lang.NullPointerException

at com.mirth.connect.server.mule.transformers.JavaScr iptTransformer.evaluateScript(JavaScriptTransforme r.java:398)

... 18 moreCaused by: java.lang.NullPointerException

at java.io.Reader.<init>(Unknown Source)

at java.io.InputStreamReader.<init>(Unknown Source)

at org.nsmha.finalfile.CustomSorting.readSortingOrder (CustomSorting.java:222)

at org.nsmha.finalfile.CustomSorting.customs(CustomSo rting.java:51)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.mozilla.javascript.MemberBox.invoke(MemberBox. java:161)

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

at org.mozilla.javascript.Interpreter.interpretLoop(I nterpreter.java:1702)

at org.mozilla.javascript.Interpreter.interpret(Inter preter.java:845)

at org.mozilla.javascript.InterpretedFunction.call(In terpretedFunction.java:164)

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

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

at org.mozilla.javascript.InterpretedFunction.exec(In terpretedFunction.java:175)

at com.mirth.connect.server.mule.transformers.JavaScr iptTransformer.evaluateScript(JavaScriptTransforme r.java:342)

... 18 more





errors while executing Java code in Mirth

0 commentaires:

Enregistrer un commentaire