Error Message: librariesElement is null

Hi

When i select a particular patient im getting a scripting error:

Cannot process ServerMessage (Phase 1)

Error Message: librariesElement is null

I have traced the error to the ClientEngine.js file, basically this line in isLibraryLoadComplete:

var librariesElement = EchoServerMessage.messageDocument.getElementsByTagName("libraries").item(0);

is returning null. Can someone point me in the direction from here on what is setting the libraries element and why it might be null?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Error Message: librariesElement is null

I haven't seen this error before. Was the patient entered via the user interface, or loaded in some way?

Typically errors in the client only occur as a result of exceptions being thrown during the rendering phase. If this is the case, you should see an error in the tomcat/logs directory, or on the console.

 

Re: Error Message: librariesElement is null

I cant see anything in the logs. Which files handle the rendering phase for the patient? Ive followed the patient summary class and it looks like its completing as far as i can tell

Re: Error Message: librariesElement is null

This patient is older it might be from an import process. Others like it are working so far it seems limited to this one only

Re: Error Message: librariesElement is null

You can debug messages between the browser and OpenVPMS using:

http://localhost:8080/openvpms/app/1?debug=true

This should display a Debug popup with the Client Request Message in one pane, and the Server Response Message in the other.

It can be a bit temperamental and not display. If this is the case, change ClientEngine.js in openvpms-web-echo as follows:

/**
 * Initializes the Echo2 Client Engine.
 *
 * @param baseServerUri the base URI of the Echo application server
 */
init: function (baseServerUri, debugEnabled) {
    EchoClientEngine.baseServerUri = baseServerUri;
    EchoClientEngine.debugEnabled = true;
    //
    //// Launch debug window if requested in URI.
    //if (EchoClientEngine.debugEnabled &&
    //    window.location.search && window.location.search.toLowerCase().indexOf("debug") != -1) {
    //    EchoDebugManager.launch();
    //}
    EchoDebugManager.launch();

You'll need to install openvpms-web-echo for it to be picked up.

 

Re: Error Message: librariesElement is null

If the error is being triggered by bad data, you may be able to find it using:

select * from entities where name like "%\0%";
select * from entities where description like "%\0%";
select * from entity_details where value like "%\0%";
select * from acts where description like "%\0%";
select * from act_details where value like "%\0%";
select * from entity_identities where name like "%\0%";
select * from entity_identities where description like "%\0%";
select * from entity_identities where identity like "%\0%";

This looks for embedded ascii 0 characters in the most likely fields.

If the issue is non-UTF8 data, try

SELECT *, length(name), char_length(name) FROM entities where length(name) > char_length(name);

for each of the above.

 

Re: Error Message: librariesElement is null

awesome found it !!!

that debug screen was handy as, one of the records in the act_details table had a blank space ASCII code in it. All sorted now thanks for that :)

Syndicate content