MFL and the BEA-382030 Error Message

I was recently working with a very simple MFL file that I was using to read in a CSV file of information and converting it into XML. When I tested the MFL using the Format Builder tool, the MFL worked just fine. However, when I hooked it up to my proxy service, I received a BEA-382030 error message with the following explanation: "Failure while unmarshalling message: Failed to transform MFL content from binary to XML"

Searching the web didn't yield much information on this, other than the fact that others had encountered the same error as far back as 2009. I thought maybe I had uncovered a bug, but I'm happy to say it turned out to be "pilot error" on my part. The problem stemmed from my incomplete understanding of how the MFL tool is configure to parse data. Let me recount how I created the bug, then I'll show you the very simple solution.

The CSV file I needed to parse only had 3 fields: first name, last name and company. Here is a sample of the text it contained:

Bob,Hope,MGM
Lucille,Ball,MGM
Harold,Lloyd,Unknown


Each line represents a customer. From this CSV file I wanted to create an XML representation as follows:

<?xml version="1.0" encoding="UTF-8"?>
<CustomerList>
  <Customer>
    <firstName>Bob</firstName>
    <lastName>Hope</lastName>
    <company>MGM</company>
  </Customer>
  <Customer>
    <firstName>Lucille</firstName>
    <lastName>Ball</lastName>
    <company>MGM</company>
  </Customer>
  <Customer>
    <firstName>Harold</firstName>
    <lastName>Lloyd</lastName>
    <company>Unknown</company>
  </Customer>
</CustomerList>


I begin my defining the XML root node as "CustomerList". I then add a Group named "Customer" to the root node. I set the Group Occurrence to "Unlimited" and leave the Group Delimter field as None. This is shown in the following screenshot.

The default Customer configuration

Next, I added fields to the Customer group. The firstName and lastName fields are strings with the Field Occurrence set to Once and the Terminator set to "," (a comma). The last field is the "customer" field which is also a String type but its delimeter field is set to "\n" (a newline). I saved everything then tested the MFL against my test file (using the built in tester with the MFL tool) and of course, it all works just fine.

The lastName field and firstName fields are identical in their configuration

The company field is terminated by the newline character

So what is wrong with that? Well, it turns out that to properly configure the MFL so that you don't get the BEA-382030 error message, you need to configure the Customer group slightly differently. You need to select the Delimited radio button in the Group Delimeter group AND check BOTH the "Delimiter Is Shared" and "Delimiter Is Not Optional" checkboxes. Set the Value field to "\n" also. This tells the MFL tool that the \n at the end of each line not only terminates the company field, but also serves to terminate the Customer group also (hence the Delimiter is Shared). The correct configuration for the Customer group is shown next:

Proper configuration for the Customer group


After you make those changes and save the MFL file, I recommend that you refresh the MFL file (highlight it in the project explorer and press the F5 key). You may also want to re-select the MFL file in the proxy service just to make shure everything is properly updated. Then deploy your proxy service and test as you would normally. That pesky BEA-382030 error message will no longer bother you!

Comments:

Hi,

While trying out this example in OSB 11g, ran into the same problem following the same steps...Realized that MFL by default sets the Latin format in the code page. Needed to change the code page to UTF-8 to make it work

Thanks...Vijay

Posted by Vijay Nair on October 24, 2011 at 03:20 PM PDT #

Also, make sure the file format of your txt file matches the code page. Stuck on an XP box, when I initially made the file it was saved as PC format in ANSI. I resaved the file in TextEdit as Unix/UTF-8 and all was well.

Dave

Posted by everydave on November 29, 2011 at 03:52 AM PST #

I tried the same example on my Windows machine. Everything is same as shown in your video. I created sample file in textpad and saved it in UTF-8 and file format as PC. Created another sample file in textpad and saved it in UTF-8 and file format as UNIX. In both cases I get following error. Please advise

<MFLException>
<ErrorMessage>Delimiter not found.</ErrorMessage>
<Details>
<Detail>
<Name>ErrorCode</Name>
<Value>-6</Value>
</Detail>
<Detail>
<Name>DataOffset</Name>
<Value>94</Value>
</Detail>
<Detail>
<Name>NodeName</Name>
<Value>FirstName</Value>
</Detail>
<Detail>
<Name>FullyQualifiedName</Name>
<Value>CustomerList.Customer.FirstName</Value>
</Detail>
<Detail>
<Name>ExpectedValue</Name>
<Value>,</Value>
</Detail>
</Details>
</MFLException>

Posted by Sujeet on April 17, 2012 at 05:14 AM PDT #

