0
Welcome Guest! Login
0 items Join Now

RocketTheme Blog

Warning: DOMDocument::schemaValidate() Error

What an exciting day it has been! It seems that last night there was a widespread update for Redhat/Centos operating systems that run the webservers of many web hosting providers. This update included a version of the libxml2 library that is used by PHP when utilizing XML. This updated version of libxml2 seems to be causing widespread problems for existing PHP frameworks, projects and code that make use of those XML features. One of these is our own RokCommon library that is used by RokGallery and RokSprocket for both Joomla and WordPress. We make use of a static method called DOMDocument::schemavalidate() which seems to have broken with this last update, so please read more for a quick fix...

If you see an error resembling the following:

Warning: DOMDocument::schemaValidate() [domdocument.schemavalidate]: Invalid Schema in /home/userhome/public_html/libraries/rokcommon/RokCommon/Service/Container/Loader/File/Xml.php on line 263

Fatal error: Uncaught exception 'InvalidArgumentException' with message '[ERROR 3070] complex type 'service': The content model is not determinist. (in /home/userhome/public_html/libraries/rokcommon/RokCommon/Service/Container/Loader/File/services.xsd - line 38, column 0) [ERROR 3070] complex type 'argument': The content model is not determinist. (in /home/userhome/public_html/libraries/rokcommon/RokCommon/Service/Container/Loader/File/services.xsd - line 69, column 0) [ERROR 3070] complex type 'call': The content model is not determinist. (in /home/userhome/public_html/libraries/rokcommon/RokCommon/Service/Container/Loader/File/services.xsd - line 79, column 0)' in /home/userhome/public_html/libraries/rokcommon/RokCommon/Service/Container/Loader/File/Xml.php:265 Stack trace: #0 /home/userhome/public_html/libraries/rokcommon/RokCommon/Service/Container/Loader/File/Xml.php(223): RokCommon_Service_Container_Loader_File_Xml->validate(Object(DOMDocument)) #1 /home/userhome/public_html/libraries/rokcommon/RokCommon/Service/Con in /home/userhome/public_html/libraries/rokcommon/RokCommon/Service/Container/Loader/File/Xml.php on line 265

The quick fix is to locate the Xml.php file that exists in RokCommon and comment out the line that makes the schemaValidate() call.

File Locations:

Joomla 1.5/components/com_rokcommon/RokCommon/Service/Container/Loader/File/XML.php
Joomla 2.5/3.0/libraries/rokcommon/RokCommon/Service/Container/Loader/File/Xml.php
WordPress/wp-content/plugins/wp_rokcommon/RokCommon/Service/Container/Loader/File/Xml.php

Comment Out Line 223 in this Xml.php File

Find the following code on line 223

$this->validate($dom);

Comment it out by prepending // to the begining of the line, like so:

//$this->validate($dom);

We plan on releasing updates for both RokSprocket and RokGallery for both Joomla and WordPress in the next day or so. This will have this RokCommon fix in it as well as any other bug fixes we have in the queue, so keep an eye out for that!