Wednesday, November 9, 2011

Anatomy of a JCA File Adapter parsing failure

If you submit a "broken" file to a File Adapter associated to a nXSD transformation, you might expect something like this to happen (see after).

To be noticed:

* eventually, the file is moved to the error directory

* The entry point to the translation is oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.translateFromNative


* The exception is a ORABPEL-11168
* The Proxy Service is not invoked, so there is no way to trace this error in OSB.

* To trace the error, you must implement a RejectedMessageHandler
* In alternative, you could "grep" the logs for ORABPEL-11168 with WLDF, but this solution really sucks

So implementing a RejectedMessageHandler seems to me the best way to trace the error. This requires more investigation.


<08-Nov-2011 22:39:57 o'clock CET> <Info> <JCA_FRAMEWORK_AND_ADAPTER> <pierrepc> <osb_server1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <9218d6466d04a9d6:5003231f:133830ed055:-8000-0000000000000031> <1320788397613> <BEA-000000> <Error while translating inbound file : po00000BROKEN.dat
ORABPEL-11168

Error while reading native data.
[Line=1, Col=1] Expected "," for the data starting at the specified position, while trying to read the data for "element with name OrderNumber", using "style" as "terminated" and "terminatedBy" as ",", but not found.
Ensure that ",", exists for the data starting at the specified position.

at oracle.tip.pc.services.translation.xlators.nxsd.NXSDStyleBasedReader.readTerminatedStyle(NXSDStyleBasedReader.java:338)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.readTerminatedStyle(NXSDTranslatorImpl.java:2771)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.readNativeData(NXSDTranslatorImpl.java:2841)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.processScalarType(NXSDTranslatorImpl.java:3600)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.processElement(NXSDTranslatorImpl.java:3800)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.parseNXSD(NXSDTranslatorImpl.java:1327)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.processGroup(NXSDTranslatorImpl.java:3705)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.parseNXSD(NXSDTranslatorImpl.java:1334)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.processComplexType(NXSDTranslatorImpl.java:3841)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.parseNXSD(NXSDTranslatorImpl.java:1330)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.processElement(NXSDTranslatorImpl.java:3806)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.parseNXSD(NXSDTranslatorImpl.java:1327)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.processGroup(NXSDTranslatorImpl.java:3705)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.parseNXSD(NXSDTranslatorImpl.java:1334)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.processComplexType(NXSDTranslatorImpl.java:3841)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.parseNXSD(NXSDTranslatorImpl.java:1330)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.processElement(NXSDTranslatorImpl.java:3806)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.parseNXSD(NXSDTranslatorImpl.java:1327)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.doTranslateFromNative(NXSDTranslatorImpl.java:846)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.translateFromNative(NXSDTranslatorImpl.java:602)
at oracle.tip.adapter.file.inbound.InboundTranslatorDelegate.xlate(InboundTranslatorDelegate.java:314)
at oracle.tip.adapter.file.inbound.InboundTranslatorDelegate.doXlate(InboundTranslatorDelegate.java:121)
at oracle.tip.adapter.file.inbound.ProcessorDelegate.doXlate(ProcessorDelegate.java:388)
at oracle.tip.adapter.file.inbound.ProcessorDelegate.process(ProcessorDelegate.java:174)
at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:349)
at weblogic.work.ContextWrap.run(ContextWrap.java:41)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
>
####<08-Nov-2011 22:39:57 o'clock CET> <Info> <JCA_FRAMEWORK_AND_ADAPTER> <pierrepc> <osb_server1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <9218d6466d04a9d6:5003231f:133830ed055:-8000-0000000000000031> <1320788397614> <BEA-000000> <Since a translation exception was thrown, this indicates that it is a non-debatching scenario.>
####<08-Nov-2011 22:39:57 o'clock CET> <Info> <JCA_FRAMEWORK_AND_ADAPTER> <pierrepc> <osb_server1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <9218d6466d04a9d6:5003231f:133830ed055:-8000-0000000000000031> <1320788397615> <BEA-000000> <Failed to translate file : {C:\acme\ffmw\po\in\po00000BROKEN.dat}>
####<08-Nov-2011 22:39:57 o'clock CET> <Info> <JCA_FRAMEWORK_AND_ADAPTER> <pierrepc> <osb_server1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <9218d6466d04a9d6:5003231f:133830ed055:-8000-0000000000000031> <1320788397615> <BEA-000000> <Sending message to Adapter Framework for rejection to user-configured rejection handlers : {
file=C:\acme\ffmw\po\in\po00000BROKEN.dat, Exception=ORABPEL-11168

Error while reading native data.
[Line=1, Col=1] Expected "," for the data starting at the specified position, while trying to read the data for "element with name OrderNumber", using "style" as "terminated" and "terminatedBy" as ",", but not found.
Ensure that ",", exists for the data starting at the specified position.

}>
####<08-Nov-2011 22:39:57 o'clock CET> <Warning> <JCA_FRAMEWORK_AND_ADAPTER> <pierrepc> <osb_server1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <9218d6466d04a9d6:5003231f:133830ed055:-8000-0000000000000031> <1320788397616> <BEA-000000> <onReject: The resource adapter 'File Adapter' requested handling of a malformed inbound message. However, the following activation property has not been defined: 'rejectedMessageHandlers'. Please define it and redeploy. Will use the default Rejection Directory file://jca\Read\rejectedMessages for now.>
####<08-Nov-2011 22:39:57 o'clock CET> <Warning> <JCA_FRAMEWORK_AND_ADAPTER> <pierrepc> <osb_server1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <9218d6466d04a9d6:5003231f:133830ed055:-8000-0000000000000031> <1320788397616> <BEA-000000> <onReject: Sending invalid inbound message to Rejection Handler: >
####<08-Nov-2011 22:39:57 o'clock CET> <Info> <JCA_FRAMEWORK_AND_ADAPTER> <pierrepc> <osb_server1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <9218d6466d04a9d6:5003231f:133830ed055:-8000-0000000000000031> <1320788397618> <BEA-000000> <Handing rejected message to DEFAULT rejection handler: file://jca\Read\rejectedMessages since none of the configured rejection handlers [] succeeded.>
####<08-Nov-2011 22:39:57 o'clock CET> <Info> <JCA_FRAMEWORK_AND_ADAPTER> <pierrepc> <osb_server1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <9218d6466d04a9d6:5003231f:133830ed055:-8000-0000000000000031> <1320788397622> <BEA-000000> <Copying file :C:\acme\ffmw\po\in\po00000BROKEN.dat to user-defined archive directory for files with errors :C:\acme\ffmw\po\error>



See also this Oracle documentation on the rejectedMessageHandler topic

Errors or faults arising after the message is posted to Service Infrastructure layer are not rejected. These faulted messages are handled by the Service Infrastructure components and will not be considered as rejected messages.

Adapters and other binding components (for example, WS Binding Component) reject messages which error out at the binding level, that is, before entering the Service Infrastructure layer. All rejected messages are stored in the Database with payload.


No comments: