If in the JCA file adapter file you specify PublishSize=1, the file translator will
consider that every LINE (up to EOL) in your file is a MESSAGE.
Even if the Root Element of my message is a complexType made by a sequence of subtypes, the NXSDTranslator will dispatch a message to OSB PER EACH LINE, and the message will contain ONLY THE SUBTYPE, not the Root Element.
Even if you specify uniqueMessageSeparator="someweirdstring", it will keep doing the same trick.
In the log, you see:
jca.file.BatchIndex=1 (2, 3... up to the number of lines in the file)
jca.file.Batch=CsHjmLiOA8VinpSTERKIh6cfUYmxQvUbZzfDlDH0DRI
(all the messages in the same Batch (=file) have the same jca.file.Batch property)
The only way to avoid this DEBATCHING (split a message in multiple submessages) is to explicitly set the PublishSize to a BLANK value (default is 1).
see doc here
PublishSize: This property indicates whether the file contains multiple messages and how many messages to publish to the BPEL process at a time. The parameter is of type int and is not mandatory. The default value is 1.
For example, if a certain file has 11 records and this parameter is set to 2, then the file will be processed 2 records at a time and the final record will be processed in the sixth iteration.
Pay attention to the JCA file, the PublishSize can be nested there.
Look in the nXSD file, there can be a nxsd:publishSize clause, set it to "" (an empty string)
In the logs, per each batch element you will see a separate invocation to the translator:
Invoking inbound translation for : PuO20111212_164122_1640.txt
InboundTranslatorDelegate:: Ordinary DOM Created
Completed inbound translation for : PuO20111212_164122_1640.txt
Classes to monitor:
oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl
(method xlator.translateFromNative(in, res, xlationCtx))
oracle.tip.adapter.file.inbound.ProcessorDelegate
(ProcessorDelegate.process(FileInfo) and does a doXlate)
oracle.tip.adapter.file.inbound.FileActivationSpec
see also http://javatoolsforweblogic.googlecode.com/svn/trunk/nxsd/Translate.java for how to invoke the NXSDTranslatorImpl from CLI
Showing posts with label nxsd. Show all posts
Showing posts with label nxsd. Show all posts
Tuesday, December 27, 2011
Sunday, December 11, 2011
Oracle nXSD in action: parsing EDI to XML
Schema level options:
http://docs.oracle.com/cd/E21764_01/integration.1111/e10231/nfb.htm#CIAHDGJI
Element level options:
http://docs.oracle.com/cd/E21764_01/integration.1111/e10231/nfb.htm#CIACIJCF
lots of valuable examples here
http://otndnld.oracle.co.jp/document/products/as10g/101310/doc_cd/integrate.1013/b28994/nfb.htm#BGBBAJFD
I have a EDI document, made by several fixed length segments.
Each segment starts with a fixed label.
Each segment contains multiple fixed length fields.
Segment can appear in groups (sequence of many segments).
Groups can appear multiple times.
Lesson learned:
* since there is no fixed sequence of segments, you should use this construct
xsd:choice minOccurs="0" maxOccurs="1000"
xsd:element name="ACME0001" type="tns:ACME0001_Type" nxsd:startsWith="ACME0001"
xsd:element name="ACME0002" type="tns:ACME0002_Type" nxsd:startsWith="ACME0002"
....
(using maxOccurs="unbounded" sends the nXSD parser into an infinite loop)
* segments who are not needed, should still be parsed, using a generic element:
xsd:element name="ACME0001" type="tns:Any1064Block_Type" minOccurs="0" maxOccurs="10" nxsd:startsWith="ACME0001 "
where Any1064Block_Type is:
where 1054 = 1064 (length of the segment) - length of the "startsWith" element (ACME0001 )
* if the data you are interested in are in the middle of a segment, you can "skip" the initial characters:
xsd:element name="PONbr" type="xsd:string" minOccurs="1" nxsd:style="fixedLength" nxsd:length="35" nxsd:skip="136"
* you should always consume each segment to its end, maybe using a "FLUFF" element just for the sake of telling the parser to skip data:
xsd:element name="FLUFF2" type="xsd:string" minOccurs="1" nxsd:style="fixedLength" nxsd:length="883"
failing to consume a segment to its exact end will stop the parser.
http://docs.oracle.com/cd/E21764_01/integration.1111/e10231/nfb.htm#CIAHDGJI
Element level options:
http://docs.oracle.com/cd/E21764_01/integration.1111/e10231/nfb.htm#CIACIJCF
lots of valuable examples here
http://otndnld.oracle.co.jp/document/products/as10g/101310/doc_cd/integrate.1013/b28994/nfb.htm#BGBBAJFD
I have a EDI document, made by several fixed length segments.
Each segment starts with a fixed label.
Each segment contains multiple fixed length fields.
Segment can appear in groups (sequence of many segments).
Groups can appear multiple times.
Lesson learned:
* since there is no fixed sequence of segments, you should use this construct
xsd:choice minOccurs="0" maxOccurs="1000"
xsd:element name="ACME0001" type="tns:ACME0001_Type" nxsd:startsWith="ACME0001"
xsd:element name="ACME0002" type="tns:ACME0002_Type" nxsd:startsWith="ACME0002"
....
(using maxOccurs="unbounded" sends the nXSD parser into an infinite loop)
* segments who are not needed, should still be parsed, using a generic element:
xsd:element name="ACME0001" type="tns:Any1064Block_Type" minOccurs="0" maxOccurs="10" nxsd:startsWith="ACME0001 "
where Any1064Block_Type is:
<xsd:complexType name="Any1064Block_Type">
<xsd:sequence>
<xsd:element name="DATA" type="xsd:string" nxsd:style="fixedLength" nxsd:length="1054"/>
</xsd:sequence>
</xsd:complexType>
where 1054 = 1064 (length of the segment) - length of the "startsWith" element (ACME0001 )
* if the data you are interested in are in the middle of a segment, you can "skip" the initial characters:
xsd:element name="PONbr" type="xsd:string" minOccurs="1" nxsd:style="fixedLength" nxsd:length="35" nxsd:skip="136"
* you should always consume each segment to its end, maybe using a "FLUFF" element just for the sake of telling the parser to skip data:
xsd:element name="FLUFF2" type="xsd:string" minOccurs="1" nxsd:style="fixedLength" nxsd:length="883"
failing to consume a segment to its exact end will stop the parser.
Labels:
nxsd
Sunday, December 4, 2011
nxsd:validation, nxsd:fieldValidation,
the question is risen here
https://forums.oracle.com/forums/thread.jspa?threadID=1054790
here the official doc
http://docs.oracle.com/cd/E15586_01/integration.1111/e10231/nfb.htm
Top-Level Validation -> nxsd:validation="true"
information about the line and column in the native stream where the error was encountered is not provided by top-level validation.
Field-Level Validation -> nxsd:fieldValidation="true"
only on inbound payloads
information about the exact line and character where the error was encountered is displayed.
So, what is the difference between
a) NOT using any validation at JCA level
b) using nxsd:validation="true" in the nXSD file
c) using nxsd:fieldValidation="true" in the nXSD file
d) using both nxsd:validation="true" and nxsd:fieldValidation="true" in the nXSD file
and submitting a file which has a correct structure but a validation error in a field.
In case a), the file passes the JCA adapter and is handed over to the Proxy Service
In case b), the file is rejected in the JCA adapter, with this message:
Error while translating inbound file : spaceattheend.dat
ORABPEL-11157
Error: translated xml document does not conform to xml schema.
error:Invalid text 'PAL ' in element: 'UOM'.
Please ensure that native data is correct. To turnoff result validation, unset flag nxsd:validation in nxsd
at oracle.tip.pc.services.translation.framework.XlatorHelper.validateDOMNode(XlatorHelper.java:701)
at oracle.tip.pc.services.translation.framework.XlatorHelper.validate(XlatorHelper.java:667)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.translateFromNative(NXSDTranslatorImpl.java:612)
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)
and
Sending message to Adapter Framework for rejection to user-configured rejection handlers : {
file=C:\in\spaceattheend.dat, Exception=ORABPEL-11157
Error: translated xml document does not conform to xml schema.
error:Invalid text 'PAL ' in element: 'UOM'.
Please ensure that native data is correct. To turnoff result validation, unset flag nxsd:validation in nxsd
}
in case c)
you get a similar message, but it shows also the line and column number
Sending message to Adapter Framework for rejection to user-configured rejection handlers : {
file=C:\in\spaceattheend.dat, Exception=ORABPEL-11156
Error: native data read does not conform to xsd type.
actual-value PAL is not valid for data type . Please check before Line=2, Col=1 in the native stream.
Please ensure that native data conforms to xsd type. To turnoff field validation, unset flag nxsd:fieldValidation in nxsd
in case d)
it's same as c)
https://forums.oracle.com/forums/thread.jspa?threadID=1054790
here the official doc
http://docs.oracle.com/cd/E15586_01/integration.1111/e10231/nfb.htm
Top-Level Validation -> nxsd:validation="true"
information about the line and column in the native stream where the error was encountered is not provided by top-level validation.
Field-Level Validation -> nxsd:fieldValidation="true"
only on inbound payloads
information about the exact line and character where the error was encountered is displayed.
So, what is the difference between
a) NOT using any validation at JCA level
b) using nxsd:validation="true" in the nXSD file
c) using nxsd:fieldValidation="true" in the nXSD file
d) using both nxsd:validation="true" and nxsd:fieldValidation="true" in the nXSD file
and submitting a file which has a correct structure but a validation error in a field.
In case a), the file passes the JCA adapter and is handed over to the Proxy Service
In case b), the file is rejected in the JCA adapter, with this message:
Error while translating inbound file : spaceattheend.dat
ORABPEL-11157
Error: translated xml document does not conform to xml schema.
error:Invalid text 'PAL ' in element: 'UOM'.
Please ensure that native data is correct. To turnoff result validation, unset flag nxsd:validation in nxsd
at oracle.tip.pc.services.translation.framework.XlatorHelper.validateDOMNode(XlatorHelper.java:701)
at oracle.tip.pc.services.translation.framework.XlatorHelper.validate(XlatorHelper.java:667)
at oracle.tip.pc.services.translation.xlators.nxsd.NXSDTranslatorImpl.translateFromNative(NXSDTranslatorImpl.java:612)
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)
and
Sending message to Adapter Framework for rejection to user-configured rejection handlers : {
file=C:\in\spaceattheend.dat, Exception=ORABPEL-11157
Error: translated xml document does not conform to xml schema.
error:Invalid text 'PAL ' in element: 'UOM'.
Please ensure that native data is correct. To turnoff result validation, unset flag nxsd:validation in nxsd
}
in case c)
you get a similar message, but it shows also the line and column number
Sending message to Adapter Framework for rejection to user-configured rejection handlers : {
file=C:\in\spaceattheend.dat, Exception=ORABPEL-11156
Error: native data read does not conform to xsd type.
actual-value PAL is not valid for data type . Please check before Line=2, Col=1 in the native stream.
Please ensure that native data conforms to xsd type. To turnoff field validation, unset flag nxsd:fieldValidation in nxsd
in case d)
it's same as c)
Labels:
nxsd,
validation
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.
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.
Labels:
FileAdapter,
nxsd,
rejectedMessageHandler
Saturday, October 29, 2011
Native Format Language at test (nXSD Command Line Interface)
Here is the tool
http://blogs.oracle.com/adapters/entry/command_line_tool_for_testing
internally it uses oracle.tip.pc.services.translation.framework.TranslatorFactory
to get started, all you need to do is to download these 5 files, adjust the classpath in translator.bat, and run the runme.bat:
here the command to run
here the XSD
here the input flat file
here the bat file with the classpath
here the jar file with the Translate utility
Source file for the Translate utility, which is based on oracle.tip.pc.services.translation.framework.TranslatorFactory
http://blogs.oracle.com/adapters/entry/command_line_tool_for_testing
internally it uses oracle.tip.pc.services.translation.framework.TranslatorFactory
to get started, all you need to do is to download these 5 files, adjust the classpath in translator.bat, and run the runme.bat:
here the command to run
here the XSD
here the input flat file
here the bat file with the classpath
here the jar file with the Translate utility
Source file for the Translate utility, which is based on oracle.tip.pc.services.translation.framework.TranslatorFactory
Labels:
nxsd
Wednesday, October 26, 2011
Native Format Builder generated from Excel formulas
here the reference manual:
http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/nfb.htm
See "7.2.1.3 Defining a Fixed-Length Structure"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
A typical entry consists of:
<element name="to_usd_rate" nxsd:style="fixedLength" nxsd:length="12"
nxsd:padStyle="head" nxsd:paddedBy="0">
<simpleType>
<restriction base="string">
<maxLength value="12" />
</restriction>
</simpleType>
</element>
I am generating all these elements with Excel, because I hate monkey work
I put this text in a file:
ABC Private Limited Street1 Bangalore Karnataka India
I put this in Excel
NAME LENGTH
company 22
address 10
city 10
region 10
country 5
and I use this formula to generate all tags:
="<xsd:element name="""&B11&""" nxsd:style=""fixedLength"" nxsd:length="""&C11&""" nxsd:padStyle=""head"" nxsd:paddedBy=""0""> <xsd:simpleType><xsd:restriction base=""xsd:string""> <xsd:maxLength value="""&C11&""" /> </xsd:restriction> </xsd:simpleType> </xsd:element>"
Here is the Excel file
Here is the generated nXSD:
The classes related to nXSD are in C:\Oracle\Middleware\Oracle_OSB1\soa\modules\oracle.soa.fabric_11.1.1\bpm-infra.jar
and in C:\Oracle\Middleware\Oracle_SOA1\jlib\oracle.soa.dbutils.jar
http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/nfb.htm
See "7.2.1.3 Defining a Fixed-Length Structure"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
A typical entry consists of:
<element name="to_usd_rate" nxsd:style="fixedLength" nxsd:length="12"
nxsd:padStyle="head" nxsd:paddedBy="0">
<simpleType>
<restriction base="string">
<maxLength value="12" />
</restriction>
</simpleType>
</element>
I am generating all these elements with Excel, because I hate monkey work
I put this text in a file:
ABC Private Limited Street1 Bangalore Karnataka India
I put this in Excel
NAME LENGTH
company 22
address 10
city 10
region 10
country 5
and I use this formula to generate all tags:
="<xsd:element name="""&B11&""" nxsd:style=""fixedLength"" nxsd:length="""&C11&""" nxsd:padStyle=""head"" nxsd:paddedBy=""0""> <xsd:simpleType><xsd:restriction base=""xsd:string""> <xsd:maxLength value="""&C11&""" /> </xsd:restriction> </xsd:simpleType> </xsd:element>"
Here is the Excel file
Here is the generated nXSD:
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
xmlns:tns="http://TargetNamespace.com/ServiceName"
targetNamespace="http://TargetNamespace.com/ServiceName"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
nxsd:version="NXSD"
nxsd:stream="chars"
nxsd:encoding="US-ASCII"
>
<xsd:element name="Root-Element">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="company" nxsd:style="fixedLength" nxsd:length="22" nxsd:padStyle="head" nxsd:paddedBy="0"> <xsd:simpleType><xsd:restriction base="xsd:string"> <xsd:maxLength value="22" /> </xsd:restriction> </xsd:simpleType> </xsd:element>
<xsd:element name="address" nxsd:style="fixedLength" nxsd:length="10" nxsd:padStyle="head" nxsd:paddedBy="0"> <xsd:simpleType><xsd:restriction base="xsd:string"> <xsd:maxLength value="10" /> </xsd:restriction> </xsd:simpleType> </xsd:element>
<xsd:element name="city" nxsd:style="fixedLength" nxsd:length="10" nxsd:padStyle="head" nxsd:paddedBy="0"> <xsd:simpleType><xsd:restriction base="xsd:string"> <xsd:maxLength value="10" /> </xsd:restriction> </xsd:simpleType> </xsd:element>
<xsd:element name="region" nxsd:style="fixedLength" nxsd:length="10" nxsd:padStyle="head" nxsd:paddedBy="0"> <xsd:simpleType><xsd:restriction base="xsd:string"> <xsd:maxLength value="10" /> </xsd:restriction> </xsd:simpleType> </xsd:element>
<xsd:element name="country" nxsd:style="fixedLength" nxsd:length="5" nxsd:padStyle="head" nxsd:paddedBy="0"> <xsd:simpleType><xsd:restriction base="xsd:string"> <xsd:maxLength value="5" /> </xsd:restriction> </xsd:simpleType> </xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<!--NXSDWIZ:C:\tmp\sample.dat:-->
<!--USE-HEADER:false:-->
The classes related to nXSD are in C:\Oracle\Middleware\Oracle_OSB1\soa\modules\oracle.soa.fabric_11.1.1\bpm-infra.jar
and in C:\Oracle\Middleware\Oracle_SOA1\jlib\oracle.soa.dbutils.jar
Subscribe to:
Posts (Atom)