Thursday, January 20, 2011

FileAdapter claiming that a message is malformed

20-Jan-2011 10:10:32 o'clock WET warning jca_framework_and_adapter 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.

20-Jan-2011 10:10:32 o'clock WET warning jca_framework_and_adapter BEA-000000 onReject: Sending invalid inbound message to Rejection Handler:


This happens when processing a 40000 lines file (5 MB of info).
The funny thing is that if I halve the number of lines, it works. And the second half of the file is exactly the same as the first. So I am sure it's NOT a problem with the data format, but rather with the message size.
No further clue is provided by the adapter.

Here look at 25.1.5 Logging for how to turn on debug flag (go to
C:\Oracle1\Middleware\user_projects\domains\soadev\alsbdebug.xml and set
alsb-jca-framework-adapter-debug to true, then restart the server)

but to no avail.

Where is file://jca\Read\rejectedMessages defined?
Here they give some clues, like setting

property name="rejectedMessageHandlers" to file://C:/orabpel/samples/test/errorTest
/rejectedMessages
but it's not accepted by FileAdapter.

see also here the official Oracle doc.

The adapter implementation is oracle.tip.adapter.file.inbound.FileActivationSpec

See here for a list of properties for the Adapter.


Here http://niallcblogs.blogspot.com/2010/09/oracle-file-adapter-osb-11g-debatching.html an interesting post on the OSB/Batch Reading topic.



At last I use these settings:

<adapter-config name="MyFileReader" adapter="File Adapter" wsdlLocation="MyFileReader.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
  
  <connection-factory location="eis/FileAdapter" UIincludeWildcard="*.txt" adapterRef=""/>
  <endpoint-activation portType="Read_ptt" operation="Read">
    <activation-spec className="oracle.tip.adapter.file.inbound.FileActivationSpec">
      <property name="UseHeaders" value="false"/>
      <property name="PhysicalDirectory" value="C:/acmepoc/myFiles/in"/>
      <property name="Recursive" value="true"/>
      <property name="PublishSize" value="200"/>
       <property name="DeleteFile" value="true"/>
      <property name="IncludeFiles" value=".*\.txt"/>
      <property name="PollingFrequency" value="10"/>
      <property name="MinimumAge" value="0"/>
    </activation-spec>
  </endpoint-activation>

</adapter-config>



and I get a beautiful OutOfMemoryException :



JCA_FRAMEWORK_AND_ADAPTER BEA-000000 InboundTranslatorDelegate caught Generic Exception , the Resource Adapter will ignore this
java.lang.OutOfMemoryError: Java heap space


No comments: