You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XmlDriver uses SimpleXml which is not reliable to load files. Sometimes SimpleXml may successfully load file, sometimes fail with:
simplexml_load_file(): I/O warning : failed to load external entity "<filename>" in /.../doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php on line 814
Doctrine subsequently throws exception, whose message is somewhat misleading, as the complained about file exists and is perfectly valid:
Uncaught exception 'Doctrine\Common\Persistence\Mapping\MappingException' with message 'Invalid mapping file '<filename>' for class '<class name>'.' in /.../doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php:86
[1] suggests that is has to do with SimpleXml thread issues. I'm ever more suspicious because entity files are affected which haven't changed in months.
To fix this issue short-term applications may call libxml_disable_entity_loader(false);, but applications shouldn't need to care about the XML reader Doctrine uses internally. As [1] suggests as solution, users of SimpleXml should avoid SimpleXml functions which operate on files, e.g. replace simplexml_load_file(...) with simplexml_load_string(file_get_contents(...)).
XmlDriver uses SimpleXml which is not reliable to load files. Sometimes SimpleXml may successfully load file, sometimes fail with:
Doctrine subsequently throws exception, whose message is somewhat misleading, as the complained about file exists and is perfectly valid:
[1] suggests that is has to do with SimpleXml thread issues. I'm ever more suspicious because entity files are affected which haven't changed in months.
To fix this issue short-term applications may call
libxml_disable_entity_loader(false);
, but applications shouldn't need to care about the XML reader Doctrine uses internally. As [1] suggests as solution, users of SimpleXml should avoid SimpleXml functions which operate on files, e.g. replacesimplexml_load_file(...)
withsimplexml_load_string(file_get_contents(...))
.[1] https://stackoverflow.com/questions/20534866/intermittent-simplexml-load-file-i-o-warning-on-local-joomla-site
The text was updated successfully, but these errors were encountered: