[XML Records] XMLRecords J2EE Stack Support

Forge Component
Published on 11 Jan by Afonso Carvalho
34 votes
Published on 11 Jan by Afonso Carvalho


Does anybody have a version which support this extension (XMLRecords) on J2EE stack?

Thank you in advance.
Best Regards.

Daniel Martins.
Long standing request feature has been implemented.

I have just added version 1.5.0 of the XML Records component which implements most of the features in Java. Check the "What's New" on the version for details on implemented / tested features.

If you find anything amiss with that version, please let me know.
Hi Ricardo

By the way there is a bug in the .NET,

BUG: when ExcludeIfNull is set to true, it should remove all empty elements but it does not exclude null elements!
I've already notified Gonçalo Borrêga he knows about it, I fixed it, forgot to publish it, - I've emailed the fix.

I just tried the Java version and it seems it has a bug, or maybe I'm doing something wrong.

I have a text variable that has a XML content, which I want to map to a local variable which has a structure type (exactly the same as structure as the XML file) - I included in attach the XML content and an image of the struture that I created.

It seems all ok, but when debugging I realize that the customers list is not mapped, ie, is filled in the XML content but after calling XmlToRecordList the structure is not fulfilled, BUT all the other structures are fulfilled successfully (eg, the channels list has exactly the same characteristics as customers, since both are lists, but only channels are mapped). Maybe it's because the customers tag is the last tag and it's not being read? (just a blind guess)

The same content mapping was previously tried in OS 7 (.net stack), but now I need to use OS 8 (java stack), I did some different things in the OS v8 but not what concerns the XML mapping. Do you think it's something related to this version?

Thank you very much.


Ricardo Ribeiro
Yes, Indeed there seems to be a bug in the Java code when there are several record list attributes in the same record.

I will look into that and upload a fixed version as soon as it is possible to me.

Thank you for reporting this.
Version 1.5.1 of XML Records should fix the issue Ricardo Ribeiro is having.

Please try it out.
Hi Ricardo,

You are a life saver! This update actually worked pretty well!

Thank you very much.


Ricardo Ribeiro

I am struggling with an issue.

I have a simple query, calling the first 50 records. (entity is an external xif with 114 attributes)
I call an action, and I provide it with an object ToObject(GetQuery.List)
there I do a simple RecordListToXml.

the result is that I get only 50 <EntityName/> without any attributes.
I don't provide any configs.

what am I missing?

using 1.5.1
platformserver: weblogic-stack
Hello Statler & Waldorf,

Can you provide us with an eSpace that replicates the behavior ?

Please remember that recordlist2xml will ommit default-value attributes by default.

Best regards,
Ricardo Silva
here or via email?

And I understand the omitting, but everything is filled :/

As you prefer. Here would be helpful for other people who might run into the same issue :)
Ricardo Silva wrote:
As you prefer. Here would be helpful for other people who might run into the same issue :)
 here you go.
and a screenshot of proof data does exist ;)

any luck?

I need this otherwise I need to crawl back into java myself ;)

I altered the code somewhat, and noticed the size of rec.getFieldNames() is 0,
so the for-loop will be skipped

I do get the fields (even though it's prefixed with underscores) info when I am using: getDeclaredFields instead of getFields.

Looking at the source for the extension there are only public getters/settering, not fields.

Thank you for the dive Statler.

That may be the issue and I'll look further into the code, when I get some time for it.

It's possible that the java version of XML records does not work correctly with structures that come from an entity.

As a workaround you can use a structure similar to your entity and copy the data there.
Hi Statler. Version 1.5.2 of the XML records extension should fix this problem.

Let me know if you encounter any issue with it.

Encountering this atm:

java.lang.IllegalAccessException: Class outsystems.nosxmlrecords.RecordFacade can not access a member of class ostestrecordlist2xml.entities.ENPERSONENEntityRecord with modifiers "private"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
at java.lang.reflect.Field.doSecurityCheck(Field.java:960)
at java.lang.reflect.Field.getFieldAccessor(Field.java:896)
at java.lang.reflect.Field.get(Field.java:358)
at outsystems.nosxmlrecords.RecordFacade.getAttr(Unknown Source)
That's odd... it worked on the little test I made.

I know how to fix it, but I'll need to change RecordFacade a bit and I don't think I'll be able to do it today.
Actually, a quick search found a possible quicker (and dirtier) solution.

Can you replace RecordFacade with the attached file and let me know if it worked?

It works :)

Hi Ricardo,

I was having issues using your extension, so I've tried the Example eSpace from XML.Records-1.3.osp with the J2EE 1.5.2 version of extension, and I get exactly the same behaviour as in my eSpace.

After publishing the Example eSpace I open it and export an XML without modifying anything on the screen. Then I click on import button (use the previous output as input). As a result I get the following error: 'unexpected format. You should have only one root element named <RecordList>'

I've noticed that the 'RecordList' parameter uses rlGroup record list. Tried changing it to Group record instead, and got this error: 'Parameter 'RecordList' must be a valid RecordList of Records of the type that you want to deserialize.'

Could you please help me sorting this out, as I have exactly the same situation on my eSapce?


The fix for the entities problem has been uploaded into version 1.5.3.

Regarding Ignas' problem, it might have fallen into the "this wasn't actually tested" space :)

Can you confirm that you are trying to use the Java version of the component? I'm not sure how soon I'll be able to look into the problem you are having.

Best regards,
Ricardo Silva
Hi Ricardo,

Thanks for response. I confirm it's Java version of the extension.


Provided a copy suitable for Outsystems 10 on java stack