Hi Jeff,
I have the same requirement except that my input file size is very large (20 GB), which when I try to transform through proxy throws OutOfMemory exceptions. I have alternative solutions for this implemented which feeds the proxy through a weblogic Timer application which puts certain number of messages in a queue every 15 seconds. The queue is read by a proxy which transforms the message and invokes a web service. The webservice has limitations and I have controlled the number of threads at proxy and Business Service that calls the Service.

I want to know if I can read a large file directly through a proxy? If yes how and whether we can control the rate of reading the lines?
Thanks
Sujeet

Posted by guest on April 17, 2012 at 05:40 AM PDT #

Sujeet,
Your first problem appears to be that you don't have the matching delimeter after the FirstName field. Double check your MFL file and the data file to be sure that the expected delimiter really is there.

As for your 2nd question, you can read a large file through a proxy, though I recommend using the "pass through" (aka streaming) option if moving the file. If you have to actually parse the file, then you will have to be able to realize the file into memory. 20GB is pretty large for a data file. Mind if I ask what kind of data it contains?

If there is anyway to "chunck" that large file into more manageable pieces, that might be a better way to go.

- Jeff

Posted by Jeff on April 17, 2012 at 07:23 AM PDT #

Solved the mfl issue by refreshing it through workspace and then test ran fine.

Reading the large size file through a proxy is still an issue. I need some mechanism in proxy to read some fixed number of lines at a time and not to load entire file contents into the memory. My Timer reader works well but it is external to OSB. It just puts predefined number of lines read from a big file, puts into a queue, and sleeps for 15 seconds. It perform this repeadly
until entire file is read.

The proxy that reads the queue does mfl/xquery transformations and calls Web Service via business services.

I want to overcome two problems:
1> Remove extra overhead of Timer based file reader which is external to
proxy. I want proxy to do the large size file reading. This will get rid
of queue
2> Somehow slow down/throttle WebService callouts from OSB, one possible solution
would be mechanism in the proxy reading the large file, should read line
slowly/or do chunked read.

If you have any experience doing this successfully, kindly do share here. I am open to have discussion with you how I implemented the solution.

Regards
Sujeet

Posted by guest on April 17, 2012 at 08:35 AM PDT #

ah, tricky. fixed my issue. Thanks for the hint!

Posted by guest on May 17, 2012 at 01:20 PM PDT #

Hi all,

As per the Service Land Scape Design, can we map the OSB Proxy/BS Services as per below

Enterprice Layer - PS
Domain Layer - PS
Atomic Layer - BS
Physical Layer - Actual Applications or wrapers developed

Please comment on it.

Posted by guest on June 09, 2012 at 06:43 AM PDT #

Service Landscape doesn't quite map that way simply because a business service (in Service Bus terms) is really just meta data about some external service. So at the Atmoic layer (which I now call the Technical layer in my more recent writings) you would have a stand-alone web service, or some other interface technology (JDBC, EJB, etc). The service at the business layer would have a proxy service (PS) and 0..* business services (BS) that connect to the Atomic layer.

Also, if you were to declare that OSB business services were Atomic services, only OSB would ever be able to access them. In practice, you may well want those atomic services to be accessed from different service consumers.

- Jeff

Posted by Jeff on June 11, 2012 at 11:58 AM PDT #

Thanks very much jeff for the response. my intention of mentioning BS Service is to connect to the Physical layer if it opens up the WebService Interface if not Develop one and then connect to that WebService or any other complient interface.

Enterprice Layer - PS
Domain Layer - PS
Atomic Layer - BS (connets to WebService Wrapper Developed or directly connectes when not required) --- correct me here.
Physical Layer - Actual Applications or wrapers developed

Thanks
Madhava reddy p

Posted by madhava reddy p on June 11, 2012 at 07:59 PM PDT #

One more point,

In the Book Definitive Guide to SOA as part of Implementing the Serivce Landscape(as per the Figure13-5), Atomic Layer is implemented through Proxy Service and Plain WebService. Is it that we have to go by requirement and depending on it should deside weather to implement it through Proxy or Normal WebService.

When you say business layer what all layers it comprises of, if my guess is correct it would be Enterprise and Domain Layers.

and what if the Physical Layer is already exposed through WebService Interface, still we need to have WebService wraper Implemeted over it or can we directly use BS and connect to it directly from Doamin Layer. pls sugest.

please also let me know where can i access your most recent writings on serivice Landscape.

Thanks
Madhava reddy p

Posted by madhava reddy p on June 11, 2012 at 11:28 PM PDT #

Hi,

