MFL and the BEA-382030 Error Message
By Jeff Davies-Oracle on Sep 07, 2011
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:
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"?>
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.
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.
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:
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!