I have a CSV file information and trying to convert it into XML. When I tested the MFL using the Format Builder tool, the MFL worked fine as in your discribed case.
However, when tested the same in proxy service getting the following:-
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-382030</con:errorCode>
<con:reason>
Failure while unmarshalling message: Failed to transform MFL content from binary to XML
</con:reason>
<con:location>
<con:node>PipelinePairNode1</con:node>
<con:path>request-pipeline</con:path>
</con:location>
</con:fault>

I have put the delimeters,\n and also tried with different CSV, even save them as UTF-8. However the issue still persist.

Kindly suggest. thansk

Regards,
Himanshu

Posted by Himanshu Gupta on June 19, 2012 at 04:31 AM PDT #

Himanshu,
You might try refreshing the file through the workspace (F5) as that worked for Sujeet.

- Jeff

Posted by Jeff on June 19, 2012 at 11:26 AM PDT #

very first solution
Posted by Vijay Nair on October 24, 2011 at 03:20 PM PDT
solved my problem

Posted by vikas on June 25, 2012 at 11:07 PM PDT #

How do i convert a binary String to a Hexdecimal string using MFL ??

Posted by sampath on September 12, 2012 at 11:42 PM PDT #

Hi,

I followed the same document 100% but still i am getting the same error code.Can you please explain me what is the file path we need to mention in transport tab (file:///C:/OSB/osb_files/input)if server is are running on windows machine . I mentioned the path in above example and also for File Transport tab(/C://OSB/osb_files/error) . Can you Please explain me

Posted by guest on November 16, 2012 at 10:08 PM PST #

$fault:
BEA-382030
Failure while unmarshalling message: Failed to transform MFL content from binary to XML

i follow whatever you mentioned in your video. i verified code base format and field format everything set to utf-8 but still i am facing above problem.
any one can help me?
Thanks in advance..

Posted by guest on November 27, 2012 at 06:09 AM PST #

Hi Jeff,

We are doing a vice-versa of the above case, from xml to csv. Here is the scenario:

We have created a MFL transformation out of an XSD and developed one proxy service which is having the MFL transformation in the request stage and assign the $body/* to a temp variable.

Now when we tried to test this , we are getting an error as below:

Binary to XML mfl transformation failed for the MFL Resource XX/Resources/XXXXXXX : null

I am able to test the MFL created successfully with comma(,) as a delimiter but when we are trying to test it from proxy service we are getting the above error.

Could you please help us in resovling this?

Thanks,
Vardhan

Posted by vardhan on January 22, 2013 at 05:03 AM PST #

the information in this blog appears to be no longer true.
I created the example without specifying Group Delimiter and it worked fine both with the MFL tester and from "outside".

Posted by guest on March 26, 2013 at 07:45 AM PDT #

But Can we have direct XSD instead of MFL to read the file as we do in SOA. Can you provide insight why we need MFL

Posted by guest on April 18, 2013 at 05:57 AM PDT #

Hi hello,

We have a requirement to covert a binary data(will get binary data from JCAPS) to XML format through MFL transformation . is it possible ?

Posted by Atanu on October 15, 2013 at 12:16 AM PDT #

If you are not able to create customer.txt file on windows platform. Here are the steps:
1. Open MS word.
2. Type the content
Bob,Hope,MGM
Lucille,Ball,MGM
Harold,Lloyd,Unknown
3. Save as Plain Text
4. File conversion Pop up will appear.
5. Choose Other Encoding radio button.
6. From the available encoding, select Unicode (UTF-8)

Done!! your file is ready to use.

Enjoy the coding

Posted by guest on February 12, 2014 at 06:11 AM PST #

Hi jeff
I am getting the following error when i transform Non-XML to XML

<MFLException> <ErrorMessage> Data mismatch exception.</ErrorMessage> <Details>
<Detail>
<Name>ErrorCode</Name>
<Value> -1<Nalue>
</Detail> <Detail>
<Name> Data0ffset</Name>
<Value>52<Nalue>
</Detail>
<Detail>
<Name>NodeName</Name>
<Value> company<Nalue>
</Detail>
<Detail>
<Name> FullyQualifiedName</Name>
<Value> CustomerList.Customer.company<Nalue>
</Detail>
<Detail>
< Name> ExpectedValue</Name>
<Value>,I<Nalue>
</Detail>
<Detail>
<Name>Reason</Name>
<Value>Delimiter not found<Nalue>
</Detail>
</Details>
</MFLException>

Posted by Kanagaraj on February 28, 2014 at 05:42 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

A site for SOA thought and discussion.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today